codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: CUPL3" 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 case.15syn case ignore16 17" A bunch of keywords18syn keyword cuplHeader name partno date revision rev designer company nextgroup=cuplHeaderContents19syn keyword cuplHeader assembly assy location device nextgroup=cuplHeaderContents20 21syn keyword cuplTodo contained TODO XXX FIXME22 23" cuplHeaderContents uses default highlighting except for numbers24syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained25 26" String constants27syn region cuplString start=+'+ end=+'+28syn region cuplString start=+"+ end=+"+29 30syn keyword cuplStatement append condition31syn keyword cuplStatement default else32syn keyword cuplStatement field fld format function fuse33syn keyword cuplStatement group if jump loc34syn keyword cuplStatement macro min node out35syn keyword cuplStatement pin pinnode present table36syn keyword cuplStatement sequence sequenced sequencejk sequencers sequencet37 38syn keyword cuplFunction log2 log8 log16 log39 40" Valid integer number formats (decimal, binary, octal, hex)41syn match cuplNumber "\<[-+]\=[0-9]\+\>"42syn match cuplNumber "'d'[0-9]\+\>"43syn match cuplNumber "'b'[01x]\+\>"44syn match cuplNumber "'o'[0-7x]\+\>"45syn match cuplNumber "'h'[0-9a-fx]\+\>"46 47" operators48syn match cuplLogicalOperator "[!#&$]"49syn match cuplArithmeticOperator "[-+*/%]"50syn match cuplArithmeticOperator "\*\*"51syn match cuplAssignmentOperator ":\=="52syn match cuplEqualityOperator ":"53syn match cuplTruthTableOperator "=>"54 55" Signal extensions56syn match cuplExtension "\.[as][pr]\>"57syn match cuplExtension "\.oe\>"58syn match cuplExtension "\.oemux\>"59syn match cuplExtension "\.[dlsrjk]\>"60syn match cuplExtension "\.ck\>"61syn match cuplExtension "\.dq\>"62syn match cuplExtension "\.ckmux\>"63syn match cuplExtension "\.tec\>"64syn match cuplExtension "\.cnt\>"65 66syn match cuplRangeOperator "\.\." contained67 68" match ranges like memadr:[0000..1FFF]69" and highlight both the numbers and the .. operator70syn match cuplNumberRange "\<\x\+\.\.\x\+\>" contains=cuplRangeOperator71 72" match vectors of type [name3..0] (decimal numbers only)73" but assign them no special highlighting except for the .. operator74syn match cuplBitVector "\<\a\+\d\+\.\.\d\+\>" contains=cuplRangeOperator75 76" other special characters77syn match cuplSpecialChar "[\[\](){},;]"78 79" directives80" (define these after cuplOperator so $xxx overrides $)81syn match cuplDirective "\$msg"82syn match cuplDirective "\$macro"83syn match cuplDirective "\$mend"84syn match cuplDirective "\$repeat"85syn match cuplDirective "\$repend"86syn match cuplDirective "\$define"87syn match cuplDirective "\$include"88 89" multi-line comments90syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo91 92syn sync minlines=193 94" Define the default highlighting.95" Only when an item doesn't have highlighting yet96 97" The default highlighting.98hi def link cuplHeader cuplStatement99hi def link cuplLogicalOperator cuplOperator100hi def link cuplRangeOperator cuplOperator101hi def link cuplArithmeticOperator cuplOperator102hi def link cuplAssignmentOperator cuplOperator103hi def link cuplEqualityOperator cuplOperator104hi def link cuplTruthTableOperator cuplOperator105hi def link cuplOperator cuplStatement106hi def link cuplFunction cuplStatement107hi def link cuplStatement Statement108hi def link cuplNumberRange cuplNumber109hi def link cuplNumber cuplString110hi def link cuplString String111hi def link cuplComment Comment112hi def link cuplExtension cuplSpecial113hi def link cuplSpecialChar cuplSpecial114hi def link cuplSpecial Special115hi def link cuplDirective PreProc116hi def link cuplTodo Todo117 118 119let b:current_syntax = "cupl"120 121let &cpo = s:cpo_save122unlet s:cpo_save123 124" vim:ts=8125 