on master help sign in
Add Verilog syntax, closes #616
commit2dc2a3712a84122b2f535354210b2ed1e56e757c authorsharkdp <davidpeter@web.de> dateSat 31 Aug 2019, 12:59 (7 years ago) parent10e0f9e
3 files changed+153
.gitmodules+3 assets/syntaxes/Verilog+1 assets/syntaxes/Verilog.sublime-syntax+149
.gitmodules+3
@@ -144,3 +144,6 @@
144144[submodule "assets/syntaxes/GraphQL"]
145145 path = assets/syntaxes/GraphQL
146146 url = https://github.com/dncrews/GraphQL-SublimeText3.git
147+[submodule "assets/syntaxes/Verilog"]
148+ path = assets/syntaxes/Verilog
149+ url = https://github.com/pro711/sublime-verilog
assets/syntaxes/Verilognew file+1

Submodule changed.

assets/syntaxes/Verilog.sublime-syntaxnew file+149
@@ -0,0 +1,149 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Verilog
5+file_extensions:
6+ - v
7+ - V
8+scope: source.verilog
9+contexts:
10+ main:
11+ - match: '^\s*(module|function|primitive)\s+\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
12+ scope: meta.entity.module.verilog
13+ captures:
14+ 1: storage.type.verilog
15+ 2: entity.name.type.class.verilog
16+ - match: '^\s*(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*(\()'
17+ scope: meta.definition.verilog
18+ captures:
19+ 1: entity.name.type.class.verilog
20+ 2: entity.name.type.instance.verilog
21+ 3: keyword.operator.parenthesis.round.verilog
22+ - match: '^\s*(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\s+([#])(\()([ ._+`,a-zA-Z0-9]+)(\))\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*(\()'
23+ scope: meta.definition.withparameter.verilog
24+ captures:
25+ 1: entity.name.type.class.verilog
26+ 2: keyword.other.verilog
27+ 3: keyword.operator.parenthesis.round.verilog
28+ 4: keyword.other.verilog
29+ 5: keyword.operator.parenthesis.round.verilog
30+ 6: entity.name.type.instance.verilog
31+ 7: keyword.operator.parenthesis.round.verilog
32+ - match: '^\s*\b(?!else)(?!begin)([a-zA-Z_][a-zA-Z0-9_]*)\b\s+([#])'
33+ scope: meta.definition.withparameter.verilog
34+ captures:
35+ 1: entity.name.type.class.verilog
36+ 2: keyword.other.verilog
37+ - match: '^\s*(defparam)\s+([a-zA-Z_][a-zA-Z0-9_]*)(.[a-zA-Z_][a-zA-Z0-9_]*)\s*(=)'
38+ scope: meta.definition.defparam.verilog
39+ captures:
40+ 1: keyword.other.verilog
41+ 2: entity.name.type.instance.verilog
42+ 3: meta.module.parameters.verilog
43+ 4: keyword.other.verilog
44+ - match: \b(automatic|cell|config|deassign|defparam|design|disable|edge|endconfig|endgenerate|endspecify|endtable|endtask|event|generate|genvar|ifnone|incdir|include|instance|liblist|library|localparam|macromodule|negedge|noshowcancelled|posedge|pulsestyle_onevent|pulsestyle_ondetect|real|realtime|scalared|showcancelled|specify|specparam|table|task|time|use|vectored)\b
45+ scope: keyword.other.verilog
46+ - match: "(#[0-9]+)"
47+ scope: keyword.delay.verilog
48+ - match: \b(initial|always|wait|force|release|assign)\b
49+ scope: keyword.control.verilog
50+ - match: \b(begin|end|fork|join)\b
51+ scope: keyword.other.verilog
52+ - match: \b(forever|repeat|while|for|if|else|case|casex|casez|default|endcase)\b
53+ scope: keyword.control.verilog
54+ - match: '^\s*(`include)\s+(["<].*[">])'
55+ scope: meta.include.verilog
56+ captures:
57+ 1: meta.preprocessor.verilog
58+ 2: entity.name.type.include.verilog
59+ - match: '^\s*(`ifdef|`ifndef|`undef|`define)\s+([a-zA-Z_][a-zA-Z0-9_]*)\b'
60+ scope: meta.preprocessor.ifdef.verilog
61+ captures:
62+ 1: meta.preprocessor.verilog
63+ 2: constant.other.define.verilog
64+ - match: '`(celldefine|default_nettype|define|else|elsif|endcelldefine|endif|ifdef|ifndef|include|line|nounconnected_drive|resetall|timescale|unconnected_drive|undef)\b'
65+ scope: meta.preprocessor.verilog
66+ - match: "[.][_a-zA-Z0-9]+"
67+ scope: meta.module.parameters.verilog
68+ - match: '`\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
69+ scope: constant.other.define.verilog
70+ - include: comments
71+ - match: \b(endmodule|endfunction|endprimitive)\b
72+ scope: storage.type.verilog
73+ - match: '^\s*\b([a-zA-Z_][a-zA-Z0-9_]*)\b\s*(:)\s*'
74+ scope: meta.case.verilog
75+ captures:
76+ 1: entity.name.state.verilog
77+ 2: keyword.operator.bitwise.verilog
78+ - include: all-types
79+ - match: (==|===|!=|!==|<=|>=|<|>)
80+ scope: keyword.operator.comparison.verilog
81+ - match: (\-|\+|\*|\/|%)
82+ scope: keyword.operator.arithmetic.verilog
83+ - match: (!|&&|\|\|)
84+ scope: keyword.operator.logical.verilog
85+ - match: (&|\||\^|~|<<|>>|\?|:)
86+ scope: keyword.operator.bitwise.verilog
87+ - match: "({|})"
88+ scope: keyword.operator.parenthesis.curly.verilog
89+ - match: (\(|\))
90+ scope: keyword.operator.parenthesis.round.verilog
91+ - match: '(\[|\])'
92+ scope: keyword.operator.parenthesis.square.verilog
93+ - match: "([;,])"
94+ scope: keyword.delimiter.verilog
95+ - match: (#|@|=)
96+ scope: keyword.other.verilog
97+ - match: '\b(output|input|inout|and|nand|nor|or|xor|xnor|buf|not|bufif[01]|notif[01]|r?[npc]mos|tran|r?tranif[01]|pullup|pulldown)\b'
98+ scope: support.type.verilog
99+ - match: '((\b\d+)?''s?([bB]\s*(([0-1_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[oO]\s*(([0-7_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[dD]\s*(([0-9_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*))|[hH]\s*(([0-9a-fA-F_xXzZ?]+)|(`[A-Z]+[_0-9a-zA-Z]*)))((e|E)(\+|-)?[0-9]+)?\b)|(\b\d+\b)'
100+ scope: constant.numeric.verilog
101+ - include: strings
102+ - match: '\$\b([a-zA-Z_][a-zA-Z0-9_]*)\b'
103+ scope: support.function.verilog
104+ all-types:
105+ - include: storage-type-verilog
106+ - include: storage-modifier-verilog
107+ comments:
108+ - match: /\*
109+ captures:
110+ 0: punctuation.definition.comment.verilog
111+ push:
112+ - meta_scope: comment.block.verilog
113+ - match: \*/
114+ captures:
115+ 0: punctuation.definition.comment.verilog
116+ pop: true
117+ - match: (//).*$\n?
118+ scope: comment.line.double-slash.verilog
119+ captures:
120+ 1: punctuation.definition.comment.verilog
121+ storage-modifier-verilog:
122+ - match: '\b(signed|unsigned|small|medium|large|supply[01]|strong[01]|pull[01]|weak[01]|highz[01])\b'
123+ scope: storage.modifier.verilog
124+ storage-type-verilog:
125+ - match: '\b(wire|tri|tri[01]|supply[01]|wand|triand|wor|trior|trireg|reg|parameter|integer)\b'
126+ scope: storage.type.verilog
127+ strings:
128+ - match: '"'
129+ captures:
130+ 0: punctuation.definition.string.begin.verilog
131+ push:
132+ - meta_scope: string.quoted.double.verilog
133+ - match: '"'
134+ captures:
135+ 0: punctuation.definition.string.end.verilog
136+ pop: true
137+ - match: \\.
138+ scope: constant.character.escape.verilog
139+ - match: "'"
140+ captures:
141+ 0: punctuation.definition.string.begin.verilog
142+ push:
143+ - meta_scope: string.quoted.single.verilog
144+ - match: "'"
145+ captures:
146+ 0: punctuation.definition.string.end.verilog
147+ pop: true
148+ - match: \\.
149+ scope: constant.character.escape.verilog