annotate runtime/syntax/javacc.vim @ 16362:514e42de6a1d v8.1.1186

patch 8.1.1186: readdir() allocates list twice commit https://github.com/vim/vim/commit/334ad415040f9592451ec99498cd99f90d6e33e6 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 19 15:20:46 2019 +0200 patch 8.1.1186: readdir() allocates list twice Problem: readdir() allocates list twice. Solution: Remove second allocation. Also check for zero length.
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Apr 2019 15:30:05 +0200
parents 46763b01cd9a
children
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
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
15 let s:cpo_save = &cpo
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16 set cpo&vim
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
17
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "remove catching errors caused by wrong parenthesis (does not work in javacc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 "files) (first define them in case they have not been defined in java)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match javaParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match javaParenError "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match javaInParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match javaError2 "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn clear javaParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn clear javaParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn clear javaInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn clear javaError2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " remove function definitions (they look different) (first define in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " in case it was not defined in java.vim)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 "syn match javaFuncDef "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn clear javaFuncDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 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
43 syn keyword javaccPackages UNICODE_INPUT JDK_VERSION
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match javaccPackages "PARSER_END([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match javaccPackages "PARSER_BEGIN([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match javaccSpecToken "<EOF>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " the dot is necessary as otherwise it will be matched as a keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match javaccToken "<[^> \t]*>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword javaccError DEBUG IGNORE_IN_BNF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 let b:current_syntax = "javacc"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
62 let &cpo = s:cpo_save
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
63 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " vim: ts=8