main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
2.6 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = verilog
|
---|
| 4 | verilog.displayName = 'verilog'
|
---|
| 5 | verilog.aliases = []
|
---|
| 6 | function verilog(Prism) {
|
---|
| 7 | Prism.languages.verilog = {
|
---|
| 8 | comment: {
|
---|
| 9 | pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
|
---|
| 10 | greedy: true
|
---|
| 11 | },
|
---|
| 12 | string: {
|
---|
| 13 | pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
|
---|
| 14 | greedy: true
|
---|
| 15 | },
|
---|
| 16 | 'kernel-function': {
|
---|
| 17 | // support for any kernel function (ex: $display())
|
---|
| 18 | pattern: /\B\$\w+\b/,
|
---|
| 19 | alias: 'property'
|
---|
| 20 | },
|
---|
| 21 | // support for user defined constants (ex: `define)
|
---|
| 22 | constant: /\B`\w+\b/,
|
---|
| 23 | function: /\b\w+(?=\()/,
|
---|
| 24 | // support for verilog and system verilog keywords
|
---|
| 25 | keyword:
|
---|
| 26 | /\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|case|casex|casez|cell|chandle|class|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endsequence|endspecify|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_ondetect|pulsestyle_onevent|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,
|
---|
| 27 | // bold highlighting for all verilog and system verilog logic blocks
|
---|
| 28 | important: /\b(?:always|always_comb|always_ff|always_latch)\b(?: *@)?/,
|
---|
| 29 | // support for time ticks, vectors, and real numbers
|
---|
| 30 | number:
|
---|
| 31 | /\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b(?:\d*[._])?\d+(?:e[-+]?\d+)?/i,
|
---|
| 32 | operator: /[-+{}^~%*\/?=!<>&|]+/,
|
---|
| 33 | punctuation: /[[\];(),.:]/
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.