Mercurial > vim
annotate runtime/syntax/javacc.vim @ 14468:8b70108080f2
Added tag v8.1.0247 for changeset 16cccc953909f839f81d0c6339272b5b584376c1
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 07 Aug 2018 20:00:06 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: JavaCC, a Java Compiler Compiler written by JavaSoft | |
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> | |
4 " URL: http://www.fleiner.com/vim/syntax/javacc.vim | |
3854 | 5 " Last Change: 2012 Oct 05 |
7 | 6 |
7 " Uses java.vim, and adds a few special things for JavaCC Parser files. | |
8 " Those files usually have the extension *.jj | |
9 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3854
diff
changeset
|
10 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3854
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 | |
3854 | 15 let s:cpo_save = &cpo |
16 set cpo&vim | |
17 | |
7 | 18 " source the java.vim file |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3854
diff
changeset
|
19 runtime! syntax/java.vim |
7 | 20 unlet b:current_syntax |
21 | |
22 "remove catching errors caused by wrong parenthesis (does not work in javacc | |
23 "files) (first define them in case they have not been defined in java) | |
24 syn match javaParen "--" | |
25 syn match javaParenError "--" | |
26 syn match javaInParen "--" | |
27 syn match javaError2 "--" | |
28 syn clear javaParen | |
29 syn clear javaParenError | |
30 syn clear javaInParen | |
31 syn clear javaError2 | |
32 | |
33 " remove function definitions (they look different) (first define in | |
34 " in case it was not defined in java.vim) | |
35 "syn match javaFuncDef "--" | |
36 syn clear javaFuncDef | |
37 syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType | |
38 | |
39 syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER | |
40 syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK | |
41 syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING | |
42 syn keyword javaccPackages USER_TOKEN_MANAGER USER_CHAR_STREAM JAVA_UNICODE_ESCAPE | |
3854 | 43 syn keyword javaccPackages UNICODE_INPUT JDK_VERSION |
7 | 44 syn match javaccPackages "PARSER_END([^)]*)" |
45 syn match javaccPackages "PARSER_BEGIN([^)]*)" | |
46 syn match javaccSpecToken "<EOF>" | |
47 " the dot is necessary as otherwise it will be matched as a keyword. | |
48 syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1 | |
49 syn match javaccToken "<[^> \t]*>" | |
50 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN | |
51 syn keyword javaccError DEBUG IGNORE_IN_BNF | |
52 | |
53 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3854
diff
changeset
|
54 " Only when an item doesn't have highlighting yet |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
55 hi def link javaccSpecToken Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
56 hi def link javaccActionToken Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
57 hi def link javaccPackages javaScopeDecl |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
58 hi def link javaccToken String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
59 hi def link javaccError Error |
7 | 60 |
61 let b:current_syntax = "javacc" | |
3854 | 62 let &cpo = s:cpo_save |
63 unlet s:cpo_save | |
7 | 64 |
65 " vim: ts=8 |