Mercurial > vim
comparison runtime/syntax/javacc.vim @ 10048:43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 30 23:26:57 2016 +0200
Updated runtime files. Remove version checks for Vim older than 6.0.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 30 Aug 2016 23:30:09 +0200 |
parents | aa51675adf7e |
children | 46763b01cd9a |
comparison
equal
deleted
inserted
replaced
10047:a62862410ca1 | 10048:43efa4f5a8ea |
---|---|
5 " Last Change: 2012 Oct 05 | 5 " Last Change: 2012 Oct 05 |
6 | 6 |
7 " Uses java.vim, and adds a few special things for JavaCC Parser files. | 7 " Uses java.vim, and adds a few special things for JavaCC Parser files. |
8 " Those files usually have the extension *.jj | 8 " Those files usually have the extension *.jj |
9 | 9 |
10 " For version 5.x: Clear all syntax items | 10 " quit when a syntax file was already loaded |
11 " For version 6.x: Quit when a syntax file was already loaded | 11 if exists("b:current_syntax") |
12 if version < 600 | |
13 syntax clear | |
14 elseif exists("b:current_syntax") | |
15 finish | 12 finish |
16 endif | 13 endif |
17 | 14 |
18 let s:cpo_save = &cpo | 15 let s:cpo_save = &cpo |
19 set cpo&vim | 16 set cpo&vim |
20 | 17 |
21 " source the java.vim file | 18 " source the java.vim file |
22 if version < 600 | 19 runtime! syntax/java.vim |
23 source <sfile>:p:h/java.vim | |
24 else | |
25 runtime! syntax/java.vim | |
26 endif | |
27 unlet b:current_syntax | 20 unlet b:current_syntax |
28 | 21 |
29 "remove catching errors caused by wrong parenthesis (does not work in javacc | 22 "remove catching errors caused by wrong parenthesis (does not work in javacc |
30 "files) (first define them in case they have not been defined in java) | 23 "files) (first define them in case they have not been defined in java) |
31 syn match javaParen "--" | 24 syn match javaParen "--" |
56 syn match javaccToken "<[^> \t]*>" | 49 syn match javaccToken "<[^> \t]*>" |
57 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN | 50 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN |
58 syn keyword javaccError DEBUG IGNORE_IN_BNF | 51 syn keyword javaccError DEBUG IGNORE_IN_BNF |
59 | 52 |
60 " Define the default highlighting. | 53 " Define the default highlighting. |
61 " For version 5.7 and earlier: only when not done already | 54 " Only when an item doesn't have highlighting yet |
62 " For version 5.8 and later: only when an item doesn't have highlighting yet | 55 command -nargs=+ HiLink hi def link <args> |
63 if version >= 508 || !exists("did_css_syn_inits") | 56 HiLink javaccSpecToken Statement |
64 if version < 508 | 57 HiLink javaccActionToken Type |
65 let did_css_syn_inits = 1 | 58 HiLink javaccPackages javaScopeDecl |
66 command -nargs=+ HiLink hi link <args> | 59 HiLink javaccToken String |
67 else | 60 HiLink javaccError Error |
68 command -nargs=+ HiLink hi def link <args> | 61 delcommand HiLink |
69 endif | |
70 HiLink javaccSpecToken Statement | |
71 HiLink javaccActionToken Type | |
72 HiLink javaccPackages javaScopeDecl | |
73 HiLink javaccToken String | |
74 HiLink javaccError Error | |
75 delcommand HiLink | |
76 endif | |
77 | 62 |
78 let b:current_syntax = "javacc" | 63 let b:current_syntax = "javacc" |
79 let &cpo = s:cpo_save | 64 let &cpo = s:cpo_save |
80 unlet s:cpo_save | 65 unlet s:cpo_save |
81 | 66 |