annotate runtime/syntax/aflex.vim @ 6950:21cbf1529a71

Added tag v7-4-793 for changeset 1e621b31948b
author Bram Moolenaar <bram@vim.org>
date Tue, 21 Jul 2015 17:53:25 +0200
parents 3fc0f57ecb91
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Language: AfLex (from Lex syntax file)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " LastChange: 02 May 2001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Original: Lex, maintained by Dr. Charles E. Campbell, Jr.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " in aflex*
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Read the Ada syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 so <sfile>:p:h/ada.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 runtime! syntax/ada.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " --- AfLex stuff ---
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 "I'd prefer to use aflex.* , but it doesn't handle forward definitions yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn cluster aflexListGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatString,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,aflexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn cluster aflexListPatCodeGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Abbreviations Section
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn region aflexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match aflexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=aflexAbbrvRegExp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match aflexAbbrv "^%[sx]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match aflexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=aflexAbbrv,aflexInclude
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region aflexInclude matchgroup=aflexSep start="^%{" end="%}" contained contains=ALLBUT,@aflexListGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn region aflexAbbrvComment start="^\s\+/\*" end="\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 "%% : Patterns {Actions}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn region aflexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn region aflexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn region aflexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region aflexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match aflexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match aflexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn region aflexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match aflexPatCodeLine ".*$" contained contains=ALLBUT,@aflexListGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match aflexMorePat "\s*|\s*$" skipnl contained nextgroup=aflexPat,aflexPatTag,aflexPatComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match aflexPatSep "\s\+" contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match aflexSlashQuote +\(\\\\\)*\\"+ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@aflexListPatCodeGroup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword aflexCFunctions BEGIN input unput woutput yyleng yylook yytext
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword aflexCFunctions ECHO output winput wunput yyless yymore yywrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn cluster cParenGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn cluster cDefineGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn cluster cPreProcGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn cluster cMultiGroup add=aflex.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Synchronization
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn sync minlines=300
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn sync match aflexSyncPat grouphere aflexPatBlock "^%[a-zA-Z]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " 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
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 if version >= 508 || !exists("did_aflex_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 let did_aflex_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 HiLink aflexSlashQuote aflexPat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 HiLink aflexBrace aflexPat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 HiLink aflexAbbrvComment aflexPatComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink aflexAbbrv SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink aflexAbbrvRegExp Macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink aflexCFunctions Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink aflexMorePat SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink aflexPat Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink aflexPatComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink aflexPatString Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink aflexPatTag Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink aflexSep Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 let b:current_syntax = "aflex"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " vim:ts=10