File: cupl.vim

package info (click to toggle)
vim 2%3A7.4.488-7%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 49,660 kB
  • ctags: 31,441
  • sloc: ansic: 309,686; cpp: 4,068; makefile: 3,283; perl: 1,175; awk: 715; sh: 695; xml: 508; lisp: 501; cs: 458; asm: 114; python: 39; csh: 6
file content (137 lines) | stat: -rw-r--r-- 4,230 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
" Vim syntax file
" Language:	CUPL
" Maintainer:	John Cook <johncook3@gmail.com>
" Last Change:	2011 Dec 27

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

" this language is oblivious to case.
syn case ignore

" A bunch of keywords
syn keyword cuplHeader name partno date revision rev designer company nextgroup=cuplHeaderContents
syn keyword cuplHeader assembly assy location device nextgroup=cuplHeaderContents

syn keyword cuplTodo contained TODO XXX FIXME

" cuplHeaderContents uses default highlighting except for numbers
syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained

" String contstants
syn region cuplString start=+'+ end=+'+
syn region cuplString start=+"+ end=+"+

syn keyword cuplStatement append condition
syn keyword cuplStatement default else
syn keyword cuplStatement field fld format function fuse
syn keyword cuplStatement group if jump loc
syn keyword cuplStatement macro min node out
syn keyword cuplStatement pin pinnode present table
syn keyword cuplStatement sequence sequenced sequencejk sequencers sequencet

syn keyword cuplFunction log2 log8 log16 log

" Valid integer number formats (decimal, binary, octal, hex)
syn match cuplNumber "\<[-+]\=[0-9]\+\>"
syn match cuplNumber "'d'[0-9]\+\>"
syn match cuplNumber "'b'[01x]\+\>"
syn match cuplNumber "'o'[0-7x]\+\>"
syn match cuplNumber "'h'[0-9a-fx]\+\>"

" operators
syn match cuplLogicalOperator "[!#&$]"
syn match cuplArithmeticOperator "[-+*/%]"
syn match cuplArithmeticOperator "\*\*"
syn match cuplAssignmentOperator ":\=="
syn match cuplEqualityOperator ":"
syn match cuplTruthTableOperator "=>"

" Signal extensions
syn match cuplExtension "\.[as][pr]\>"
syn match cuplExtension "\.oe\>"
syn match cuplExtension "\.oemux\>"
syn match cuplExtension "\.[dlsrjk]\>"
syn match cuplExtension "\.ck\>"
syn match cuplExtension "\.dq\>"
syn match cuplExtension "\.ckmux\>"
syn match cuplExtension "\.tec\>"
syn match cuplExtension "\.cnt\>"

syn match cuplRangeOperator "\.\." contained

" match ranges like memadr:[0000..1FFF]
" and highlight both the numbers and the .. operator
syn match cuplNumberRange "\<\x\+\.\.\x\+\>" contains=cuplRangeOperator

" match vectors of type [name3..0] (decimal numbers only)
" but assign them no special highlighting except for the .. operator
syn match cuplBitVector "\<\a\+\d\+\.\.\d\+\>" contains=cuplRangeOperator

" other special characters
syn match cuplSpecialChar "[\[\](){},;]"

" directives
" (define these after cuplOperator so $xxx overrides $)
syn match cuplDirective "\$msg"
syn match cuplDirective "\$macro"
syn match cuplDirective "\$mend"
syn match cuplDirective "\$repeat"
syn match cuplDirective "\$repend"
syn match cuplDirective "\$define"
syn match cuplDirective "\$include"

" multi-line comments
syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo

syn sync minlines=1

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cupl_syn_inits")
  if version < 508
    let did_cupl_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  " The default highlighting.
  HiLink cuplHeader	cuplStatement
  HiLink cuplLogicalOperator	 cuplOperator
  HiLink cuplRangeOperator	 cuplOperator
  HiLink cuplArithmeticOperator cuplOperator
  HiLink cuplAssignmentOperator cuplOperator
  HiLink cuplEqualityOperator	 cuplOperator
  HiLink cuplTruthTableOperator cuplOperator
  HiLink cuplOperator	cuplStatement
  HiLink cuplFunction	cuplStatement
  HiLink cuplStatement Statement
  HiLink cuplNumberRange cuplNumber
  HiLink cuplNumber	  cuplString
  HiLink cuplString	String
  HiLink cuplComment	Comment
  HiLink cuplExtension   cuplSpecial
  HiLink cuplSpecialChar cuplSpecial
  HiLink cuplSpecial	Special
  HiLink cuplDirective PreProc
  HiLink cuplTodo	Todo

  delcommand HiLink
endif

let b:current_syntax = "cupl"

let &cpo = s:cpo_save
unlet s:cpo_save

" vim:ts=8