annotate runtime/syntax/javacc.vim @ 5838:0ea551fa607d v7.4.262

updated for version 7.4.262 Problem: Duplicate code in regexec(). Solution: Add line_lbr flag to regexec_nl().
author Bram Moolenaar <bram@vim.org>
date Wed, 23 Apr 2014 19:06:37 +0200
parents aa51675adf7e
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: JavaCC, a Java Compiler Compiler written by JavaSoft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/javacc.vim
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " Last Change: 2012 Oct 05
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Uses java.vim, and adds a few special things for JavaCC Parser files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Those files usually have the extension *.jj
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
18 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
19 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " source the java.vim file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 source <sfile>:p:h/java.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 runtime! syntax/java.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 "remove catching errors caused by wrong parenthesis (does not work in javacc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 "files) (first define them in case they have not been defined in java)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match javaParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match javaParenError "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match javaInParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match javaError2 "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn clear javaParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn clear javaParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn clear javaInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn clear javaError2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " remove function definitions (they look different) (first define in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " in case it was not defined in java.vim)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 "syn match javaFuncDef "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn clear javaFuncDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword javaccPackages USER_TOKEN_MANAGER USER_CHAR_STREAM JAVA_UNICODE_ESCAPE
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 syn keyword javaccPackages UNICODE_INPUT JDK_VERSION
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match javaccPackages "PARSER_END([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match javaccPackages "PARSER_BEGIN([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match javaccSpecToken "<EOF>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " the dot is necessary as otherwise it will be matched as a keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match javaccToken "<[^> \t]*>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn keyword javaccError DEBUG IGNORE_IN_BNF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 if version >= 508 || !exists("did_css_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 let did_css_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink javaccSpecToken Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink javaccActionToken Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink javaccPackages javaScopeDecl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink javaccToken String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink javaccError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 let b:current_syntax = "javacc"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
79 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
80 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " vim: ts=8