Merge branch 'MacVim'
[MacVim/KaoriYa.git] / runtime / syntax / cupl.vim
blob9f804c76c4831602983f9384ea6736463788e4e3
1 " Vim syntax file
2 " Language:     CUPL
3 " Maintainer:   John Cook <john.cook@kla-tencor.com>
4 " Last Change:  2001 Apr 25
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
8 if version < 600
9   syntax clear
10 elseif exists("b:current_syntax")
11   finish
12 endif
14 " this language is oblivious to case.
15 syn case ignore
17 " A bunch of keywords
18 syn keyword cuplHeader name partno date revision rev designer company nextgroup=cuplHeaderContents
19 syn keyword cuplHeader assembly assy location device nextgroup=cuplHeaderContents
21 syn keyword cuplTodo contained TODO XXX FIXME
23 " cuplHeaderContents uses default highlighting except for numbers
24 syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained
26 " String contstants
27 syn region cuplString start=+'+ end=+'+
28 syn region cuplString start=+"+ end=+"+
30 syn keyword cuplStatement append condition
31 syn keyword cuplStatement default else
32 syn keyword cuplStatement field fld format function fuse
33 syn keyword cuplStatement group if jump loc
34 syn keyword cuplStatement macro min node out
35 syn keyword cuplStatement pin pinnode present table
36 syn keyword cuplStatement sequence sequenced sequencejk sequencers sequencet
38 syn keyword cuplFunction log2 log8 log16 log
40 " Valid integer number formats (decimal, binary, octal, hex)
41 syn match cuplNumber "\<[-+]\=[0-9]\+\>"
42 syn match cuplNumber "'d'[0-9]\+\>"
43 syn match cuplNumber "'b'[01x]\+\>"
44 syn match cuplNumber "'o'[0-7x]\+\>"
45 syn match cuplNumber "'h'[0-9a-fx]\+\>"
47 " operators
48 syn match cuplLogicalOperator "[!#&$]"
49 syn match cuplArithmeticOperator "[-+*/%]"
50 syn match cuplArithmeticOperator "\*\*"
51 syn match cuplAssignmentOperator ":\=="
52 syn match cuplEqualityOperator ":"
53 syn match cuplTruthTableOperator "=>"
55 " Signal extensions
56 syn match cuplExtension "\.[as][pr]\>"
57 syn match cuplExtension "\.oe\>"
58 syn match cuplExtension "\.oemux\>"
59 syn match cuplExtension "\.[dlsrjk]\>"
60 syn match cuplExtension "\.ck\>"
61 syn match cuplExtension "\.dq\>"
62 syn match cuplExtension "\.ckmux\>"
63 syn match cuplExtension "\.tec\>"
64 syn match cuplExtension "\.cnt\>"
66 syn match cuplRangeOperator "\.\." contained
68 " match ranges like memadr:[0000..1FFF]
69 " and highlight both the numbers and the .. operator
70 syn match cuplNumberRange "\<\x\+\.\.\x\+\>" contains=cuplRangeOperator
72 " match vectors of type [name3..0] (decimal numbers only)
73 " but assign them no special highlighting except for the .. operator
74 syn match cuplBitVector "\<\a\+\d\+\.\.\d\+\>" contains=cuplRangeOperator
76 " other special characters
77 syn match cuplSpecialChar "[\[\](){},;]"
79 " directives
80 " (define these after cuplOperator so $xxx overrides $)
81 syn match cuplDirective "\$msg"
82 syn match cuplDirective "\$macro"
83 syn match cuplDirective "\$mend"
84 syn match cuplDirective "\$repeat"
85 syn match cuplDirective "\$repend"
86 syn match cuplDirective "\$define"
87 syn match cuplDirective "\$include"
89 " multi-line comments
90 syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo
92 syn sync minlines=1
94 " Define the default highlighting.
95 " For version 5.7 and earlier: only when not done already
96 " For version 5.8 and later: only when an item doesn't have highlighting yet
97 if version >= 508 || !exists("did_cupl_syn_inits")
98   if version < 508
99     let did_cupl_syn_inits = 1
100     command -nargs=+ HiLink hi link <args>
101   else
102     command -nargs=+ HiLink hi def link <args>
103   endif
105   " The default highlighting.
106   HiLink cuplHeader     cuplStatement
107   HiLink cuplLogicalOperator     cuplOperator
108   HiLink cuplRangeOperator       cuplOperator
109   HiLink cuplArithmeticOperator cuplOperator
110   HiLink cuplAssignmentOperator cuplOperator
111   HiLink cuplEqualityOperator    cuplOperator
112   HiLink cuplTruthTableOperator cuplOperator
113   HiLink cuplOperator   cuplStatement
114   HiLink cuplFunction   cuplStatement
115   HiLink cuplStatement Statement
116   HiLink cuplNumberRange cuplNumber
117   HiLink cuplNumber       cuplString
118   HiLink cuplString     String
119   HiLink cuplComment    Comment
120   HiLink cuplExtension   cuplSpecial
121   HiLink cuplSpecialChar cuplSpecial
122   HiLink cuplSpecial    Special
123   HiLink cuplDirective PreProc
124   HiLink cuplTodo       Todo
126   delcommand HiLink
127 endif
129 let b:current_syntax = "cupl"
130 " vim:ts=8