annotate runtime/syntax/spice.vim @ 2150:4269a0673478 v7.2.432

updated for version 7.2.432 Problem: When menus are translated they can only be found by the translated name. That makes ":emenu" difficult to use. Solution: Store the untranslated name and use it for completion and :emenu. (Edward L. Fox / Liang Peng / Bezetek James)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 22:24:40 +0200
parents 3fc0f57ecb91
children 9cb3a75a20b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Spice circuit simulator input netlist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Noam Halevy <Noam.Halevy.motorola.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: 12/08/99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " This is based on sh.vim by Lennart Schultz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " but greatly simplified
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " spice syntax is case INsensitive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword spiceTodo contained TODO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match spiceComment "^ \=\*.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match spiceComment "\$.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Numbers, all with engineering suffixes and optional units
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "==========================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match spiceNumber "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match spiceNumber "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 "integer number with optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match spiceNumber "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " Misc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 "=====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match spiceWrapLineOperator "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match spiceWrapLineOperator "^+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match spiceStatement "^ \=\.\I\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Matching pairs of parentheses
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 "==========================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn region spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn region spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 "=======
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match spiceParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 " Syncs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " =====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn sync minlines=50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 if version >= 508 || !exists("did_spice_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 let did_spice_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 HiLink spiceTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink spiceWrapLineOperator spiceOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink spiceSinglequote spiceExpr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink spiceExpr Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink spiceParenError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink spiceStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink spiceNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink spiceComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink spiceOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 let b:current_syntax = "spice"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " insert the following to $VIM/syntax/scripts.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " to autodetect HSpice netlists and text listing output:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " " Spice netlists and text listings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " so <sfile>:p:h/spice.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " vim: ts=8