annotate runtime/syntax/spice.vim @ 7538:c9fc24b76293 v7.4.1070

commit https://github.com/vim/vim/commit/8a5115cf18751022387af2085f374d38c60dde83 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 9 19:41:11 2016 +0100 patch 7.4.1070 Problem: The Tcl interface can't be loaded dynamically on Unix. Solution: Make it possible to load it dynamically. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Jan 2016 19:45:05 +0100
parents 9cb3a75a20b9
children 43efa4f5a8ea
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>
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2012 Jun 01
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " (Dominique Pelle added @Spell)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " This is based on sh.vim by Lennart Schultz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " but greatly simplified
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " spice syntax is case INsensitive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword spiceTodo contained TODO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
23 syn match spiceComment "^ \=\*.*$" contains=@Spell
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
24 syn match spiceComment "\$.*$" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " Numbers, all with engineering suffixes and optional units
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "==========================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match spiceNumber "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match spiceNumber "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "integer number with optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match spiceNumber "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " Misc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 "=====
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 syn match spiceWrapLineOperator "^+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match spiceStatement "^ \=\.\I\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Matching pairs of parentheses
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 "==========================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn region spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 "=======
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match spiceParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Syncs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " =====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn sync minlines=50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " 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
58 if version >= 508 || !exists("did_spice_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 let did_spice_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink spiceTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink spiceWrapLineOperator spiceOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink spiceSinglequote spiceExpr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink spiceExpr Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink spiceParenError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink spiceStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink spiceNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink spiceComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink spiceOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 let b:current_syntax = "spice"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " insert the following to $VIM/syntax/scripts.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " to autodetect HSpice netlists and text listing output:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " " Spice netlists and text listings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " so <sfile>:p:h/spice.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 " vim: ts=8