view runtime/syntax/ayacc.vim @ 10048:43efa4f5a8ea

commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 30 23:26:57 2016 +0200 Updated runtime files. Remove version checks for Vim older than 6.0.
author Christian Brabandt <cb@256bit.org>
date Tue, 30 Aug 2016 23:30:09 +0200
parents 91e53bcb7946
children 46763b01cd9a
line wrap: on
line source

" Vim syntax file
" Language:	AYacc
" Maintainer:	Mathieu Clabaut <mathieu.clabaut@free.fr>
" LastChange:	2011 Dec 25
" Original:	Yacc, maintained by Dr. Charles E. Campbell, Jr.
" Comment:	     Replaced sourcing c.vim file by ada.vim and rename yacc*
"		in ayacc*

" quit when a syntax file was already loaded
if exists("b:current_syntax")
   finish
endif

" Read the Ada syntax to start with
runtime! syntax/ada.vim
unlet b:current_syntax

let s:cpo_save = &cpo
set cpo&vim

" Clusters
syn cluster	ayaccActionGroup	contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError
syn cluster	ayaccUnionGroup	contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly

" Yacc stuff
syn match	ayaccDelim	"^[ \t]*[:|;]"
syn match	ayaccOper	"@\d\+"

syn match	ayaccKey	"^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
syn match	ayaccKey	"[ \t]%\(prec\|expect\|nonassoc\)\>"
syn match	ayaccKey	"\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
syn keyword	ayaccKeyActn	yyerrok yyclearin

syn match	ayaccUnionStart	"^%union"	skipwhite skipnl nextgroup=ayaccUnion
syn region	ayaccUnion	contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}"	contains=@ayaccUnionGroup
syn region	ayaccUnionCurly	contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
syn match	ayaccBrkt	contained "[<>]"
syn match	ayaccType	"<[a-zA-Z_][a-zA-Z0-9_]*>"	contains=ayaccBrkt
syn match	ayaccDefinition	"^[A-Za-z][A-Za-z0-9_]*[ \t]*:"

" special Yacc separators
syn match	ayaccSectionSep	"^[ \t]*%%"
syn match	ayaccSep	"^[ \t]*%{"
syn match	ayaccSep	"^[ \t]*%}"

" I'd really like to highlight just the outer {}.  Any suggestions???
syn match	ayaccCurlyError	"[{}]"
syn region	ayaccAction	matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup

command -nargs=+ HiLink hi def link <args>

" Internal ayacc highlighting links
HiLink ayaccBrkt	ayaccStmt
HiLink ayaccKey	ayaccStmt
HiLink ayaccOper	ayaccStmt
HiLink ayaccUnionStart	ayaccKey

" External ayacc highlighting links
HiLink ayaccCurly	Delimiter
HiLink ayaccCurlyError	Error
HiLink ayaccDefinition	Function
HiLink ayaccDelim	Function
HiLink ayaccKeyActn	Special
HiLink ayaccSectionSep	Todo
HiLink ayaccSep	Delimiter
HiLink ayaccStmt	Statement
HiLink ayaccType	Type

" since Bram doesn't like my Delimiter :|
HiLink Delimiter	Type
delcommand HiLink

let b:current_syntax = "ayacc"

let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=15