Files
lucisv/editors/vscode/syntaxes/systemverilog.tmLanguage.json
T

77 lines
3.9 KiB
JSON

{
"information_for_contributors": [
"One grammar for both contributed language ids: `verilog` and `systemverilog` register the same scopeName and the same file in package.json, because lucisv's own lexer draws no line between the two dialects.",
"The keyword alternation in `repository.keywords.match` is generated from `vlog_parser::KEYWORDS` and must stay identical to it. `crates/lucisv_server/tests/grammar.rs` fails the build if the two drift apart — regenerate, do not hand-edit.",
"Deliberately absent: operators, `(* attributes *)`, and any rule needing lookaround. The reasoning is in docs/features/editor-packaging/README.md."
],
"name": "SystemVerilog",
"scopeName": "source.systemverilog",
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#directives" },
{ "include": "#macros" },
{ "include": "#system-tasks" },
{ "include": "#numbers" },
{ "include": "#keywords" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.systemverilog",
"match": "//.*"
},
{
"name": "comment.block.systemverilog",
"begin": "/\\*",
"end": "\\*/"
}
]
},
"strings": {
"name": "string.quoted.double.systemverilog",
"begin": "\"",
"end": "\"|$",
"patterns": [
{
"name": "constant.character.escape.systemverilog",
"match": "\\\\."
}
]
},
"directives": {
"name": "keyword.control.directive.systemverilog",
"match": "`(define|undefineall|undef|ifdef|ifndef|elsif|else|endif|include|timescale|default_nettype|resetall|celldefine|endcelldefine|unconnected_drive|nounconnected_drive|line|begin_keywords|end_keywords|pragma|__FILE__|__LINE__)\\b"
},
"macros": {
"name": "entity.name.function.preprocessor.systemverilog",
"match": "`[a-zA-Z_][a-zA-Z0-9_$]*"
},
"system-tasks": {
"name": "support.function.system.systemverilog",
"match": "\\$[a-zA-Z_][a-zA-Z0-9_$]*"
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.based.systemverilog",
"match": "(\\b[0-9][0-9_]*\\s*)?'[sS]?[bBoOdDhH][0-9a-fA-FxXzZ?_]+"
},
{
"name": "constant.numeric.fill.systemverilog",
"match": "'[01xXzZ]\\b"
},
{
"name": "constant.numeric.systemverilog",
"match": "\\b[0-9][0-9_]*(\\.[0-9_]+)?([eE][-+]?[0-9_]+)?(fs|ps|ns|us|ms|s)?\\b"
}
]
},
"keywords": {
"name": "keyword.other.systemverilog",
"match": "\\b(module|macromodule|endmodule|interface|endinterface|package|endpackage|program|endprogram|modport|clocking|endclocking|input|output|inout|ref|wire|tri|tri0|tri1|wand|wor|trireg|supply0|supply1|uwire|reg|logic|bit|byte|shortint|int|longint|integer|time|realtime|real|shortreal|string|chandle|event|var|void|signed|unsigned|packed|parameter|localparam|defparam|specparam|type|typedef|enum|struct|union|assign|alias|always|always_comb|always_ff|always_latch|initial|final|begin|end|if|else|case|casex|casez|randcase|let|endcase|default|unique|unique0|priority|for|while|repeat|forever|do|foreach|break|continue|return|fork|join|join_any|join_none|disable|wait|posedge|negedge|edge|or|and|nand|nor|xor|xnor|not|buf|bufif0|bufif1|notif0|notif1|pullup|pulldown|generate|endgenerate|genvar|class|endclass|extends|implements|virtual|pure|extern|rand|randc|local|protected|constraint|covergroup|endgroup|function|endfunction|task|endtask|automatic|static|const|import|export|timeunit|timeprecision|assert|assume|cover|property|endproperty|sequence|endsequence|inside|with|iff|release|force|deassign|primitive|endprimitive|specify|endspecify|table|endtable|small|medium|large|scalared|vectored|highz0|highz1|strong0|strong1|pull0|pull1|weak0|weak1|cmos|rcmos|nmos|pmos|rnmos|rpmos|tran|rtran|tranif0|tranif1|rtranif0|rtranif1)\\b"
}
}
}