1071d4279SBram Moolenaar 2071d4279SBram Moolenaar" Vim syntax file 3071d4279SBram Moolenaar" Language: AfLex (from Lex syntax file) 4071d4279SBram Moolenaar" Maintainer: Mathieu Clabaut <[email protected]> 5071d4279SBram Moolenaar" LastChange: 02 May 2001 6071d4279SBram Moolenaar" Original: Lex, maintained by Dr. Charles E. Campbell, Jr. 7071d4279SBram Moolenaar" Comment: Replaced sourcing c.vim file by ada.vim and rename lex* 8071d4279SBram Moolenaar" in aflex* 9071d4279SBram Moolenaar 1089bcfda6SBram Moolenaar" quit when a syntax file was already loaded 1189bcfda6SBram Moolenaarif exists("b:current_syntax") 12071d4279SBram Moolenaar finish 13071d4279SBram Moolenaarendif 14071d4279SBram Moolenaar 15071d4279SBram Moolenaar" Read the Ada syntax to start with 16071d4279SBram Moolenaarruntime! syntax/ada.vim 17071d4279SBram Moolenaarunlet b:current_syntax 18071d4279SBram Moolenaar 19071d4279SBram Moolenaar 20071d4279SBram Moolenaar" --- AfLex stuff --- 21071d4279SBram Moolenaar 22071d4279SBram Moolenaar"I'd prefer to use aflex.* , but it doesn't handle forward definitions yet 23071d4279SBram Moolenaarsyn 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 24071d4279SBram Moolenaarsyn 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 25071d4279SBram Moolenaar 26071d4279SBram Moolenaar" Abbreviations Section 27071d4279SBram Moolenaarsyn region aflexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment 28071d4279SBram Moolenaarsyn match aflexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=aflexAbbrvRegExp 29071d4279SBram Moolenaarsyn match aflexAbbrv "^%[sx]" contained 30071d4279SBram Moolenaarsyn match aflexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=aflexAbbrv,aflexInclude 31071d4279SBram Moolenaarsyn region aflexInclude matchgroup=aflexSep start="^%{" end="%}" contained contains=ALLBUT,@aflexListGroup 32071d4279SBram Moolenaarsyn region aflexAbbrvComment start="^\s\+/\*" end="\*/" 33071d4279SBram Moolenaar 34071d4279SBram Moolenaar"%% : Patterns {Actions} 35071d4279SBram Moolenaarsyn region aflexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment 36071d4279SBram Moolenaarsyn region aflexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace 37071d4279SBram Moolenaarsyn region aflexBrace start="\[" skip=+\\\\\|\\+ end="]" contained 38071d4279SBram Moolenaarsyn region aflexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained 39071d4279SBram Moolenaarsyn match aflexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep 40071d4279SBram Moolenaarsyn match aflexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep 41071d4279SBram Moolenaarsyn region aflexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag 42071d4279SBram Moolenaarsyn match aflexPatCodeLine ".*$" contained contains=ALLBUT,@aflexListGroup 43071d4279SBram Moolenaarsyn match aflexMorePat "\s*|\s*$" skipnl contained nextgroup=aflexPat,aflexPatTag,aflexPatComment 44071d4279SBram Moolenaarsyn match aflexPatSep "\s\+" contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine 45071d4279SBram Moolenaarsyn match aflexSlashQuote +\(\\\\\)*\\"+ contained 46071d4279SBram Moolenaarsyn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@aflexListPatCodeGroup 47071d4279SBram Moolenaar 48071d4279SBram Moolenaarsyn keyword aflexCFunctions BEGIN input unput woutput yyleng yylook yytext 49071d4279SBram Moolenaarsyn keyword aflexCFunctions ECHO output winput wunput yyless yymore yywrap 50071d4279SBram Moolenaar 51071d4279SBram Moolenaar" <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups 52071d4279SBram Moolenaarsyn cluster cParenGroup add=aflex.* 53071d4279SBram Moolenaarsyn cluster cDefineGroup add=aflex.* 54071d4279SBram Moolenaarsyn cluster cPreProcGroup add=aflex.* 55071d4279SBram Moolenaarsyn cluster cMultiGroup add=aflex.* 56071d4279SBram Moolenaar 57071d4279SBram Moolenaar" Synchronization 58071d4279SBram Moolenaarsyn sync clear 59071d4279SBram Moolenaarsyn sync minlines=300 60071d4279SBram Moolenaarsyn sync match aflexSyncPat grouphere aflexPatBlock "^%[a-zA-Z]" 61071d4279SBram Moolenaarsyn sync match aflexSyncPat groupthere aflexPatBlock "^<$" 62071d4279SBram Moolenaarsyn sync match aflexSyncPat groupthere aflexPatBlock "^%%$" 63071d4279SBram Moolenaar 64071d4279SBram Moolenaar" Define the default highlighting. 6589bcfda6SBram Moolenaar" Only when an item doesn't have highlighting yet 66*f37506f6SBram Moolenaarhi def link aflexSlashQuote aflexPat 67*f37506f6SBram Moolenaarhi def link aflexBrace aflexPat 68*f37506f6SBram Moolenaarhi def link aflexAbbrvComment aflexPatComment 69071d4279SBram Moolenaar 70*f37506f6SBram Moolenaarhi def link aflexAbbrv SpecialChar 71*f37506f6SBram Moolenaarhi def link aflexAbbrvRegExp Macro 72*f37506f6SBram Moolenaarhi def link aflexCFunctions Function 73*f37506f6SBram Moolenaarhi def link aflexMorePat SpecialChar 74*f37506f6SBram Moolenaarhi def link aflexPat Function 75*f37506f6SBram Moolenaarhi def link aflexPatComment Comment 76*f37506f6SBram Moolenaarhi def link aflexPatString Function 77*f37506f6SBram Moolenaarhi def link aflexPatTag Special 78*f37506f6SBram Moolenaarhi def link aflexSep Delimiter 79071d4279SBram Moolenaar 80071d4279SBram Moolenaarlet b:current_syntax = "aflex" 81071d4279SBram Moolenaar 82071d4279SBram Moolenaar" vim:ts=10 83