neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

aflex.vim (4368B)


      1 " Vim syntax file
      2 " Language:	AfLex (from Lex syntax file)
      3 " Maintainer:	Mathieu Clabaut <mathieu.clabaut@free.fr>
      4 " LastChange:	02 May 2001
      5 " Original:	Lex, maintained by Dr. Charles E. Campbell, Jr.
      6 " Comment:	Replaced sourcing c.vim file by ada.vim and rename lex*
      7 "		in aflex*
      8 
      9 " quit when a syntax file was already loaded
     10 if exists("b:current_syntax")
     11   finish
     12 endif
     13 
     14 " Read the Ada syntax to start with
     15 runtime! syntax/ada.vim
     16 unlet b:current_syntax
     17 
     18 
     19 " --- AfLex stuff ---
     20 
     21 "I'd prefer to use aflex.* , but it doesn't handle forward definitions yet
     22 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
     23 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
     24 
     25 " Abbreviations Section
     26 syn region aflexAbbrvBlock	start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2	skipnl	nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment
     27 syn match  aflexAbbrv		"^\I\i*\s"me=e-1			skipwhite	contained nextgroup=aflexAbbrvRegExp
     28 syn match  aflexAbbrv		"^%[sx]"					contained
     29 syn match  aflexAbbrvRegExp	"\s\S.*$"lc=1				contained nextgroup=aflexAbbrv,aflexInclude
     30 syn region aflexInclude	matchgroup=aflexSep	start="^%{" end="%}"	contained	contains=ALLBUT,@aflexListGroup
     31 syn region aflexAbbrvComment	start="^\s\+/\*"	end="\*/"
     32 
     33 "%% : Patterns {Actions}
     34 syn region aflexPatBlock	matchgroup=Todo	start="^%%$" matchgroup=Todo end="^%%$"	skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment
     35 syn region aflexPat		start=+\S+ skip="\\\\\|\\."	end="\s"me=e-1	contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace
     36 syn region aflexBrace	start="\[" skip=+\\\\\|\\+		end="]"		contained
     37 syn region aflexPatString	matchgroup=String start=+"+	skip=+\\\\\|\\"+	matchgroup=String end=+"+	contained
     38 syn match  aflexPatTag	"^<\I\i*\(,\I\i*\)*>*"			contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
     39 syn match  aflexPatTag	+^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+		contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
     40 syn region aflexPatComment	start="^\s*/\*" end="\*/"		skipnl	contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag
     41 syn match  aflexPatCodeLine	".*$"					contained contains=ALLBUT,@aflexListGroup
     42 syn match  aflexMorePat	"\s*|\s*$"			skipnl	contained nextgroup=aflexPat,aflexPatTag,aflexPatComment
     43 syn match  aflexPatSep	"\s\+"					contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine
     44 syn match  aflexSlashQuote	+\(\\\\\)*\\"+				contained
     45 syn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}"	skipnl contained contains=ALLBUT,@aflexListPatCodeGroup
     46 
     47 syn keyword aflexCFunctions	BEGIN	input	unput	woutput	yyleng	yylook	yytext
     48 syn keyword aflexCFunctions	ECHO	output	winput	wunput	yyless	yymore	yywrap
     49 
     50 " <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups
     51 syn cluster cParenGroup	add=aflex.*
     52 syn cluster cDefineGroup	add=aflex.*
     53 syn cluster cPreProcGroup	add=aflex.*
     54 syn cluster cMultiGroup	add=aflex.*
     55 
     56 " Synchronization
     57 syn sync clear
     58 syn sync minlines=300
     59 syn sync match aflexSyncPat	grouphere  aflexPatBlock	"^%[a-zA-Z]"
     60 syn sync match aflexSyncPat	groupthere aflexPatBlock	"^<$"
     61 syn sync match aflexSyncPat	groupthere aflexPatBlock	"^%%$"
     62 
     63 " Define the default highlighting.
     64 " Only when an item doesn't have highlighting yet
     65 hi def link aflexSlashQuote	aflexPat
     66 hi def link aflexBrace		aflexPat
     67 hi def link aflexAbbrvComment	aflexPatComment
     68 
     69 hi def link aflexAbbrv		SpecialChar
     70 hi def link aflexAbbrvRegExp	Macro
     71 hi def link aflexCFunctions	Function
     72 hi def link aflexMorePat	SpecialChar
     73 hi def link aflexPat		Function
     74 hi def link aflexPatComment	Comment
     75 hi def link aflexPatString	Function
     76 hi def link aflexPatTag		Special
     77 hi def link aflexSep		Delimiter
     78 
     79 let b:current_syntax = "aflex"
     80 
     81 " vim:ts=10