neovim

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

ayacc.vim (2585B)


      1 " Vim syntax file
      2 " Language:	AYacc
      3 " Maintainer:	Mathieu Clabaut <mathieu.clabaut@free.fr>
      4 " LastChange:	2011 Dec 25
      5 " Original:	Yacc, maintained by Dr. Charles E. Campbell, Jr.
      6 " Comment:	     Replaced sourcing c.vim file by ada.vim and rename yacc*
      7 "		in ayacc*
      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 let s:cpo_save = &cpo
     19 set cpo&vim
     20 
     21 " Clusters
     22 syn cluster	ayaccActionGroup	contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError
     23 syn cluster	ayaccUnionGroup	contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
     24 
     25 " Yacc stuff
     26 syn match	ayaccDelim	"^[ \t]*[:|;]"
     27 syn match	ayaccOper	"@\d\+"
     28 
     29 syn match	ayaccKey	"^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
     30 syn match	ayaccKey	"[ \t]%\(prec\|expect\|nonassoc\)\>"
     31 syn match	ayaccKey	"\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
     32 syn keyword	ayaccKeyActn	yyerrok yyclearin
     33 
     34 syn match	ayaccUnionStart	"^%union"	skipwhite skipnl nextgroup=ayaccUnion
     35 syn region	ayaccUnion	contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}"	contains=@ayaccUnionGroup
     36 syn region	ayaccUnionCurly	contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
     37 syn match	ayaccBrkt	contained "[<>]"
     38 syn match	ayaccType	"<[a-zA-Z_][a-zA-Z0-9_]*>"	contains=ayaccBrkt
     39 syn match	ayaccDefinition	"^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
     40 
     41 " special Yacc separators
     42 syn match	ayaccSectionSep	"^[ \t]*%%"
     43 syn match	ayaccSep	"^[ \t]*%{"
     44 syn match	ayaccSep	"^[ \t]*%}"
     45 
     46 " I'd really like to highlight just the outer {}.  Any suggestions???
     47 syn match	ayaccCurlyError	"[{}]"
     48 syn region	ayaccAction	matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
     49 
     50 
     51 " Internal ayacc highlighting links
     52 hi def link ayaccBrkt	ayaccStmt
     53 hi def link ayaccKey	ayaccStmt
     54 hi def link ayaccOper	ayaccStmt
     55 hi def link ayaccUnionStart	ayaccKey
     56 
     57 " External ayacc highlighting links
     58 hi def link ayaccCurly	Delimiter
     59 hi def link ayaccCurlyError	Error
     60 hi def link ayaccDefinition	Function
     61 hi def link ayaccDelim	Function
     62 hi def link ayaccKeyActn	Special
     63 hi def link ayaccSectionSep	Todo
     64 hi def link ayaccSep	Delimiter
     65 hi def link ayaccStmt	Statement
     66 hi def link ayaccType	Type
     67 
     68 " since Bram doesn't like my Delimiter :|
     69 hi def link Delimiter	Type
     70 
     71 let b:current_syntax = "ayacc"
     72 
     73 let &cpo = s:cpo_save
     74 unlet s:cpo_save
     75 " vim: ts=15