codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: ABEL3" Maintainer: John Cook <johncook3@gmail.com>4" Last Change: 2011 Dec 275 6" quit when a syntax file was already loaded7if exists("b:current_syntax")8 finish9endif10 11let s:cpo_save = &cpo12set cpo&vim13 14" this language is oblivious to case15syn case ignore16 17" A bunch of keywords18syn keyword abelHeader module title device options19syn keyword abelSection declarations equations test_vectors end20syn keyword abelDeclaration state truth_table state_diagram property21syn keyword abelType pin node attribute constant macro library22 23syn keyword abelTypeId com reg neg pos buffer dc reg_d reg_t contained24syn keyword abelTypeId reg_sr reg_jk reg_g retain xor invert contained25 26syn keyword abelStatement when then else if with endwith case endcase27syn keyword abelStatement fuses expr trace28 29" option to omit obsolete statements30if exists("abel_obsolete_ok")31 syn keyword abelStatement enable flag in32else33 syn keyword abelError enable flag in34endif35 36" directives37syn match abelDirective "@alternate"38syn match abelDirective "@standard"39syn match abelDirective "@const"40syn match abelDirective "@dcset"41syn match abelDirective "@include"42syn match abelDirective "@page"43syn match abelDirective "@radix"44syn match abelDirective "@repeat"45syn match abelDirective "@irp"46syn match abelDirective "@expr"47syn match abelDirective "@if"48syn match abelDirective "@ifb"49syn match abelDirective "@ifnb"50syn match abelDirective "@ifdef"51syn match abelDirective "@ifndef"52syn match abelDirective "@ifiden"53syn match abelDirective "@ifniden"54 55syn keyword abelTodo contained TODO XXX FIXME56 57" wrap up type identifiers to differentiate them from normal strings58syn region abelSpecifier start='istype' end=';' contains=abelTypeIdChar,abelTypeId,abelTypeIdEnd keepend59syn match abelTypeIdChar "[,']" contained60syn match abelTypeIdEnd ";" contained61 62" string constants and special characters within them63syn match abelSpecial contained "\\['\\]"64syn region abelString start=+'+ skip=+\\"+ end=+'+ contains=abelSpecial65 66" valid integer number formats (decimal, binary, octal, hex)67syn match abelNumber "\<[-+]\=[0-9]\+\>"68syn match abelNumber "\^d[0-9]\+\>"69syn match abelNumber "\^b[01]\+\>"70syn match abelNumber "\^o[0-7]\+\>"71syn match abelNumber "\^h[0-9a-f]\+\>"72 73" special characters74" (define these after abelOperator so ?= overrides ?)75syn match abelSpecialChar "[\[\](){},;:?]"76 77" operators78syn match abelLogicalOperator "[!#&$]"79syn match abelRangeOperator "\.\."80syn match abelAlternateOperator "[/*+]"81syn match abelAlternateOperator ":[+*]:"82syn match abelArithmeticOperator "[-%]"83syn match abelArithmeticOperator "<<"84syn match abelArithmeticOperator ">>"85syn match abelRelationalOperator "[<>!=]="86syn match abelRelationalOperator "[<>]"87syn match abelAssignmentOperator "[:?]\=="88syn match abelAssignmentOperator "?:="89syn match abelTruthTableOperator "->"90 91" signal extensions92syn match abelExtension "\.aclr\>"93syn match abelExtension "\.aset\>"94syn match abelExtension "\.clk\>"95syn match abelExtension "\.clr\>"96syn match abelExtension "\.com\>"97syn match abelExtension "\.fb\>"98syn match abelExtension "\.[co]e\>"99syn match abelExtension "\.l[eh]\>"100syn match abelExtension "\.fc\>"101syn match abelExtension "\.pin\>"102syn match abelExtension "\.set\>"103syn match abelExtension "\.[djksrtq]\>"104syn match abelExtension "\.pr\>"105syn match abelExtension "\.re\>"106syn match abelExtension "\.a[pr]\>"107syn match abelExtension "\.s[pr]\>"108 109" special constants110syn match abelConstant "\.[ckudfpxz]\."111syn match abelConstant "\.sv[2-9]\."112 113" one-line comments114syn region abelComment start=+"+ end=+"\|$+ contains=abelNumber,abelTodo115" option to prevent C++ style comments116if !exists("abel_cpp_comments_illegal")117 syn region abelComment start=+//+ end=+$+ contains=abelNumber,abelTodo118endif119 120syn sync minlines=1121 122" Define the default highlighting.123" Only when an item doesn't have highlighting yet124 125" The default highlighting.126hi def link abelHeader abelStatement127hi def link abelSection abelStatement128hi def link abelDeclaration abelStatement129hi def link abelLogicalOperator abelOperator130hi def link abelRangeOperator abelOperator131hi def link abelAlternateOperator abelOperator132hi def link abelArithmeticOperator abelOperator133hi def link abelRelationalOperator abelOperator134hi def link abelAssignmentOperator abelOperator135hi def link abelTruthTableOperator abelOperator136hi def link abelSpecifier abelStatement137hi def link abelOperator abelStatement138hi def link abelStatement Statement139hi def link abelIdentifier Identifier140hi def link abelTypeId abelType141hi def link abelTypeIdChar abelType142hi def link abelType Type143hi def link abelNumber abelString144hi def link abelString String145hi def link abelConstant Constant146hi def link abelComment Comment147hi def link abelExtension abelSpecial148hi def link abelSpecialChar abelSpecial149hi def link abelTypeIdEnd abelSpecial150hi def link abelSpecial Special151hi def link abelDirective PreProc152hi def link abelTodo Todo153hi def link abelError Error154 155 156let b:current_syntax = "abel"157 158let &cpo = s:cpo_save159unlet s:cpo_save160 161" vim:ts=8162 