From 87c7eb8560873d7007fdc7643e080f225a1d386d Mon Sep 17 00:00:00 2001 From: dalance Date: Thu, 26 Dec 2024 21:30:20 +0900 Subject: [PATCH] Update parol to v2 --- Cargo.lock | 149 ++++++- crates/languageserver/build.rs | 11 +- crates/parser/Cargo.toml | 6 +- crates/parser/build.rs | 1 - crates/parser/src/generated/veryl-exp.par | 150 +++---- .../src/generated/veryl_grammar_trait.rs | 304 ++++++------- crates/parser/src/generated/veryl_parser.rs | 405 +++++++++--------- crates/parser/src/parser_error.rs | 5 +- crates/parser/src/veryl_token.rs | 4 +- crates/parser/veryl.par | 152 +++---- 10 files changed, 653 insertions(+), 534 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b7fda0a..ac931acf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -285,9 +285,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -969,6 +969,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "dot-writer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2f7a508d3f95b7cb559acf2231c7efad02fe04061d3165b12513c2dbcc77af0" + [[package]] name = "dunce" version = "1.0.5" @@ -2686,7 +2692,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", "redox_syscall", ] @@ -3014,7 +3020,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -3038,6 +3044,40 @@ dependencies = [ "notify", ] +[[package]] +name = "num" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -3054,6 +3094,26 @@ dependencies = [ "itoa", ] +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-modular" version = "0.6.1" @@ -3069,6 +3129,18 @@ dependencies = [ "num-modular", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -3179,13 +3251,13 @@ dependencies = [ [[package]] name = "parol" -version = "1.0.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bbe37e030f949d82fc51fcb9984d3ecc63286475fd8519e73a69e20bd60207" +checksum = "9b3b2d44c49d3d4a594a7193c2a37fd8d2480971a61429c1744533e7d5bd8c24" dependencies = [ "anyhow", "assert_cmd", - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg-if", "clap", "derive_builder", @@ -3203,13 +3275,14 @@ dependencies = [ "rayon", "regex", "regex-syntax", + "rustc-hash 2.1.0", "serde", "serde_json", "syn", "syntree", "syntree_layout", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.11", "ts-rs", "ume", ] @@ -3222,9 +3295,9 @@ checksum = "54ec451836679aaa55158b454b441e21446a111ea34aa1917eba29245bafe4b8" [[package]] name = "parol_runtime" -version = "1.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625c600b236f51ec839eb63e512388bb66dc344cdf5a3e823189b770053fe4bc" +checksum = "3b030a230ea7c50b77b4f6e7de4e0dc61a471b1c3ee767cb241e636dfdc11e93" dependencies = [ "anyhow", "codespan-reporting", @@ -3234,10 +3307,11 @@ dependencies = [ "once_cell", "parol-macros", "petgraph", - "regex-automata", + "scnr", + "serde_json", "syntree", "syntree_layout", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] @@ -3532,7 +3606,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "memchr", "pulldown-cmark-escape 0.10.1", "unicase", @@ -3544,7 +3618,7 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "getopts", "memchr", "pulldown-cmark-escape 0.11.0", @@ -3665,7 +3739,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -3865,6 +3939,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc_version" version = "0.2.3" @@ -3880,7 +3960,7 @@ version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", @@ -3939,6 +4019,22 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scnr" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e4a344e85a3b8473a2852a03dd8f30f3b2968c3fb234c984a8405e9fb4975b7" +dependencies = [ + "dot-writer", + "log", + "regex-syntax", + "rustc-hash 2.1.0", + "serde", + "serde_json", + "seshat-unicode", + "thiserror 2.0.11", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -4059,6 +4155,15 @@ dependencies = [ "serde", ] +[[package]] +name = "seshat-unicode" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c383601b899fbb8a859ae943fe23eb0385b7cd30ebd6d24e6827bc786635c48" +dependencies = [ + "num", +] + [[package]] name = "sha1" version = "0.10.6" @@ -4169,7 +4274,7 @@ dependencies = [ "data-encoding", "debugid", "if_chain", - "rustc-hash", + "rustc-hash 1.1.0", "rustc_version", "serde", "serde_json", @@ -4322,19 +4427,19 @@ dependencies = [ [[package]] name = "syntree" -version = "0.14.5" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a019a25d9135e907319cd33f02eeed4633388deea3a723b9242d062fa09486" +checksum = "00c99c9cda412afe293a6b962af651b4594161ba88c1affe7ef66459ea040a06" [[package]] name = "syntree_layout" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4dcc044568a0f9708c87b9dd79f1d8e5fb2086a831ead7ef044c9a48bd756b" +checksum = "24d027955f5f14d526450b6a11ef5aa962761e924dcd092298dd0d1466570565" dependencies = [ "anyhow", "syntree", - "thiserror 1.0.69", + "thiserror 2.0.11", "xml_writer", ] diff --git a/crates/languageserver/build.rs b/crates/languageserver/build.rs index 6dcf425c..dfe53282 100644 --- a/crates/languageserver/build.rs +++ b/crates/languageserver/build.rs @@ -17,13 +17,18 @@ fn main() { let text = fs::read_to_string(par_file).unwrap(); let mut keywords = "pub const KEYWORDS: &[&str] = &[\n".to_string(); + let mut in_keyword = false; for line in text.lines() { - if line.contains("(?-u:\\b)") { + if line == "// -- keyword end --" { + in_keyword = false; + } + if in_keyword { let keyword = line.split('/').nth(1).unwrap(); - let keyword = keyword.replace("(?-u:\\b)", ""); - let keyword = keyword.replace("(?-u:\\b)", ""); keywords.push_str(&format!(" \"{keyword}\",\n")); } + if line == "// -- keyword begin --" { + in_keyword = true; + } } keywords.push_str("];\n"); fs::write(exp_file, keywords).unwrap(); diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index 9bef5b06..c67333af 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -17,7 +17,7 @@ exclude = ["build.rs"] anyhow = {workspace = true} bimap = "0.6.3" once_cell = {workspace = true} -parol_runtime = {version = "1.0", features = ["auto_generation"]} +parol_runtime = "2.1.1" paste = "1.0" regex = {workspace = true} thiserror = {workspace = true} @@ -29,5 +29,5 @@ miette = {workspace = true, features = ["fancy-no-syscall"]} miette = {workspace = true, features = ["fancy"]} [build-dependencies] -parol = "1.0" -parol_runtime = {version = "1.0", features = ["auto_generation"]} +parol = "2.1.2" +parol_runtime = "2.1.1" diff --git a/crates/parser/build.rs b/crates/parser/build.rs index 56c70446..95c332e5 100644 --- a/crates/parser/build.rs +++ b/crates/parser/build.rs @@ -32,7 +32,6 @@ fn main() { .expanded_grammar_output_file("veryl-exp.par") .parser_output_file("veryl_parser.rs") .actions_output_file("veryl_grammar_trait.rs") - .enable_auto_generation() .user_type_name("VerylGrammar") .user_trait_module_name("veryl_grammar") .trim_parse_tree() diff --git a/crates/parser/src/generated/veryl-exp.par b/crates/parser/src/generated/veryl-exp.par index 8ca411c1..9a23bd7c 100644 --- a/crates/parser/src/generated/veryl-exp.par +++ b/crates/parser/src/generated/veryl-exp.par @@ -12,13 +12,13 @@ %% -/* 0 */ CommentsTerm: "(?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+" : Token; -/* 1 */ StringLiteralTerm: "\u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}" : Token; -/* 2 */ ExponentTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*/ : Token; -/* 3 */ FixedPointTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*/ : Token; -/* 4 */ BasedTerm: /(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*/ : Token; -/* 5 */ AllBitTerm: /(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]/ : Token; -/* 6 */ BaseLessTerm: /[0-9]+(?:_[0-9]+)*/ : Token; +/* 0 */ CommentsTerm: "(((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*/))\s*)+" : Token; +/* 1 */ StringLiteralTerm: "\u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}" : Token; +/* 2 */ ExponentTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*/ : Token; +/* 3 */ FixedPointTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*/ : Token; +/* 4 */ BasedTerm: /([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)*/ : Token; +/* 5 */ AllBitTerm: /([0-9]+(_[0-9]+)*)?'[01xzXZ]/ : Token; +/* 6 */ BaseLessTerm: /[0-9]+(_[0-9]+)*/ : Token; /* 7 */ MinusColonTerm: '-:' : Token; /* 8 */ MinusGTTerm: '->' : Token; /* 9 */ PlusColonTerm: '+:' : Token; @@ -27,7 +27,7 @@ /* 12 */ Operator10Term: "/|%" : Token; /* 13 */ Operator09Term: "\+|-" : Token; /* 14 */ Operator08Term: "<<<|>>>|<<|>>" : Token; -/* 15 */ Operator07Term: "<=|>=|<:|>:" : Token; +/* 15 */ Operator07Term: "<=|>=|<:|>:" ?! ":" : Token; /* 16 */ Operator06Term: "===|==\?|!==|!=\?|==|!=" : Token; /* 17 */ Operator02Term: "&&" : Token; /* 18 */ Operator01Term: "\|\|" : Token; @@ -56,74 +56,74 @@ /* 41 */ RParenTerm: ')' : Token; /* 42 */ SemicolonTerm: ';' : Token; /* 43 */ StarTerm: '*' : Token; -/* 44 */ AlwaysCombTerm: /(?-u:\b)always_comb(?-u:\b)/ : Token; -/* 45 */ AlwaysFfTerm: /(?-u:\b)always_ff(?-u:\b)/ : Token; -/* 46 */ AssignTerm: /(?-u:\b)assign(?-u:\b)/ : Token; -/* 47 */ AsTerm: /(?-u:\b)as(?-u:\b)/ : Token; -/* 48 */ BitTerm: /(?-u:\b)bit(?-u:\b)/ : Token; -/* 49 */ CaseTerm: /(?-u:\b)case(?-u:\b)/ : Token; -/* 50 */ ClockTerm: /(?-u:\b)clock(?-u:\b)/ : Token; -/* 51 */ ClockPosedgeTerm: /(?-u:\b)clock_posedge(?-u:\b)/ : Token; -/* 52 */ ClockNegedgeTerm: /(?-u:\b)clock_negedge(?-u:\b)/ : Token; -/* 53 */ ConstTerm: /(?-u:\b)const(?-u:\b)/ : Token; -/* 54 */ DefaultTerm: /(?-u:\b)default(?-u:\b)/ : Token; -/* 55 */ ElseTerm: /(?-u:\b)else(?-u:\b)/ : Token; -/* 56 */ EmbedTerm: /(?-u:\b)embed(?-u:\b)/ : Token; -/* 57 */ EnumTerm: /(?-u:\b)enum(?-u:\b)/ : Token; -/* 58 */ ExportTerm: /(?-u:\b)export(?-u:\b)/ : Token; -/* 59 */ F32Term: /(?-u:\b)f32(?-u:\b)/ : Token; -/* 60 */ F64Term: /(?-u:\b)f64(?-u:\b)/ : Token; -/* 61 */ FinalTerm: /(?-u:\b)final(?-u:\b)/ : Token; -/* 62 */ ForTerm: /(?-u:\b)for(?-u:\b)/ : Token; -/* 63 */ FunctionTerm: /(?-u:\b)function(?-u:\b)/ : Token; -/* 64 */ I32Term: /(?-u:\b)i32(?-u:\b)/ : Token; -/* 65 */ I64Term: /(?-u:\b)i64(?-u:\b)/ : Token; -/* 66 */ IfResetTerm: /(?-u:\b)if_reset(?-u:\b)/ : Token; -/* 67 */ IfTerm: /(?-u:\b)if(?-u:\b)/ : Token; -/* 68 */ ImportTerm: /(?-u:\b)import(?-u:\b)/ : Token; -/* 69 */ IncludeTerm: /(?-u:\b)include(?-u:\b)/ : Token; -/* 70 */ InitialTerm: /(?-u:\b)initial(?-u:\b)/ : Token; -/* 71 */ InoutTerm: /(?-u:\b)inout(?-u:\b)/ : Token; -/* 72 */ InputTerm: /(?-u:\b)input(?-u:\b)/ : Token; -/* 73 */ InsideTerm: /(?-u:\b)inside(?-u:\b)/ : Token; -/* 74 */ InstTerm: /(?-u:\b)inst(?-u:\b)/ : Token; -/* 75 */ InterfaceTerm: /(?-u:\b)interface(?-u:\b)/ : Token; -/* 76 */ InTerm: /(?-u:\b)in(?-u:\b)/ : Token; -/* 77 */ LetTerm: /(?-u:\b)let(?-u:\b)/ : Token; -/* 78 */ LogicTerm: /(?-u:\b)logic(?-u:\b)/ : Token; -/* 79 */ LsbTerm: /(?-u:\b)lsb(?-u:\b)/ : Token; -/* 80 */ ModportTerm: /(?-u:\b)modport(?-u:\b)/ : Token; -/* 81 */ ModuleTerm: /(?-u:\b)module(?-u:\b)/ : Token; -/* 82 */ MsbTerm: /(?-u:\b)msb(?-u:\b)/ : Token; -/* 83 */ OutputTerm: /(?-u:\b)output(?-u:\b)/ : Token; -/* 84 */ OutsideTerm: /(?-u:\b)outside(?-u:\b)/ : Token; -/* 85 */ PackageTerm: /(?-u:\b)package(?-u:\b)/ : Token; -/* 86 */ ParamTerm: /(?-u:\b)param(?-u:\b)/ : Token; -/* 87 */ ProtoTerm: /(?-u:\b)proto(?-u:\b)/ : Token; -/* 88 */ PubTerm: /(?-u:\b)pub(?-u:\b)/ : Token; -/* 89 */ RefTerm: /(?-u:\b)ref(?-u:\b)/ : Token; -/* 90 */ RepeatTerm: /(?-u:\b)repeat(?-u:\b)/ : Token; -/* 91 */ ResetTerm: /(?-u:\b)reset(?-u:\b)/ : Token; -/* 92 */ ResetAsyncHighTerm: /(?-u:\b)reset_async_high(?-u:\b)/ : Token; -/* 93 */ ResetAsyncLowTerm: /(?-u:\b)reset_async_low(?-u:\b)/ : Token; -/* 94 */ ResetSyncHighTerm: /(?-u:\b)reset_sync_high(?-u:\b)/ : Token; -/* 95 */ ResetSyncLowTerm: /(?-u:\b)reset_sync_low(?-u:\b)/ : Token; -/* 96 */ ReturnTerm: /(?-u:\b)return(?-u:\b)/ : Token; -/* 97 */ BreakTerm: /(?-u:\b)break(?-u:\b)/ : Token; -/* 98 */ SignedTerm: /(?-u:\b)signed(?-u:\b)/ : Token; -/* 99 */ StepTerm: /(?-u:\b)step(?-u:\b)/ : Token; -/* 100 */ StringTerm: /(?-u:\b)string(?-u:\b)/ : Token; -/* 101 */ StructTerm: /(?-u:\b)struct(?-u:\b)/ : Token; -/* 102 */ SwitchTerm: /(?-u:\b)switch(?-u:\b)/ : Token; -/* 103 */ TriTerm: /(?-u:\b)tri(?-u:\b)/ : Token; -/* 104 */ TypeTerm: /(?-u:\b)type(?-u:\b)/ : Token; -/* 105 */ U32Term: /(?-u:\b)u32(?-u:\b)/ : Token; -/* 106 */ U64Term: /(?-u:\b)u64(?-u:\b)/ : Token; -/* 107 */ UnionTerm: /(?-u:\b)union(?-u:\b)/ : Token; -/* 108 */ UnsafeTerm: /(?-u:\b)unsafe(?-u:\b)/ : Token; -/* 109 */ VarTerm: /(?-u:\b)var(?-u:\b)/ : Token; +/* 44 */ AlwaysCombTerm: /always_comb/ : Token; +/* 45 */ AlwaysFfTerm: /always_ff/ : Token; +/* 46 */ AssignTerm: /assign/ : Token; +/* 47 */ AsTerm: /as/ : Token; +/* 48 */ BitTerm: /bit/ : Token; +/* 49 */ CaseTerm: /case/ : Token; +/* 50 */ ClockTerm: /clock/ : Token; +/* 51 */ ClockPosedgeTerm: /clock_posedge/ : Token; +/* 52 */ ClockNegedgeTerm: /clock_negedge/ : Token; +/* 53 */ ConstTerm: /const/ : Token; +/* 54 */ DefaultTerm: /default/ : Token; +/* 55 */ ElseTerm: /else/ : Token; +/* 56 */ EmbedTerm: /embed/ : Token; +/* 57 */ EnumTerm: /enum/ : Token; +/* 58 */ ExportTerm: /export/ : Token; +/* 59 */ F32Term: /f32/ : Token; +/* 60 */ F64Term: /f64/ : Token; +/* 61 */ FinalTerm: /final/ : Token; +/* 62 */ ForTerm: /for/ : Token; +/* 63 */ FunctionTerm: /function/ : Token; +/* 64 */ I32Term: /i32/ : Token; +/* 65 */ I64Term: /i64/ : Token; +/* 66 */ IfResetTerm: /if_reset/ : Token; +/* 67 */ IfTerm: /if/ : Token; +/* 68 */ ImportTerm: /import/ : Token; +/* 69 */ IncludeTerm: /include/ : Token; +/* 70 */ InitialTerm: /initial/ : Token; +/* 71 */ InoutTerm: /inout/ : Token; +/* 72 */ InputTerm: /input/ : Token; +/* 73 */ InsideTerm: /inside/ : Token; +/* 74 */ InstTerm: /inst/ : Token; +/* 75 */ InterfaceTerm: /interface/ : Token; +/* 76 */ InTerm: /in/ : Token; +/* 77 */ LetTerm: /let/ : Token; +/* 78 */ LogicTerm: /logic/ : Token; +/* 79 */ LsbTerm: /lsb/ : Token; +/* 80 */ ModportTerm: /modport/ : Token; +/* 81 */ ModuleTerm: /module/ : Token; +/* 82 */ MsbTerm: /msb/ : Token; +/* 83 */ OutputTerm: /output/ : Token; +/* 84 */ OutsideTerm: /outside/ : Token; +/* 85 */ PackageTerm: /package/ : Token; +/* 86 */ ParamTerm: /param/ : Token; +/* 87 */ ProtoTerm: /proto/ : Token; +/* 88 */ PubTerm: /pub/ : Token; +/* 89 */ RefTerm: /ref/ : Token; +/* 90 */ RepeatTerm: /repeat/ : Token; +/* 91 */ ResetTerm: /reset/ : Token; +/* 92 */ ResetAsyncHighTerm: /reset_async_high/ : Token; +/* 93 */ ResetAsyncLowTerm: /reset_async_low/ : Token; +/* 94 */ ResetSyncHighTerm: /reset_sync_high/ : Token; +/* 95 */ ResetSyncLowTerm: /reset_sync_low/ : Token; +/* 96 */ ReturnTerm: /return/ : Token; +/* 97 */ BreakTerm: /break/ : Token; +/* 98 */ SignedTerm: /signed/ : Token; +/* 99 */ StepTerm: /step/ : Token; +/* 100 */ StringTerm: /string/ : Token; +/* 101 */ StructTerm: /struct/ : Token; +/* 102 */ SwitchTerm: /switch/ : Token; +/* 103 */ TriTerm: /tri/ : Token; +/* 104 */ TypeTerm: /type/ : Token; +/* 105 */ U32Term: /u32/ : Token; +/* 106 */ U64Term: /u64/ : Token; +/* 107 */ UnionTerm: /union/ : Token; +/* 108 */ UnsafeTerm: /unsafe/ : Token; +/* 109 */ VarTerm: /var/ : Token; /* 110 */ DollarIdentifierTerm: /\$[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; -/* 111 */ IdentifierTerm: /(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; +/* 111 */ IdentifierTerm: /(r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; /* 112 */ AnyTerm: /[^{}]*/ : Token; /* 113 */ Comments: CommentsOpt /* Option */; /* 114 */ CommentsOpt /* Option::Some */: CommentsTerm; diff --git a/crates/parser/src/generated/veryl_grammar_trait.rs b/crates/parser/src/generated/veryl_grammar_trait.rs index 60c3da08..2dd80a25 100644 --- a/crates/parser/src/generated/veryl_grammar_trait.rs +++ b/crates/parser/src/generated/veryl_grammar_trait.rs @@ -2477,7 +2477,7 @@ pub trait VerylGrammarTrait { /// This method provides skipped language comments. /// If you need comments please provide your own implementation of this method. - fn on_comment_parsed(&mut self, _token: Token<'_>) {} + fn on_comment(&mut self, _token: Token<'_>) {} } // ------------------------------------------------------------------------------------------------- @@ -4853,7 +4853,7 @@ pub struct AllBit { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct AllBitTerm { - pub all_bit_term: crate::veryl_token::Token, /* (?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ] */ + pub all_bit_term: crate::veryl_token::Token, /* ([0-9]+(_[0-9]+)*)?'[01xzXZ] */ } /// @@ -4895,7 +4895,7 @@ pub struct AlwaysCombDeclaration { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct AlwaysCombTerm { - pub always_comb_term: crate::veryl_token::Token, /* (?-u:\b)always_comb(?-u:\b) */ + pub always_comb_term: crate::veryl_token::Token, /* always_comb */ } /// @@ -4992,7 +4992,7 @@ pub struct AlwaysFfReset { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct AlwaysFfTerm { - pub always_ff_term: crate::veryl_token::Token, /* (?-u:\b)always_ff(?-u:\b) */ + pub always_ff_term: crate::veryl_token::Token, /* always_ff */ } /// @@ -5185,7 +5185,7 @@ pub struct As { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct AsTerm { - pub as_term: crate::veryl_token::Token, /* (?-u:\b)as(?-u:\b) */ + pub as_term: crate::veryl_token::Token, /* as */ } /// @@ -5230,7 +5230,7 @@ pub struct AssignDeclaration { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct AssignTerm { - pub assign_term: crate::veryl_token::Token, /* (?-u:\b)assign(?-u:\b) */ + pub assign_term: crate::veryl_token::Token, /* assign */ } /// @@ -5413,7 +5413,7 @@ pub struct BaseLess { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct BaseLessTerm { - pub base_less_term: crate::veryl_token::Token, /* [0-9]+(?:_[0-9]+)* */ + pub base_less_term: crate::veryl_token::Token, /* [0-9]+(_[0-9]+)* */ } /// @@ -5444,7 +5444,7 @@ pub struct Based { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct BasedTerm { - pub based_term: crate::veryl_token::Token, /* (?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)* */ + pub based_term: crate::veryl_token::Token, /* ([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)* */ } /// @@ -5475,7 +5475,7 @@ pub struct Bit { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct BitTerm { - pub bit_term: crate::veryl_token::Token, /* (?-u:\b)bit(?-u:\b) */ + pub bit_term: crate::veryl_token::Token, /* bit */ } /// @@ -5517,7 +5517,7 @@ pub struct BreakStatement { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct BreakTerm { - pub break_term: crate::veryl_token::Token, /* (?-u:\b)break(?-u:\b) */ + pub break_term: crate::veryl_token::Token, /* break */ } /// @@ -5671,7 +5671,7 @@ pub struct CaseStatementList { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct CaseTerm { - pub case_term: crate::veryl_token::Token, /* (?-u:\b)case(?-u:\b) */ + pub case_term: crate::veryl_token::Token, /* case */ } /// @@ -5748,7 +5748,7 @@ pub struct ClockNegedge { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ClockNegedgeTerm { - pub clock_negedge_term: crate::veryl_token::Token, /* (?-u:\b)clock_negedge(?-u:\b) */ + pub clock_negedge_term: crate::veryl_token::Token, /* clock_negedge */ } /// @@ -5779,7 +5779,7 @@ pub struct ClockPosedge { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ClockPosedgeTerm { - pub clock_posedge_term: crate::veryl_token::Token, /* (?-u:\b)clock_posedge(?-u:\b) */ + pub clock_posedge_term: crate::veryl_token::Token, /* clock_posedge */ } /// @@ -5800,7 +5800,7 @@ pub struct ClockPosedgeToken { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ClockTerm { - pub clock_term: crate::veryl_token::Token, /* (?-u:\b)clock(?-u:\b) */ + pub clock_term: crate::veryl_token::Token, /* clock */ } /// @@ -5965,7 +5965,7 @@ pub struct CommentsOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct CommentsTerm { - pub comments_term: crate::veryl_token::Token, /* (?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+ */ + pub comments_term: crate::veryl_token::Token, /* (((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*\/))\s*)+ */ } /// @@ -6066,7 +6066,7 @@ pub enum ConstDeclarationGroup { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ConstTerm { - pub const_term: crate::veryl_token::Token, /* (?-u:\b)const(?-u:\b) */ + pub const_term: crate::veryl_token::Token, /* const */ } /// @@ -6097,7 +6097,7 @@ pub struct Defaul { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct DefaultTerm { - pub default_term: crate::veryl_token::Token, /* (?-u:\b)default(?-u:\b) */ + pub default_term: crate::veryl_token::Token, /* default */ } /// @@ -6324,7 +6324,7 @@ pub struct Else { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ElseTerm { - pub else_term: crate::veryl_token::Token, /* (?-u:\b)else(?-u:\b) */ + pub else_term: crate::veryl_token::Token, /* else */ } /// @@ -6427,7 +6427,7 @@ pub struct EmbedItemList { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct EmbedTerm { - pub embed_term: crate::veryl_token::Token, /* (?-u:\b)embed(?-u:\b) */ + pub embed_term: crate::veryl_token::Token, /* embed */ } /// @@ -6570,7 +6570,7 @@ pub struct EnumListOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct EnumTerm { - pub enum_term: crate::veryl_token::Token, /* (?-u:\b)enum(?-u:\b) */ + pub enum_term: crate::veryl_token::Token, /* enum */ } /// @@ -6632,7 +6632,7 @@ pub struct Exponent { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ExponentTerm { - pub exponent_term: crate::veryl_token::Token, /* [0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)* */ + pub exponent_term: crate::veryl_token::Token, /* [0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)* */ } /// @@ -6698,7 +6698,7 @@ pub struct ExportDeclarationOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ExportTerm { - pub export_term: crate::veryl_token::Token, /* (?-u:\b)export(?-u:\b) */ + pub export_term: crate::veryl_token::Token, /* export */ } /// @@ -7092,7 +7092,7 @@ pub struct F32 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct F32Term { - pub f32_term: crate::veryl_token::Token, /* (?-u:\b)f32(?-u:\b) */ + pub f32_term: crate::veryl_token::Token, /* f32 */ } /// @@ -7123,7 +7123,7 @@ pub struct F64 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct F64Term { - pub f64_term: crate::veryl_token::Token, /* (?-u:\b)f64(?-u:\b) */ + pub f64_term: crate::veryl_token::Token, /* f64 */ } /// @@ -7227,7 +7227,7 @@ pub struct FinalDeclaration { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct FinalTerm { - pub final_term: crate::veryl_token::Token, /* (?-u:\b)final(?-u:\b) */ + pub final_term: crate::veryl_token::Token, /* final */ } /// @@ -7258,7 +7258,7 @@ pub struct FixedPoint { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct FixedPointTerm { - pub fixed_point_term: crate::veryl_token::Token, /* [0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)* */ + pub fixed_point_term: crate::veryl_token::Token, /* [0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)* */ } /// @@ -7333,7 +7333,7 @@ pub struct ForStatementOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ForTerm { - pub for_term: crate::veryl_token::Token, /* (?-u:\b)for(?-u:\b) */ + pub for_term: crate::veryl_token::Token, /* for */ } /// @@ -7432,7 +7432,7 @@ pub struct FunctionDeclarationOpt1 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct FunctionTerm { - pub function_term: crate::veryl_token::Token, /* (?-u:\b)function(?-u:\b) */ + pub function_term: crate::veryl_token::Token, /* function */ } /// @@ -7750,7 +7750,7 @@ pub struct I32 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct I32Term { - pub i32_term: crate::veryl_token::Token, /* (?-u:\b)i32(?-u:\b) */ + pub i32_term: crate::veryl_token::Token, /* i32 */ } /// @@ -7781,7 +7781,7 @@ pub struct I64 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct I64Term { - pub i64_term: crate::veryl_token::Token, /* (?-u:\b)i64(?-u:\b) */ + pub i64_term: crate::veryl_token::Token, /* i64 */ } /// @@ -7855,7 +7855,7 @@ pub enum IdentifierStatementGroup { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct IdentifierTerm { - pub identifier_term: crate::veryl_token::Token, /* (?:r#)?[a-zA-Z_][0-9a-zA-Z_$]* */ + pub identifier_term: crate::veryl_token::Token, /* (r#)?[a-zA-Z_][0-9a-zA-Z_$]* */ } /// @@ -7967,7 +7967,7 @@ pub struct IfResetStatementOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct IfResetTerm { - pub if_reset_term: crate::veryl_token::Token, /* (?-u:\b)if_reset(?-u:\b) */ + pub if_reset_term: crate::veryl_token::Token, /* if_reset */ } /// @@ -8026,7 +8026,7 @@ pub struct IfStatementOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct IfTerm { - pub if_term: crate::veryl_token::Token, /* (?-u:\b)if(?-u:\b) */ + pub if_term: crate::veryl_token::Token, /* if */ } /// @@ -8081,7 +8081,7 @@ pub struct ImportDeclarationOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ImportTerm { - pub import_term: crate::veryl_token::Token, /* (?-u:\b)import(?-u:\b) */ + pub import_term: crate::veryl_token::Token, /* import */ } /// @@ -8112,7 +8112,7 @@ pub struct In { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InTerm { - pub in_term: crate::veryl_token::Token, /* (?-u:\b)in(?-u:\b) */ + pub in_term: crate::veryl_token::Token, /* in */ } /// @@ -8159,7 +8159,7 @@ pub struct IncludeDeclaration { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct IncludeTerm { - pub include_term: crate::veryl_token::Token, /* (?-u:\b)include(?-u:\b) */ + pub include_term: crate::veryl_token::Token, /* include */ } /// @@ -8201,7 +8201,7 @@ pub struct InitialDeclaration { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InitialTerm { - pub initial_term: crate::veryl_token::Token, /* (?-u:\b)initial(?-u:\b) */ + pub initial_term: crate::veryl_token::Token, /* initial */ } /// @@ -8232,7 +8232,7 @@ pub struct Inout { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InoutTerm { - pub inout_term: crate::veryl_token::Token, /* (?-u:\b)inout(?-u:\b) */ + pub inout_term: crate::veryl_token::Token, /* inout */ } /// @@ -8263,7 +8263,7 @@ pub struct Input { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InputTerm { - pub input_term: crate::veryl_token::Token, /* (?-u:\b)input(?-u:\b) */ + pub input_term: crate::veryl_token::Token, /* input */ } /// @@ -8308,7 +8308,7 @@ pub struct InsideExpression { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InsideTerm { - pub inside_term: crate::veryl_token::Token, /* (?-u:\b)inside(?-u:\b) */ + pub inside_term: crate::veryl_token::Token, /* inside */ } /// @@ -8593,7 +8593,7 @@ pub struct InstPortListOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InstTerm { - pub inst_term: crate::veryl_token::Token, /* (?-u:\b)inst(?-u:\b) */ + pub inst_term: crate::veryl_token::Token, /* inst */ } /// @@ -8743,7 +8743,7 @@ pub enum InterfaceItem { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct InterfaceTerm { - pub interface_term: crate::veryl_token::Token, /* (?-u:\b)interface(?-u:\b) */ + pub interface_term: crate::veryl_token::Token, /* interface */ } /// @@ -8952,7 +8952,7 @@ pub struct LetStatementOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct LetTerm { - pub let_term: crate::veryl_token::Token, /* (?-u:\b)let(?-u:\b) */ + pub let_term: crate::veryl_token::Token, /* let */ } /// @@ -8983,7 +8983,7 @@ pub struct Logic { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct LogicTerm { - pub logic_term: crate::veryl_token::Token, /* (?-u:\b)logic(?-u:\b) */ + pub logic_term: crate::veryl_token::Token, /* logic */ } /// @@ -9014,7 +9014,7 @@ pub struct Lsb { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct LsbTerm { - pub lsb_term: crate::veryl_token::Token, /* (?-u:\b)lsb(?-u:\b) */ + pub lsb_term: crate::veryl_token::Token, /* lsb */ } /// @@ -9197,7 +9197,7 @@ pub struct ModportListOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ModportTerm { - pub modport_term: crate::veryl_token::Token, /* (?-u:\b)modport(?-u:\b) */ + pub modport_term: crate::veryl_token::Token, /* modport */ } /// @@ -9359,7 +9359,7 @@ pub struct ModuleItem { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ModuleTerm { - pub module_term: crate::veryl_token::Token, /* (?-u:\b)module(?-u:\b) */ + pub module_term: crate::veryl_token::Token, /* module */ } /// @@ -9390,7 +9390,7 @@ pub struct Msb { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct MsbTerm { - pub msb_term: crate::veryl_token::Token, /* (?-u:\b)msb(?-u:\b) */ + pub msb_term: crate::veryl_token::Token, /* msb */ } /// @@ -9772,7 +9772,7 @@ pub struct Output { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct OutputTerm { - pub output_term: crate::veryl_token::Token, /* (?-u:\b)output(?-u:\b) */ + pub output_term: crate::veryl_token::Token, /* output */ } /// @@ -9817,7 +9817,7 @@ pub struct OutsideExpression { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct OutsideTerm { - pub outside_term: crate::veryl_token::Token, /* (?-u:\b)outside(?-u:\b) */ + pub outside_term: crate::veryl_token::Token, /* outside */ } /// @@ -9951,7 +9951,7 @@ pub enum PackageItem { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct PackageTerm { - pub package_term: crate::veryl_token::Token, /* (?-u:\b)package(?-u:\b) */ + pub package_term: crate::veryl_token::Token, /* package */ } /// @@ -9982,7 +9982,7 @@ pub struct Param { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ParamTerm { - pub param_term: crate::veryl_token::Token, /* (?-u:\b)param(?-u:\b) */ + pub param_term: crate::veryl_token::Token, /* param */ } /// @@ -10286,7 +10286,7 @@ pub struct ProtoModuleDeclarationOpt1 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ProtoTerm { - pub proto_term: crate::veryl_token::Token, /* (?-u:\b)proto(?-u:\b) */ + pub proto_term: crate::veryl_token::Token, /* proto */ } /// @@ -10317,7 +10317,7 @@ pub struct Pub { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct PubTerm { - pub pub_term: crate::veryl_token::Token, /* (?-u:\b)pub(?-u:\b) */ + pub pub_term: crate::veryl_token::Token, /* pub */ } /// @@ -10588,7 +10588,7 @@ pub struct Ref { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct RefTerm { - pub ref_term: crate::veryl_token::Token, /* (?-u:\b)ref(?-u:\b) */ + pub ref_term: crate::veryl_token::Token, /* ref */ } /// @@ -10619,7 +10619,7 @@ pub struct Repeat { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct RepeatTerm { - pub repeat_term: crate::veryl_token::Token, /* (?-u:\b)repeat(?-u:\b) */ + pub repeat_term: crate::veryl_token::Token, /* repeat */ } /// @@ -10660,7 +10660,7 @@ pub struct ResetAsyncHigh { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ResetAsyncHighTerm { - pub reset_async_high_term: crate::veryl_token::Token, /* (?-u:\b)reset_async_high(?-u:\b) */ + pub reset_async_high_term: crate::veryl_token::Token, /* reset_async_high */ } /// @@ -10691,7 +10691,7 @@ pub struct ResetAsyncLow { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ResetAsyncLowTerm { - pub reset_async_low_term: crate::veryl_token::Token, /* (?-u:\b)reset_async_low(?-u:\b) */ + pub reset_async_low_term: crate::veryl_token::Token, /* reset_async_low */ } /// @@ -10722,7 +10722,7 @@ pub struct ResetSyncHigh { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ResetSyncHighTerm { - pub reset_sync_high_term: crate::veryl_token::Token, /* (?-u:\b)reset_sync_high(?-u:\b) */ + pub reset_sync_high_term: crate::veryl_token::Token, /* reset_sync_high */ } /// @@ -10753,7 +10753,7 @@ pub struct ResetSyncLow { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ResetSyncLowTerm { - pub reset_sync_low_term: crate::veryl_token::Token, /* (?-u:\b)reset_sync_low(?-u:\b) */ + pub reset_sync_low_term: crate::veryl_token::Token, /* reset_sync_low */ } /// @@ -10774,7 +10774,7 @@ pub struct ResetSyncLowToken { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ResetTerm { - pub reset_term: crate::veryl_token::Token, /* (?-u:\b)reset(?-u:\b) */ + pub reset_term: crate::veryl_token::Token, /* reset */ } /// @@ -10817,7 +10817,7 @@ pub struct ReturnStatement { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct ReturnTerm { - pub return_term: crate::veryl_token::Token, /* (?-u:\b)return(?-u:\b) */ + pub return_term: crate::veryl_token::Token, /* return */ } /// @@ -11009,7 +11009,7 @@ pub struct Signed { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct SignedTerm { - pub signed_term: crate::veryl_token::Token, /* (?-u:\b)signed(?-u:\b) */ + pub signed_term: crate::veryl_token::Token, /* signed */ } /// @@ -11183,7 +11183,7 @@ pub struct Step { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct StepTerm { - pub step_term: crate::veryl_token::Token, /* (?-u:\b)step(?-u:\b) */ + pub step_term: crate::veryl_token::Token, /* step */ } /// @@ -11224,7 +11224,7 @@ pub struct StringLiteral { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct StringLiteralTerm { - pub string_literal_term: crate::veryl_token::Token, /* \u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022} */ + pub string_literal_term: crate::veryl_token::Token, /* \u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022} */ } /// @@ -11245,7 +11245,7 @@ pub struct StringLiteralToken { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct StringTerm { - pub string_term: crate::veryl_token::Token, /* (?-u:\b)string(?-u:\b) */ + pub string_term: crate::veryl_token::Token, /* string */ } /// @@ -11276,7 +11276,7 @@ pub struct Struct { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct StructTerm { - pub struct_term: crate::veryl_token::Token, /* (?-u:\b)struct(?-u:\b) */ + pub struct_term: crate::veryl_token::Token, /* struct */ } /// @@ -11539,7 +11539,7 @@ pub struct SwitchStatementList { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct SwitchTerm { - pub switch_term: crate::veryl_token::Token, /* (?-u:\b)switch(?-u:\b) */ + pub switch_term: crate::veryl_token::Token, /* switch */ } /// @@ -11570,7 +11570,7 @@ pub struct Tri { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct TriTerm { - pub tri_term: crate::veryl_token::Token, /* (?-u:\b)tri(?-u:\b) */ + pub tri_term: crate::veryl_token::Token, /* tri */ } /// @@ -11638,7 +11638,7 @@ pub enum TypeModifier { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct TypeTerm { - pub type_term: crate::veryl_token::Token, /* (?-u:\b)type(?-u:\b) */ + pub type_term: crate::veryl_token::Token, /* type */ } /// @@ -11669,7 +11669,7 @@ pub struct U32 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct U32Term { - pub u32_term: crate::veryl_token::Token, /* (?-u:\b)u32(?-u:\b) */ + pub u32_term: crate::veryl_token::Token, /* u32 */ } /// @@ -11700,7 +11700,7 @@ pub struct U64 { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct U64Term { - pub u64_term: crate::veryl_token::Token, /* (?-u:\b)u64(?-u:\b) */ + pub u64_term: crate::veryl_token::Token, /* u64 */ } /// @@ -11762,7 +11762,7 @@ pub struct Union { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct UnionTerm { - pub union_term: crate::veryl_token::Token, /* (?-u:\b)union(?-u:\b) */ + pub union_term: crate::veryl_token::Token, /* union */ } /// @@ -11819,7 +11819,7 @@ pub struct UnsafeBlockList { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct UnsafeTerm { - pub unsafe_term: crate::veryl_token::Token, /* (?-u:\b)unsafe(?-u:\b) */ + pub unsafe_term: crate::veryl_token::Token, /* unsafe */ } /// @@ -11885,7 +11885,7 @@ pub struct VarDeclarationOpt { #[derive(Builder, Debug, Clone)] #[builder(crate = "parol_runtime::derive_builder")] pub struct VarTerm { - pub var_term: crate::veryl_token::Token, /* (?-u:\b)var(?-u:\b) */ + pub var_term: crate::veryl_token::Token, /* var */ } /// @@ -12968,7 +12968,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 0: /// - /// `CommentsTerm: "(?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+" : Token;` + /// `CommentsTerm: "(((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*/))\s*)+" : Token;` /// #[parol_runtime::function_name::named] fn comments_term(&mut self, comments_term: &ParseTreeType<'t>) -> Result<()> { @@ -12987,7 +12987,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 1: /// - /// `StringLiteralTerm: "\u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}" : Token;` + /// `StringLiteralTerm: "\u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}" : Token;` /// #[parol_runtime::function_name::named] fn string_literal_term(&mut self, string_literal_term: &ParseTreeType<'t>) -> Result<()> { @@ -13012,7 +13012,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 2: /// - /// `ExponentTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*/ : Token;` + /// `ExponentTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*/ : Token;` /// #[parol_runtime::function_name::named] fn exponent_term(&mut self, exponent_term: &ParseTreeType<'t>) -> Result<()> { @@ -13031,7 +13031,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 3: /// - /// `FixedPointTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*/ : Token;` + /// `FixedPointTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*/ : Token;` /// #[parol_runtime::function_name::named] fn fixed_point_term(&mut self, fixed_point_term: &ParseTreeType<'t>) -> Result<()> { @@ -13051,7 +13051,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 4: /// - /// `BasedTerm: /(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*/ : Token;` + /// `BasedTerm: /([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)*/ : Token;` /// #[parol_runtime::function_name::named] fn based_term(&mut self, based_term: &ParseTreeType<'t>) -> Result<()> { @@ -13070,7 +13070,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 5: /// - /// `AllBitTerm: /(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]/ : Token;` + /// `AllBitTerm: /([0-9]+(_[0-9]+)*)?'[01xzXZ]/ : Token;` /// #[parol_runtime::function_name::named] fn all_bit_term(&mut self, all_bit_term: &ParseTreeType<'t>) -> Result<()> { @@ -13089,7 +13089,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 6: /// - /// `BaseLessTerm: /[0-9]+(?:_[0-9]+)*/ : Token;` + /// `BaseLessTerm: /[0-9]+(_[0-9]+)*/ : Token;` /// #[parol_runtime::function_name::named] fn base_less_term(&mut self, base_less_term: &ParseTreeType<'t>) -> Result<()> { @@ -13270,7 +13270,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 15: /// - /// `Operator07Term: "<=|>=|<:|>:" : Token;` + /// `Operator07Term: "<=|>=|<:|>:" ?! ":" : Token;` /// #[parol_runtime::function_name::named] fn operator07_term(&mut self, operator07_term: &ParseTreeType<'t>) -> Result<()> { @@ -13839,7 +13839,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 44: /// - /// `AlwaysCombTerm: /(?-u:\b)always_comb(?-u:\b)/ : Token;` + /// `AlwaysCombTerm: /always_comb/ : Token;` /// #[parol_runtime::function_name::named] fn always_comb_term(&mut self, always_comb_term: &ParseTreeType<'t>) -> Result<()> { @@ -13859,7 +13859,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 45: /// - /// `AlwaysFfTerm: /(?-u:\b)always_ff(?-u:\b)/ : Token;` + /// `AlwaysFfTerm: /always_ff/ : Token;` /// #[parol_runtime::function_name::named] fn always_ff_term(&mut self, always_ff_term: &ParseTreeType<'t>) -> Result<()> { @@ -13878,7 +13878,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 46: /// - /// `AssignTerm: /(?-u:\b)assign(?-u:\b)/ : Token;` + /// `AssignTerm: /assign/ : Token;` /// #[parol_runtime::function_name::named] fn assign_term(&mut self, assign_term: &ParseTreeType<'t>) -> Result<()> { @@ -13897,7 +13897,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 47: /// - /// `AsTerm: /(?-u:\b)as(?-u:\b)/ : Token;` + /// `AsTerm: /as/ : Token;` /// #[parol_runtime::function_name::named] fn as_term(&mut self, as_term: &ParseTreeType<'t>) -> Result<()> { @@ -13916,7 +13916,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 48: /// - /// `BitTerm: /(?-u:\b)bit(?-u:\b)/ : Token;` + /// `BitTerm: /bit/ : Token;` /// #[parol_runtime::function_name::named] fn bit_term(&mut self, bit_term: &ParseTreeType<'t>) -> Result<()> { @@ -13935,7 +13935,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 49: /// - /// `CaseTerm: /(?-u:\b)case(?-u:\b)/ : Token;` + /// `CaseTerm: /case/ : Token;` /// #[parol_runtime::function_name::named] fn case_term(&mut self, case_term: &ParseTreeType<'t>) -> Result<()> { @@ -13954,7 +13954,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 50: /// - /// `ClockTerm: /(?-u:\b)clock(?-u:\b)/ : Token;` + /// `ClockTerm: /clock/ : Token;` /// #[parol_runtime::function_name::named] fn clock_term(&mut self, clock_term: &ParseTreeType<'t>) -> Result<()> { @@ -13973,7 +13973,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 51: /// - /// `ClockPosedgeTerm: /(?-u:\b)clock_posedge(?-u:\b)/ : Token;` + /// `ClockPosedgeTerm: /clock_posedge/ : Token;` /// #[parol_runtime::function_name::named] fn clock_posedge_term(&mut self, clock_posedge_term: &ParseTreeType<'t>) -> Result<()> { @@ -13993,7 +13993,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 52: /// - /// `ClockNegedgeTerm: /(?-u:\b)clock_negedge(?-u:\b)/ : Token;` + /// `ClockNegedgeTerm: /clock_negedge/ : Token;` /// #[parol_runtime::function_name::named] fn clock_negedge_term(&mut self, clock_negedge_term: &ParseTreeType<'t>) -> Result<()> { @@ -14013,7 +14013,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 53: /// - /// `ConstTerm: /(?-u:\b)const(?-u:\b)/ : Token;` + /// `ConstTerm: /const/ : Token;` /// #[parol_runtime::function_name::named] fn const_term(&mut self, const_term: &ParseTreeType<'t>) -> Result<()> { @@ -14032,7 +14032,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 54: /// - /// `DefaultTerm: /(?-u:\b)default(?-u:\b)/ : Token;` + /// `DefaultTerm: /default/ : Token;` /// #[parol_runtime::function_name::named] fn default_term(&mut self, default_term: &ParseTreeType<'t>) -> Result<()> { @@ -14051,7 +14051,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 55: /// - /// `ElseTerm: /(?-u:\b)else(?-u:\b)/ : Token;` + /// `ElseTerm: /else/ : Token;` /// #[parol_runtime::function_name::named] fn else_term(&mut self, else_term: &ParseTreeType<'t>) -> Result<()> { @@ -14070,7 +14070,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 56: /// - /// `EmbedTerm: /(?-u:\b)embed(?-u:\b)/ : Token;` + /// `EmbedTerm: /embed/ : Token;` /// #[parol_runtime::function_name::named] fn embed_term(&mut self, embed_term: &ParseTreeType<'t>) -> Result<()> { @@ -14089,7 +14089,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 57: /// - /// `EnumTerm: /(?-u:\b)enum(?-u:\b)/ : Token;` + /// `EnumTerm: /enum/ : Token;` /// #[parol_runtime::function_name::named] fn enum_term(&mut self, enum_term: &ParseTreeType<'t>) -> Result<()> { @@ -14108,7 +14108,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 58: /// - /// `ExportTerm: /(?-u:\b)export(?-u:\b)/ : Token;` + /// `ExportTerm: /export/ : Token;` /// #[parol_runtime::function_name::named] fn export_term(&mut self, export_term: &ParseTreeType<'t>) -> Result<()> { @@ -14127,7 +14127,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 59: /// - /// `F32Term: /(?-u:\b)f32(?-u:\b)/ : Token;` + /// `F32Term: /f32/ : Token;` /// #[parol_runtime::function_name::named] fn f32_term(&mut self, f32_term: &ParseTreeType<'t>) -> Result<()> { @@ -14146,7 +14146,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 60: /// - /// `F64Term: /(?-u:\b)f64(?-u:\b)/ : Token;` + /// `F64Term: /f64/ : Token;` /// #[parol_runtime::function_name::named] fn f64_term(&mut self, f64_term: &ParseTreeType<'t>) -> Result<()> { @@ -14165,7 +14165,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 61: /// - /// `FinalTerm: /(?-u:\b)final(?-u:\b)/ : Token;` + /// `FinalTerm: /final/ : Token;` /// #[parol_runtime::function_name::named] fn final_term(&mut self, final_term: &ParseTreeType<'t>) -> Result<()> { @@ -14184,7 +14184,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 62: /// - /// `ForTerm: /(?-u:\b)for(?-u:\b)/ : Token;` + /// `ForTerm: /for/ : Token;` /// #[parol_runtime::function_name::named] fn for_term(&mut self, for_term: &ParseTreeType<'t>) -> Result<()> { @@ -14203,7 +14203,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 63: /// - /// `FunctionTerm: /(?-u:\b)function(?-u:\b)/ : Token;` + /// `FunctionTerm: /function/ : Token;` /// #[parol_runtime::function_name::named] fn function_term(&mut self, function_term: &ParseTreeType<'t>) -> Result<()> { @@ -14222,7 +14222,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 64: /// - /// `I32Term: /(?-u:\b)i32(?-u:\b)/ : Token;` + /// `I32Term: /i32/ : Token;` /// #[parol_runtime::function_name::named] fn i32_term(&mut self, i32_term: &ParseTreeType<'t>) -> Result<()> { @@ -14241,7 +14241,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 65: /// - /// `I64Term: /(?-u:\b)i64(?-u:\b)/ : Token;` + /// `I64Term: /i64/ : Token;` /// #[parol_runtime::function_name::named] fn i64_term(&mut self, i64_term: &ParseTreeType<'t>) -> Result<()> { @@ -14260,7 +14260,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 66: /// - /// `IfResetTerm: /(?-u:\b)if_reset(?-u:\b)/ : Token;` + /// `IfResetTerm: /if_reset/ : Token;` /// #[parol_runtime::function_name::named] fn if_reset_term(&mut self, if_reset_term: &ParseTreeType<'t>) -> Result<()> { @@ -14279,7 +14279,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 67: /// - /// `IfTerm: /(?-u:\b)if(?-u:\b)/ : Token;` + /// `IfTerm: /if/ : Token;` /// #[parol_runtime::function_name::named] fn if_term(&mut self, if_term: &ParseTreeType<'t>) -> Result<()> { @@ -14298,7 +14298,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 68: /// - /// `ImportTerm: /(?-u:\b)import(?-u:\b)/ : Token;` + /// `ImportTerm: /import/ : Token;` /// #[parol_runtime::function_name::named] fn import_term(&mut self, import_term: &ParseTreeType<'t>) -> Result<()> { @@ -14317,7 +14317,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 69: /// - /// `IncludeTerm: /(?-u:\b)include(?-u:\b)/ : Token;` + /// `IncludeTerm: /include/ : Token;` /// #[parol_runtime::function_name::named] fn include_term(&mut self, include_term: &ParseTreeType<'t>) -> Result<()> { @@ -14336,7 +14336,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 70: /// - /// `InitialTerm: /(?-u:\b)initial(?-u:\b)/ : Token;` + /// `InitialTerm: /initial/ : Token;` /// #[parol_runtime::function_name::named] fn initial_term(&mut self, initial_term: &ParseTreeType<'t>) -> Result<()> { @@ -14355,7 +14355,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 71: /// - /// `InoutTerm: /(?-u:\b)inout(?-u:\b)/ : Token;` + /// `InoutTerm: /inout/ : Token;` /// #[parol_runtime::function_name::named] fn inout_term(&mut self, inout_term: &ParseTreeType<'t>) -> Result<()> { @@ -14374,7 +14374,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 72: /// - /// `InputTerm: /(?-u:\b)input(?-u:\b)/ : Token;` + /// `InputTerm: /input/ : Token;` /// #[parol_runtime::function_name::named] fn input_term(&mut self, input_term: &ParseTreeType<'t>) -> Result<()> { @@ -14393,7 +14393,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 73: /// - /// `InsideTerm: /(?-u:\b)inside(?-u:\b)/ : Token;` + /// `InsideTerm: /inside/ : Token;` /// #[parol_runtime::function_name::named] fn inside_term(&mut self, inside_term: &ParseTreeType<'t>) -> Result<()> { @@ -14412,7 +14412,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 74: /// - /// `InstTerm: /(?-u:\b)inst(?-u:\b)/ : Token;` + /// `InstTerm: /inst/ : Token;` /// #[parol_runtime::function_name::named] fn inst_term(&mut self, inst_term: &ParseTreeType<'t>) -> Result<()> { @@ -14431,7 +14431,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 75: /// - /// `InterfaceTerm: /(?-u:\b)interface(?-u:\b)/ : Token;` + /// `InterfaceTerm: /interface/ : Token;` /// #[parol_runtime::function_name::named] fn interface_term(&mut self, interface_term: &ParseTreeType<'t>) -> Result<()> { @@ -14450,7 +14450,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 76: /// - /// `InTerm: /(?-u:\b)in(?-u:\b)/ : Token;` + /// `InTerm: /in/ : Token;` /// #[parol_runtime::function_name::named] fn in_term(&mut self, in_term: &ParseTreeType<'t>) -> Result<()> { @@ -14469,7 +14469,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 77: /// - /// `LetTerm: /(?-u:\b)let(?-u:\b)/ : Token;` + /// `LetTerm: /let/ : Token;` /// #[parol_runtime::function_name::named] fn let_term(&mut self, let_term: &ParseTreeType<'t>) -> Result<()> { @@ -14488,7 +14488,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 78: /// - /// `LogicTerm: /(?-u:\b)logic(?-u:\b)/ : Token;` + /// `LogicTerm: /logic/ : Token;` /// #[parol_runtime::function_name::named] fn logic_term(&mut self, logic_term: &ParseTreeType<'t>) -> Result<()> { @@ -14507,7 +14507,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 79: /// - /// `LsbTerm: /(?-u:\b)lsb(?-u:\b)/ : Token;` + /// `LsbTerm: /lsb/ : Token;` /// #[parol_runtime::function_name::named] fn lsb_term(&mut self, lsb_term: &ParseTreeType<'t>) -> Result<()> { @@ -14526,7 +14526,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 80: /// - /// `ModportTerm: /(?-u:\b)modport(?-u:\b)/ : Token;` + /// `ModportTerm: /modport/ : Token;` /// #[parol_runtime::function_name::named] fn modport_term(&mut self, modport_term: &ParseTreeType<'t>) -> Result<()> { @@ -14545,7 +14545,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 81: /// - /// `ModuleTerm: /(?-u:\b)module(?-u:\b)/ : Token;` + /// `ModuleTerm: /module/ : Token;` /// #[parol_runtime::function_name::named] fn module_term(&mut self, module_term: &ParseTreeType<'t>) -> Result<()> { @@ -14564,7 +14564,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 82: /// - /// `MsbTerm: /(?-u:\b)msb(?-u:\b)/ : Token;` + /// `MsbTerm: /msb/ : Token;` /// #[parol_runtime::function_name::named] fn msb_term(&mut self, msb_term: &ParseTreeType<'t>) -> Result<()> { @@ -14583,7 +14583,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 83: /// - /// `OutputTerm: /(?-u:\b)output(?-u:\b)/ : Token;` + /// `OutputTerm: /output/ : Token;` /// #[parol_runtime::function_name::named] fn output_term(&mut self, output_term: &ParseTreeType<'t>) -> Result<()> { @@ -14602,7 +14602,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 84: /// - /// `OutsideTerm: /(?-u:\b)outside(?-u:\b)/ : Token;` + /// `OutsideTerm: /outside/ : Token;` /// #[parol_runtime::function_name::named] fn outside_term(&mut self, outside_term: &ParseTreeType<'t>) -> Result<()> { @@ -14621,7 +14621,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 85: /// - /// `PackageTerm: /(?-u:\b)package(?-u:\b)/ : Token;` + /// `PackageTerm: /package/ : Token;` /// #[parol_runtime::function_name::named] fn package_term(&mut self, package_term: &ParseTreeType<'t>) -> Result<()> { @@ -14640,7 +14640,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 86: /// - /// `ParamTerm: /(?-u:\b)param(?-u:\b)/ : Token;` + /// `ParamTerm: /param/ : Token;` /// #[parol_runtime::function_name::named] fn param_term(&mut self, param_term: &ParseTreeType<'t>) -> Result<()> { @@ -14659,7 +14659,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 87: /// - /// `ProtoTerm: /(?-u:\b)proto(?-u:\b)/ : Token;` + /// `ProtoTerm: /proto/ : Token;` /// #[parol_runtime::function_name::named] fn proto_term(&mut self, proto_term: &ParseTreeType<'t>) -> Result<()> { @@ -14678,7 +14678,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 88: /// - /// `PubTerm: /(?-u:\b)pub(?-u:\b)/ : Token;` + /// `PubTerm: /pub/ : Token;` /// #[parol_runtime::function_name::named] fn pub_term(&mut self, pub_term: &ParseTreeType<'t>) -> Result<()> { @@ -14697,7 +14697,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 89: /// - /// `RefTerm: /(?-u:\b)ref(?-u:\b)/ : Token;` + /// `RefTerm: /ref/ : Token;` /// #[parol_runtime::function_name::named] fn ref_term(&mut self, ref_term: &ParseTreeType<'t>) -> Result<()> { @@ -14716,7 +14716,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 90: /// - /// `RepeatTerm: /(?-u:\b)repeat(?-u:\b)/ : Token;` + /// `RepeatTerm: /repeat/ : Token;` /// #[parol_runtime::function_name::named] fn repeat_term(&mut self, repeat_term: &ParseTreeType<'t>) -> Result<()> { @@ -14735,7 +14735,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 91: /// - /// `ResetTerm: /(?-u:\b)reset(?-u:\b)/ : Token;` + /// `ResetTerm: /reset/ : Token;` /// #[parol_runtime::function_name::named] fn reset_term(&mut self, reset_term: &ParseTreeType<'t>) -> Result<()> { @@ -14754,7 +14754,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 92: /// - /// `ResetAsyncHighTerm: /(?-u:\b)reset_async_high(?-u:\b)/ : Token;` + /// `ResetAsyncHighTerm: /reset_async_high/ : Token;` /// #[parol_runtime::function_name::named] fn reset_async_high_term(&mut self, reset_async_high_term: &ParseTreeType<'t>) -> Result<()> { @@ -14779,7 +14779,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 93: /// - /// `ResetAsyncLowTerm: /(?-u:\b)reset_async_low(?-u:\b)/ : Token;` + /// `ResetAsyncLowTerm: /reset_async_low/ : Token;` /// #[parol_runtime::function_name::named] fn reset_async_low_term(&mut self, reset_async_low_term: &ParseTreeType<'t>) -> Result<()> { @@ -14804,7 +14804,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 94: /// - /// `ResetSyncHighTerm: /(?-u:\b)reset_sync_high(?-u:\b)/ : Token;` + /// `ResetSyncHighTerm: /reset_sync_high/ : Token;` /// #[parol_runtime::function_name::named] fn reset_sync_high_term(&mut self, reset_sync_high_term: &ParseTreeType<'t>) -> Result<()> { @@ -14829,7 +14829,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 95: /// - /// `ResetSyncLowTerm: /(?-u:\b)reset_sync_low(?-u:\b)/ : Token;` + /// `ResetSyncLowTerm: /reset_sync_low/ : Token;` /// #[parol_runtime::function_name::named] fn reset_sync_low_term(&mut self, reset_sync_low_term: &ParseTreeType<'t>) -> Result<()> { @@ -14854,7 +14854,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 96: /// - /// `ReturnTerm: /(?-u:\b)return(?-u:\b)/ : Token;` + /// `ReturnTerm: /return/ : Token;` /// #[parol_runtime::function_name::named] fn return_term(&mut self, return_term: &ParseTreeType<'t>) -> Result<()> { @@ -14873,7 +14873,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 97: /// - /// `BreakTerm: /(?-u:\b)break(?-u:\b)/ : Token;` + /// `BreakTerm: /break/ : Token;` /// #[parol_runtime::function_name::named] fn break_term(&mut self, break_term: &ParseTreeType<'t>) -> Result<()> { @@ -14892,7 +14892,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 98: /// - /// `SignedTerm: /(?-u:\b)signed(?-u:\b)/ : Token;` + /// `SignedTerm: /signed/ : Token;` /// #[parol_runtime::function_name::named] fn signed_term(&mut self, signed_term: &ParseTreeType<'t>) -> Result<()> { @@ -14911,7 +14911,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 99: /// - /// `StepTerm: /(?-u:\b)step(?-u:\b)/ : Token;` + /// `StepTerm: /step/ : Token;` /// #[parol_runtime::function_name::named] fn step_term(&mut self, step_term: &ParseTreeType<'t>) -> Result<()> { @@ -14930,7 +14930,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 100: /// - /// `StringTerm: /(?-u:\b)string(?-u:\b)/ : Token;` + /// `StringTerm: /string/ : Token;` /// #[parol_runtime::function_name::named] fn string_term(&mut self, string_term: &ParseTreeType<'t>) -> Result<()> { @@ -14949,7 +14949,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 101: /// - /// `StructTerm: /(?-u:\b)struct(?-u:\b)/ : Token;` + /// `StructTerm: /struct/ : Token;` /// #[parol_runtime::function_name::named] fn struct_term(&mut self, struct_term: &ParseTreeType<'t>) -> Result<()> { @@ -14968,7 +14968,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 102: /// - /// `SwitchTerm: /(?-u:\b)switch(?-u:\b)/ : Token;` + /// `SwitchTerm: /switch/ : Token;` /// #[parol_runtime::function_name::named] fn switch_term(&mut self, switch_term: &ParseTreeType<'t>) -> Result<()> { @@ -14987,7 +14987,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 103: /// - /// `TriTerm: /(?-u:\b)tri(?-u:\b)/ : Token;` + /// `TriTerm: /tri/ : Token;` /// #[parol_runtime::function_name::named] fn tri_term(&mut self, tri_term: &ParseTreeType<'t>) -> Result<()> { @@ -15006,7 +15006,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 104: /// - /// `TypeTerm: /(?-u:\b)type(?-u:\b)/ : Token;` + /// `TypeTerm: /type/ : Token;` /// #[parol_runtime::function_name::named] fn type_term(&mut self, type_term: &ParseTreeType<'t>) -> Result<()> { @@ -15025,7 +15025,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 105: /// - /// `U32Term: /(?-u:\b)u32(?-u:\b)/ : Token;` + /// `U32Term: /u32/ : Token;` /// #[parol_runtime::function_name::named] fn u32_term(&mut self, u32_term: &ParseTreeType<'t>) -> Result<()> { @@ -15044,7 +15044,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 106: /// - /// `U64Term: /(?-u:\b)u64(?-u:\b)/ : Token;` + /// `U64Term: /u64/ : Token;` /// #[parol_runtime::function_name::named] fn u64_term(&mut self, u64_term: &ParseTreeType<'t>) -> Result<()> { @@ -15063,7 +15063,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 107: /// - /// `UnionTerm: /(?-u:\b)union(?-u:\b)/ : Token;` + /// `UnionTerm: /union/ : Token;` /// #[parol_runtime::function_name::named] fn union_term(&mut self, union_term: &ParseTreeType<'t>) -> Result<()> { @@ -15082,7 +15082,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 108: /// - /// `UnsafeTerm: /(?-u:\b)unsafe(?-u:\b)/ : Token;` + /// `UnsafeTerm: /unsafe/ : Token;` /// #[parol_runtime::function_name::named] fn unsafe_term(&mut self, unsafe_term: &ParseTreeType<'t>) -> Result<()> { @@ -15101,7 +15101,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 109: /// - /// `VarTerm: /(?-u:\b)var(?-u:\b)/ : Token;` + /// `VarTerm: /var/ : Token;` /// #[parol_runtime::function_name::named] fn var_term(&mut self, var_term: &ParseTreeType<'t>) -> Result<()> { @@ -15145,7 +15145,7 @@ impl<'t, 'u> VerylGrammarAuto<'t, 'u> { /// Semantic action for production 111: /// - /// `IdentifierTerm: /(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token;` + /// `IdentifierTerm: /(r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token;` /// #[parol_runtime::function_name::named] fn identifier_term(&mut self, identifier_term: &ParseTreeType<'t>) -> Result<()> { @@ -36140,7 +36140,7 @@ impl<'t> UserActionsTrait<'t> for VerylGrammarAuto<'t, '_> { } } - fn on_comment_parsed(&mut self, token: Token<'t>) { - self.user_grammar.on_comment_parsed(token) + fn on_comment(&mut self, token: Token<'t>) { + self.user_grammar.on_comment(token) } } diff --git a/crates/parser/src/generated/veryl_parser.rs b/crates/parser/src/generated/veryl_parser.rs index 555bbf96..0ea9b3e7 100644 --- a/crates/parser/src/generated/veryl_parser.rs +++ b/crates/parser/src/generated/veryl_parser.rs @@ -18,127 +18,138 @@ use parol_runtime::lexer::tokenizer::{ ERROR_TOKEN, NEW_LINE_TOKEN, UNMATCHABLE_TOKEN, WHITESPACE_TOKEN, }; -pub const TERMINALS: &[&str; 119] = &[ - /* 0 */ UNMATCHABLE_TOKEN, - /* 1 */ UNMATCHABLE_TOKEN, - /* 2 */ UNMATCHABLE_TOKEN, - /* 3 */ UNMATCHABLE_TOKEN, - /* 4 */ UNMATCHABLE_TOKEN, - /* 5 */ r"(?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+", +pub const TERMINALS: &[(&str, Option<(bool, &str)>); 119] = &[ + /* 0 */ (UNMATCHABLE_TOKEN, None), + /* 1 */ (UNMATCHABLE_TOKEN, None), + /* 2 */ (UNMATCHABLE_TOKEN, None), + /* 3 */ (UNMATCHABLE_TOKEN, None), + /* 4 */ (UNMATCHABLE_TOKEN, None), + /* 5 */ (r"(((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*/))\s*)+", None), /* 6 */ - r"\u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}", - /* 7 */ r"[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*", - /* 8 */ r"[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*", - /* 9 */ r"(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*", - /* 10 */ r"(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]", - /* 11 */ r"[0-9]+(?:_[0-9]+)*", - /* 12 */ r"\-:", - /* 13 */ r"\->", - /* 14 */ r"\+:", - /* 15 */ r"\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|<<<=|>>>=", - /* 16 */ r"\*\*", - /* 17 */ r"/|%", - /* 18 */ r"\+|-", - /* 19 */ r"<<<|>>>|<<|>>", - /* 20 */ r"<=|>=|<:|>:", - /* 21 */ r"===|==\?|!==|!=\?|==|!=", - /* 22 */ r"&&", - /* 23 */ r"\|\|", - /* 24 */ r"&", - /* 25 */ r"\^~|\^|~\^", - /* 26 */ r"\|", - /* 27 */ r"~&|~\||!|~", - /* 28 */ r"`", - /* 29 */ r"::<", - /* 30 */ r"::", - /* 31 */ r":", - /* 32 */ r",", - /* 33 */ r"\.\.=", - /* 34 */ r"\.\.", - /* 35 */ r"\.", - /* 36 */ r"=", - /* 37 */ r"\#", - /* 38 */ r"<", - /* 39 */ r"'\{", - /* 40 */ r"\{", - /* 41 */ r"\[", - /* 42 */ r"\(", - /* 43 */ r">", - /* 44 */ r"\}", - /* 45 */ r"\]", - /* 46 */ r"\)", - /* 47 */ r";", - /* 48 */ r"\*", - /* 49 */ r"(?-u:\b)always_comb(?-u:\b)", - /* 50 */ r"(?-u:\b)always_ff(?-u:\b)", - /* 51 */ r"(?-u:\b)assign(?-u:\b)", - /* 52 */ r"(?-u:\b)as(?-u:\b)", - /* 53 */ r"(?-u:\b)bit(?-u:\b)", - /* 54 */ r"(?-u:\b)case(?-u:\b)", - /* 55 */ r"(?-u:\b)clock(?-u:\b)", - /* 56 */ r"(?-u:\b)clock_posedge(?-u:\b)", - /* 57 */ r"(?-u:\b)clock_negedge(?-u:\b)", - /* 58 */ r"(?-u:\b)const(?-u:\b)", - /* 59 */ r"(?-u:\b)default(?-u:\b)", - /* 60 */ r"(?-u:\b)else(?-u:\b)", - /* 61 */ r"(?-u:\b)embed(?-u:\b)", - /* 62 */ r"(?-u:\b)enum(?-u:\b)", - /* 63 */ r"(?-u:\b)export(?-u:\b)", - /* 64 */ r"(?-u:\b)f32(?-u:\b)", - /* 65 */ r"(?-u:\b)f64(?-u:\b)", - /* 66 */ r"(?-u:\b)final(?-u:\b)", - /* 67 */ r"(?-u:\b)for(?-u:\b)", - /* 68 */ r"(?-u:\b)function(?-u:\b)", - /* 69 */ r"(?-u:\b)i32(?-u:\b)", - /* 70 */ r"(?-u:\b)i64(?-u:\b)", - /* 71 */ r"(?-u:\b)if_reset(?-u:\b)", - /* 72 */ r"(?-u:\b)if(?-u:\b)", - /* 73 */ r"(?-u:\b)import(?-u:\b)", - /* 74 */ r"(?-u:\b)include(?-u:\b)", - /* 75 */ r"(?-u:\b)initial(?-u:\b)", - /* 76 */ r"(?-u:\b)inout(?-u:\b)", - /* 77 */ r"(?-u:\b)input(?-u:\b)", - /* 78 */ r"(?-u:\b)inside(?-u:\b)", - /* 79 */ r"(?-u:\b)inst(?-u:\b)", - /* 80 */ r"(?-u:\b)interface(?-u:\b)", - /* 81 */ r"(?-u:\b)in(?-u:\b)", - /* 82 */ r"(?-u:\b)let(?-u:\b)", - /* 83 */ r"(?-u:\b)logic(?-u:\b)", - /* 84 */ r"(?-u:\b)lsb(?-u:\b)", - /* 85 */ r"(?-u:\b)modport(?-u:\b)", - /* 86 */ r"(?-u:\b)module(?-u:\b)", - /* 87 */ r"(?-u:\b)msb(?-u:\b)", - /* 88 */ r"(?-u:\b)output(?-u:\b)", - /* 89 */ r"(?-u:\b)outside(?-u:\b)", - /* 90 */ r"(?-u:\b)package(?-u:\b)", - /* 91 */ r"(?-u:\b)param(?-u:\b)", - /* 92 */ r"(?-u:\b)proto(?-u:\b)", - /* 93 */ r"(?-u:\b)pub(?-u:\b)", - /* 94 */ r"(?-u:\b)ref(?-u:\b)", - /* 95 */ r"(?-u:\b)repeat(?-u:\b)", - /* 96 */ r"(?-u:\b)reset(?-u:\b)", - /* 97 */ r"(?-u:\b)reset_async_high(?-u:\b)", - /* 98 */ r"(?-u:\b)reset_async_low(?-u:\b)", - /* 99 */ r"(?-u:\b)reset_sync_high(?-u:\b)", - /* 100 */ r"(?-u:\b)reset_sync_low(?-u:\b)", - /* 101 */ r"(?-u:\b)return(?-u:\b)", - /* 102 */ r"(?-u:\b)break(?-u:\b)", - /* 103 */ r"(?-u:\b)signed(?-u:\b)", - /* 104 */ r"(?-u:\b)step(?-u:\b)", - /* 105 */ r"(?-u:\b)string(?-u:\b)", - /* 106 */ r"(?-u:\b)struct(?-u:\b)", - /* 107 */ r"(?-u:\b)switch(?-u:\b)", - /* 108 */ r"(?-u:\b)tri(?-u:\b)", - /* 109 */ r"(?-u:\b)type(?-u:\b)", - /* 110 */ r"(?-u:\b)u32(?-u:\b)", - /* 111 */ r"(?-u:\b)u64(?-u:\b)", - /* 112 */ r"(?-u:\b)union(?-u:\b)", - /* 113 */ r"(?-u:\b)unsafe(?-u:\b)", - /* 114 */ r"(?-u:\b)var(?-u:\b)", - /* 115 */ r"\$[a-zA-Z_][0-9a-zA-Z_$]*", - /* 116 */ r"(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*", - /* 117 */ r"[^{}]*", - /* 118 */ ERROR_TOKEN, + ( + r"\u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}", + None, + ), + /* 7 */ + ( + r"[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*", + None, + ), + /* 8 */ (r"[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*", None), + /* 9 */ + ( + r"([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)*", + None, + ), + /* 10 */ (r"([0-9]+(_[0-9]+)*)?'[01xzXZ]", None), + /* 11 */ (r"[0-9]+(_[0-9]+)*", None), + /* 12 */ (r"\-:", None), + /* 13 */ (r"\->", None), + /* 14 */ (r"\+:", None), + /* 15 */ (r"\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|<<<=|>>>=", None), + /* 16 */ (r"\*\*", None), + /* 17 */ (r"/|%", None), + /* 18 */ (r"\+|-", None), + /* 19 */ (r"<<<|>>>|<<|>>", None), + /* 20 */ (r"<=|>=|<:|>:", Some((false, ":"))), + /* 21 */ (r"===|==\?|!==|!=\?|==|!=", None), + /* 22 */ (r"&&", None), + /* 23 */ (r"\|\|", None), + /* 24 */ (r"&", None), + /* 25 */ (r"\^~|\^|~\^", None), + /* 26 */ (r"\|", None), + /* 27 */ (r"~&|~\||!|~", None), + /* 28 */ (r"`", None), + /* 29 */ (r"::<", None), + /* 30 */ (r"::", None), + /* 31 */ (r":", None), + /* 32 */ (r",", None), + /* 33 */ (r"\.\.=", None), + /* 34 */ (r"\.\.", None), + /* 35 */ (r"\.", None), + /* 36 */ (r"=", None), + /* 37 */ (r"\#", None), + /* 38 */ (r"<", None), + /* 39 */ (r"'\{", None), + /* 40 */ (r"\{", None), + /* 41 */ (r"\[", None), + /* 42 */ (r"\(", None), + /* 43 */ (r">", None), + /* 44 */ (r"\}", None), + /* 45 */ (r"\]", None), + /* 46 */ (r"\)", None), + /* 47 */ (r";", None), + /* 48 */ (r"\*", None), + /* 49 */ (r"always_comb", None), + /* 50 */ (r"always_ff", None), + /* 51 */ (r"assign", None), + /* 52 */ (r"as", None), + /* 53 */ (r"bit", None), + /* 54 */ (r"case", None), + /* 55 */ (r"clock", None), + /* 56 */ (r"clock_posedge", None), + /* 57 */ (r"clock_negedge", None), + /* 58 */ (r"const", None), + /* 59 */ (r"default", None), + /* 60 */ (r"else", None), + /* 61 */ (r"embed", None), + /* 62 */ (r"enum", None), + /* 63 */ (r"export", None), + /* 64 */ (r"f32", None), + /* 65 */ (r"f64", None), + /* 66 */ (r"final", None), + /* 67 */ (r"for", None), + /* 68 */ (r"function", None), + /* 69 */ (r"i32", None), + /* 70 */ (r"i64", None), + /* 71 */ (r"if_reset", None), + /* 72 */ (r"if", None), + /* 73 */ (r"import", None), + /* 74 */ (r"include", None), + /* 75 */ (r"initial", None), + /* 76 */ (r"inout", None), + /* 77 */ (r"input", None), + /* 78 */ (r"inside", None), + /* 79 */ (r"inst", None), + /* 80 */ (r"interface", None), + /* 81 */ (r"in", None), + /* 82 */ (r"let", None), + /* 83 */ (r"logic", None), + /* 84 */ (r"lsb", None), + /* 85 */ (r"modport", None), + /* 86 */ (r"module", None), + /* 87 */ (r"msb", None), + /* 88 */ (r"output", None), + /* 89 */ (r"outside", None), + /* 90 */ (r"package", None), + /* 91 */ (r"param", None), + /* 92 */ (r"proto", None), + /* 93 */ (r"pub", None), + /* 94 */ (r"ref", None), + /* 95 */ (r"repeat", None), + /* 96 */ (r"reset", None), + /* 97 */ (r"reset_async_high", None), + /* 98 */ (r"reset_async_low", None), + /* 99 */ (r"reset_sync_high", None), + /* 100 */ (r"reset_sync_low", None), + /* 101 */ (r"return", None), + /* 102 */ (r"break", None), + /* 103 */ (r"signed", None), + /* 104 */ (r"step", None), + /* 105 */ (r"string", None), + /* 106 */ (r"struct", None), + /* 107 */ (r"switch", None), + /* 108 */ (r"tri", None), + /* 109 */ (r"type", None), + /* 110 */ (r"u32", None), + /* 111 */ (r"u64", None), + /* 112 */ (r"union", None), + /* 113 */ (r"unsafe", None), + /* 114 */ (r"var", None), + /* 115 */ (r"\$[a-zA-Z_][0-9a-zA-Z_$]*", None), + /* 116 */ (r"(r#)?[a-zA-Z_][0-9a-zA-Z_$]*", None), + /* 117 */ (r"[^{}]*", None), + /* 118 */ (ERROR_TOKEN, None), ]; pub const TERMINAL_NAMES: &[&str; 119] = &[ @@ -21112,37 +21123,37 @@ pub const LOOKAHEAD_AUTOMATA: &[LookaheadDFA; 676] = &[ ]; pub const PRODUCTIONS: &[Production; 969] = &[ - // 0 - CommentsTerm: "(?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+"; + // 0 - CommentsTerm: "(((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*/))\s*)+"; Production { lhs: 103, production: &[ParseType::T(5)], }, - // 1 - StringLiteralTerm: "\u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}"; + // 1 - StringLiteralTerm: "\u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}"; Production { lhs: 586, production: &[ParseType::T(6)], }, - // 2 - ExponentTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*/; + // 2 - ExponentTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*/; Production { lhs: 164, production: &[ParseType::T(7)], }, - // 3 - FixedPointTerm: /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*/; + // 3 - FixedPointTerm: /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*/; Production { lhs: 221, production: &[ParseType::T(8)], }, - // 4 - BasedTerm: /(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*/; + // 4 - BasedTerm: /([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)*/; Production { lhs: 56, production: &[ParseType::T(9)], }, - // 5 - AllBitTerm: /(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]/; + // 5 - AllBitTerm: /([0-9]+(_[0-9]+)*)?'[01xzXZ]/; Production { lhs: 1, production: &[ParseType::T(10)], }, - // 6 - BaseLessTerm: /[0-9]+(?:_[0-9]+)*/; + // 6 - BaseLessTerm: /[0-9]+(_[0-9]+)*/; Production { lhs: 53, production: &[ParseType::T(11)], @@ -21332,332 +21343,332 @@ pub const PRODUCTIONS: &[Production; 969] = &[ lhs: 569, production: &[ParseType::T(48)], }, - // 44 - AlwaysCombTerm: /(?-u:\b)always_comb(?-u:\b)/; + // 44 - AlwaysCombTerm: /always_comb/; Production { lhs: 5, production: &[ParseType::T(49)], }, - // 45 - AlwaysFfTerm: /(?-u:\b)always_ff(?-u:\b)/; + // 45 - AlwaysFfTerm: /always_ff/; Production { lhs: 14, production: &[ParseType::T(50)], }, - // 46 - AssignTerm: /(?-u:\b)assign(?-u:\b)/; + // 46 - AssignTerm: /assign/; Production { lhs: 36, production: &[ParseType::T(51)], }, - // 47 - AsTerm: /(?-u:\b)as(?-u:\b)/; + // 47 - AsTerm: /as/; Production { lhs: 32, production: &[ParseType::T(52)], }, - // 48 - BitTerm: /(?-u:\b)bit(?-u:\b)/; + // 48 - BitTerm: /bit/; Production { lhs: 59, production: &[ParseType::T(53)], }, - // 49 - CaseTerm: /(?-u:\b)case(?-u:\b)/; + // 49 - CaseTerm: /case/; Production { lhs: 76, production: &[ParseType::T(54)], }, - // 50 - ClockTerm: /(?-u:\b)clock(?-u:\b)/; + // 50 - ClockTerm: /clock/; Production { lhs: 87, production: &[ParseType::T(55)], }, - // 51 - ClockPosedgeTerm: /(?-u:\b)clock_posedge(?-u:\b)/; + // 51 - ClockPosedgeTerm: /clock_posedge/; Production { lhs: 85, production: &[ParseType::T(56)], }, - // 52 - ClockNegedgeTerm: /(?-u:\b)clock_negedge(?-u:\b)/; + // 52 - ClockNegedgeTerm: /clock_negedge/; Production { lhs: 82, production: &[ParseType::T(57)], }, - // 53 - ConstTerm: /(?-u:\b)const(?-u:\b)/; + // 53 - ConstTerm: /const/; Production { lhs: 112, production: &[ParseType::T(58)], }, - // 54 - DefaultTerm: /(?-u:\b)default(?-u:\b)/; + // 54 - DefaultTerm: /default/; Production { lhs: 115, production: &[ParseType::T(59)], }, - // 55 - ElseTerm: /(?-u:\b)else(?-u:\b)/; + // 55 - ElseTerm: /else/; Production { lhs: 136, production: &[ParseType::T(60)], }, - // 56 - EmbedTerm: /(?-u:\b)embed(?-u:\b)/; + // 56 - EmbedTerm: /embed/; Production { lhs: 145, production: &[ParseType::T(61)], }, - // 57 - EnumTerm: /(?-u:\b)enum(?-u:\b)/; + // 57 - EnumTerm: /enum/; Production { lhs: 158, production: &[ParseType::T(62)], }, - // 58 - ExportTerm: /(?-u:\b)export(?-u:\b)/; + // 58 - ExportTerm: /export/; Production { lhs: 170, production: &[ParseType::T(63)], }, - // 59 - F32Term: /(?-u:\b)f32(?-u:\b)/; + // 59 - F32Term: /f32/; Production { lhs: 206, production: &[ParseType::T(64)], }, - // 60 - F64Term: /(?-u:\b)f64(?-u:\b)/; + // 60 - F64Term: /f64/; Production { lhs: 209, production: &[ParseType::T(65)], }, - // 61 - FinalTerm: /(?-u:\b)final(?-u:\b)/; + // 61 - FinalTerm: /final/; Production { lhs: 218, production: &[ParseType::T(66)], }, - // 62 - ForTerm: /(?-u:\b)for(?-u:\b)/; + // 62 - ForTerm: /for/; Production { lhs: 227, production: &[ParseType::T(67)], }, - // 63 - FunctionTerm: /(?-u:\b)function(?-u:\b)/; + // 63 - FunctionTerm: /function/; Production { lhs: 236, production: &[ParseType::T(68)], }, - // 64 - I32Term: /(?-u:\b)i32(?-u:\b)/; + // 64 - I32Term: /i32/; Production { lhs: 263, production: &[ParseType::T(69)], }, - // 65 - I64Term: /(?-u:\b)i64(?-u:\b)/; + // 65 - I64Term: /i64/; Production { lhs: 266, production: &[ParseType::T(70)], }, - // 66 - IfResetTerm: /(?-u:\b)if_reset(?-u:\b)/; + // 66 - IfResetTerm: /if_reset/; Production { lhs: 282, production: &[ParseType::T(71)], }, - // 67 - IfTerm: /(?-u:\b)if(?-u:\b)/; + // 67 - IfTerm: /if/; Production { lhs: 287, production: &[ParseType::T(72)], }, - // 68 - ImportTerm: /(?-u:\b)import(?-u:\b)/; + // 68 - ImportTerm: /import/; Production { lhs: 292, production: &[ParseType::T(73)], }, - // 69 - IncludeTerm: /(?-u:\b)include(?-u:\b)/; + // 69 - IncludeTerm: /include/; Production { lhs: 299, production: &[ParseType::T(74)], }, - // 70 - InitialTerm: /(?-u:\b)initial(?-u:\b)/; + // 70 - InitialTerm: /initial/; Production { lhs: 303, production: &[ParseType::T(75)], }, - // 71 - InoutTerm: /(?-u:\b)inout(?-u:\b)/; + // 71 - InoutTerm: /inout/; Production { lhs: 306, production: &[ParseType::T(76)], }, - // 72 - InputTerm: /(?-u:\b)input(?-u:\b)/; + // 72 - InputTerm: /input/; Production { lhs: 309, production: &[ParseType::T(77)], }, - // 73 - InsideTerm: /(?-u:\b)inside(?-u:\b)/; + // 73 - InsideTerm: /inside/; Production { lhs: 313, production: &[ParseType::T(78)], }, - // 74 - InstTerm: /(?-u:\b)inst(?-u:\b)/; + // 74 - InstTerm: /inst/; Production { lhs: 339, production: &[ParseType::T(79)], }, - // 75 - InterfaceTerm: /(?-u:\b)interface(?-u:\b)/; + // 75 - InterfaceTerm: /interface/; Production { lhs: 353, production: &[ParseType::T(80)], }, - // 76 - InTerm: /(?-u:\b)in(?-u:\b)/; + // 76 - InTerm: /in/; Production { lhs: 295, production: &[ParseType::T(81)], }, - // 77 - LetTerm: /(?-u:\b)let(?-u:\b)/; + // 77 - LetTerm: /let/; Production { lhs: 372, production: &[ParseType::T(82)], }, - // 78 - LogicTerm: /(?-u:\b)logic(?-u:\b)/; + // 78 - LogicTerm: /logic/; Production { lhs: 375, production: &[ParseType::T(83)], }, - // 79 - LsbTerm: /(?-u:\b)lsb(?-u:\b)/; + // 79 - LsbTerm: /lsb/; Production { lhs: 378, production: &[ParseType::T(84)], }, - // 80 - ModportTerm: /(?-u:\b)modport(?-u:\b)/; + // 80 - ModportTerm: /modport/; Production { lhs: 395, production: &[ParseType::T(85)], }, - // 81 - ModuleTerm: /(?-u:\b)module(?-u:\b)/; + // 81 - ModuleTerm: /module/; Production { lhs: 410, production: &[ParseType::T(86)], }, - // 82 - MsbTerm: /(?-u:\b)msb(?-u:\b)/; + // 82 - MsbTerm: /msb/; Production { lhs: 413, production: &[ParseType::T(87)], }, - // 83 - OutputTerm: /(?-u:\b)output(?-u:\b)/; + // 83 - OutputTerm: /output/; Production { lhs: 450, production: &[ParseType::T(88)], }, - // 84 - OutsideTerm: /(?-u:\b)outside(?-u:\b)/; + // 84 - OutsideTerm: /outside/; Production { lhs: 454, production: &[ParseType::T(89)], }, - // 85 - PackageTerm: /(?-u:\b)package(?-u:\b)/; + // 85 - PackageTerm: /package/; Production { lhs: 466, production: &[ParseType::T(90)], }, - // 86 - ParamTerm: /(?-u:\b)param(?-u:\b)/; + // 86 - ParamTerm: /param/; Production { lhs: 469, production: &[ParseType::T(91)], }, - // 87 - ProtoTerm: /(?-u:\b)proto(?-u:\b)/; + // 87 - ProtoTerm: /proto/; Production { lhs: 497, production: &[ParseType::T(92)], }, - // 88 - PubTerm: /(?-u:\b)pub(?-u:\b)/; + // 88 - PubTerm: /pub/; Production { lhs: 500, production: &[ParseType::T(93)], }, - // 89 - RefTerm: /(?-u:\b)ref(?-u:\b)/; + // 89 - RefTerm: /ref/; Production { lhs: 526, production: &[ParseType::T(94)], }, - // 90 - RepeatTerm: /(?-u:\b)repeat(?-u:\b)/; + // 90 - RepeatTerm: /repeat/; Production { lhs: 529, production: &[ParseType::T(95)], }, - // 91 - ResetTerm: /(?-u:\b)reset(?-u:\b)/; + // 91 - ResetTerm: /reset/; Production { lhs: 544, production: &[ParseType::T(96)], }, - // 92 - ResetAsyncHighTerm: /(?-u:\b)reset_async_high(?-u:\b)/; + // 92 - ResetAsyncHighTerm: /reset_async_high/; Production { lhs: 533, production: &[ParseType::T(97)], }, - // 93 - ResetAsyncLowTerm: /(?-u:\b)reset_async_low(?-u:\b)/; + // 93 - ResetAsyncLowTerm: /reset_async_low/; Production { lhs: 536, production: &[ParseType::T(98)], }, - // 94 - ResetSyncHighTerm: /(?-u:\b)reset_sync_high(?-u:\b)/; + // 94 - ResetSyncHighTerm: /reset_sync_high/; Production { lhs: 539, production: &[ParseType::T(99)], }, - // 95 - ResetSyncLowTerm: /(?-u:\b)reset_sync_low(?-u:\b)/; + // 95 - ResetSyncLowTerm: /reset_sync_low/; Production { lhs: 542, production: &[ParseType::T(100)], }, - // 96 - ReturnTerm: /(?-u:\b)return(?-u:\b)/; + // 96 - ReturnTerm: /return/; Production { lhs: 548, production: &[ParseType::T(101)], }, - // 97 - BreakTerm: /(?-u:\b)break(?-u:\b)/; + // 97 - BreakTerm: /break/; Production { lhs: 63, production: &[ParseType::T(102)], }, - // 98 - SignedTerm: /(?-u:\b)signed(?-u:\b)/; + // 98 - SignedTerm: /signed/; Production { lhs: 566, production: &[ParseType::T(103)], }, - // 99 - StepTerm: /(?-u:\b)step(?-u:\b)/; + // 99 - StepTerm: /step/; Production { lhs: 582, production: &[ParseType::T(104)], }, - // 100 - StringTerm: /(?-u:\b)string(?-u:\b)/; + // 100 - StringTerm: /string/; Production { lhs: 588, production: &[ParseType::T(105)], }, - // 101 - StructTerm: /(?-u:\b)struct(?-u:\b)/; + // 101 - StructTerm: /struct/; Production { lhs: 591, production: &[ParseType::T(106)], }, - // 102 - SwitchTerm: /(?-u:\b)switch(?-u:\b)/; + // 102 - SwitchTerm: /switch/; Production { lhs: 614, production: &[ParseType::T(107)], }, - // 103 - TriTerm: /(?-u:\b)tri(?-u:\b)/; + // 103 - TriTerm: /tri/; Production { lhs: 617, production: &[ParseType::T(108)], }, - // 104 - TypeTerm: /(?-u:\b)type(?-u:\b)/; + // 104 - TypeTerm: /type/; Production { lhs: 623, production: &[ParseType::T(109)], }, - // 105 - U32Term: /(?-u:\b)u32(?-u:\b)/; + // 105 - U32Term: /u32/; Production { lhs: 626, production: &[ParseType::T(110)], }, - // 106 - U64Term: /(?-u:\b)u64(?-u:\b)/; + // 106 - U64Term: /u64/; Production { lhs: 629, production: &[ParseType::T(111)], }, - // 107 - UnionTerm: /(?-u:\b)union(?-u:\b)/; + // 107 - UnionTerm: /union/; Production { lhs: 635, production: &[ParseType::T(112)], }, - // 108 - UnsafeTerm: /(?-u:\b)unsafe(?-u:\b)/; + // 108 - UnsafeTerm: /unsafe/; Production { lhs: 640, production: &[ParseType::T(113)], }, - // 109 - VarTerm: /(?-u:\b)var(?-u:\b)/; + // 109 - VarTerm: /var/; Production { lhs: 646, production: &[ParseType::T(114)], @@ -21667,7 +21678,7 @@ pub const PRODUCTIONS: &[Production; 969] = &[ lhs: 124, production: &[ParseType::T(115)], }, - // 111 - IdentifierTerm: /(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*/; + // 111 - IdentifierTerm: /(r#)?[a-zA-Z_][0-9a-zA-Z_$]*/; Production { lhs: 273, production: &[ParseType::T(116)], @@ -26367,11 +26378,11 @@ static SCANNERS: Lazy> = Lazy::new(|| { ] }); -pub fn parse<'t, T>( - input: &'t str, +pub fn parse( + input: &str, file_name: T, user_actions: &mut VerylGrammar, -) -> Result, ParolError> +) -> Result where T: AsRef, { diff --git a/crates/parser/src/parser_error.rs b/crates/parser/src/parser_error.rs index 75f6a980..d9f3a63f 100644 --- a/crates/parser/src/parser_error.rs +++ b/crates/parser/src/parser_error.rs @@ -445,10 +445,7 @@ struct Location(parol_runtime::Location); impl From for SourceSpan { fn from(location: Location) -> Self { - SourceSpan::new( - (location.0.scanner_switch_pos + location.0.offset - location.0.length as usize).into(), - location.0.length as usize, - ) + SourceSpan::new((location.0.start as usize).into(), location.0.len()) } } diff --git a/crates/parser/src/veryl_token.rs b/crates/parser/src/veryl_token.rs index 65b2395a..9da837c8 100644 --- a/crates/parser/src/veryl_token.rs +++ b/crates/parser/src/veryl_token.rs @@ -104,14 +104,14 @@ impl<'t> TryFrom<&parol_runtime::lexer::Token<'t>> for Token { fn try_from(x: &parol_runtime::lexer::Token<'t>) -> Result { let id = resource_table::new_token_id(); let text = resource_table::insert_str(x.text()); - let pos = x.location.scanner_switch_pos + x.location.offset - x.location.length as usize; + let pos = x.location.start as usize; let source = TokenSource::File(resource_table::insert_path(&x.location.file_name)); Ok(Token { id, text, line: x.location.start_line, column: x.location.start_column, - length: x.location.length, + length: x.location.len() as u32, pos: pos as u32, source, }) diff --git a/crates/parser/veryl.par b/crates/parser/veryl.par index 5e96e37d..89c3e5c6 100644 --- a/crates/parser/veryl.par +++ b/crates/parser/veryl.par @@ -21,13 +21,13 @@ // Longest match should be first -CommentsTerm : "(?:(?:(?://.*(?:\r\n|\r|\n|$))|(?:(?ms)/\u{2a}.*?\u{2a}/))\s*)+" : Token; -StringLiteralTerm : "\u{0022}(?:\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}": Token; -ExponentTerm : /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*[eE][+-]?[0-9]+(?:_[0-9]+)*/ : Token; -FixedPointTerm : /[0-9]+(?:_[0-9]+)*\.[0-9]+(?:_[0-9]+)*/ : Token; -BasedTerm : /(?:[0-9]+(?:_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(?:_[0-9a-fA-FxzXZ]+)*/ : Token; -AllBitTerm : /(?:[0-9]+(?:_[0-9]+)*)?'[01xzXZ]/ : Token; -BaseLessTerm : /[0-9]+(?:_[0-9]+)*/ : Token; +CommentsTerm : "(((//.*(\r\n|\r|\n)?)|(/\*([^*]|\*[^/])*\*/))\s*)+" : Token; +StringLiteralTerm : "\u{0022}(\\[\u{0022}\\/bfnrt]|u[0-9a-fA-F]{4}|[^\u{0022}\\\u0000-\u001F])*\u{0022}" : Token; +ExponentTerm : /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*[eE][+-]?[0-9]+(_[0-9]+)*/ : Token; +FixedPointTerm : /[0-9]+(_[0-9]+)*\.[0-9]+(_[0-9]+)*/ : Token; +BasedTerm : /([0-9]+(_[0-9]+)*)?'s?[bodh][0-9a-fA-FxzXZ]+(_[0-9a-fA-FxzXZ]+)*/ : Token; +AllBitTerm : /([0-9]+(_[0-9]+)*)?'[01xzXZ]/ : Token; +BaseLessTerm : /[0-9]+(_[0-9]+)*/ : Token; MinusColonTerm : '-:' : Token; MinusGTTerm : '->' : Token; PlusColonTerm : '+:' : Token; @@ -36,7 +36,7 @@ Operator11Term : "\*\*" Operator10Term : "/|%" : Token; Operator09Term : "\+|-" : Token; Operator08Term : "<<<|>>>|<<|>>" : Token; -Operator07Term : "<=|>=|<:|>:" : Token; +Operator07Term : "<=|>=|<:|>:" ?! ":" : Token; Operator06Term : "===|==\?|!==|!=\?|==|!=" : Token; Operator02Term : "&&" : Token; Operator01Term : "\|\|" : Token; @@ -65,74 +65,76 @@ RBracketTerm : ']' RParenTerm : ')' : Token; SemicolonTerm : ';' : Token; StarTerm : '*' : Token; -AlwaysCombTerm : /(?-u:\b)always_comb(?-u:\b)/ : Token; -AlwaysFfTerm : /(?-u:\b)always_ff(?-u:\b)/ : Token; -AssignTerm : /(?-u:\b)assign(?-u:\b)/ : Token; -AsTerm : /(?-u:\b)as(?-u:\b)/ : Token; -BitTerm : /(?-u:\b)bit(?-u:\b)/ : Token; -CaseTerm : /(?-u:\b)case(?-u:\b)/ : Token; -ClockTerm : /(?-u:\b)clock(?-u:\b)/ : Token; -ClockPosedgeTerm : /(?-u:\b)clock_posedge(?-u:\b)/ : Token; -ClockNegedgeTerm : /(?-u:\b)clock_negedge(?-u:\b)/ : Token; -ConstTerm : /(?-u:\b)const(?-u:\b)/ : Token; -DefaultTerm : /(?-u:\b)default(?-u:\b)/ : Token; -ElseTerm : /(?-u:\b)else(?-u:\b)/ : Token; -EmbedTerm : /(?-u:\b)embed(?-u:\b)/ : Token; -EnumTerm : /(?-u:\b)enum(?-u:\b)/ : Token; -ExportTerm : /(?-u:\b)export(?-u:\b)/ : Token; -F32Term : /(?-u:\b)f32(?-u:\b)/ : Token; -F64Term : /(?-u:\b)f64(?-u:\b)/ : Token; -FinalTerm : /(?-u:\b)final(?-u:\b)/ : Token; -ForTerm : /(?-u:\b)for(?-u:\b)/ : Token; -FunctionTerm : /(?-u:\b)function(?-u:\b)/ : Token; -I32Term : /(?-u:\b)i32(?-u:\b)/ : Token; -I64Term : /(?-u:\b)i64(?-u:\b)/ : Token; -IfResetTerm : /(?-u:\b)if_reset(?-u:\b)/ : Token; -IfTerm : /(?-u:\b)if(?-u:\b)/ : Token; -ImportTerm : /(?-u:\b)import(?-u:\b)/ : Token; -IncludeTerm : /(?-u:\b)include(?-u:\b)/ : Token; -InitialTerm : /(?-u:\b)initial(?-u:\b)/ : Token; -InoutTerm : /(?-u:\b)inout(?-u:\b)/ : Token; -InputTerm : /(?-u:\b)input(?-u:\b)/ : Token; -InsideTerm : /(?-u:\b)inside(?-u:\b)/ : Token; -InstTerm : /(?-u:\b)inst(?-u:\b)/ : Token; -InterfaceTerm : /(?-u:\b)interface(?-u:\b)/ : Token; -InTerm : /(?-u:\b)in(?-u:\b)/ : Token; -LetTerm : /(?-u:\b)let(?-u:\b)/ : Token; -LogicTerm : /(?-u:\b)logic(?-u:\b)/ : Token; -LsbTerm : /(?-u:\b)lsb(?-u:\b)/ : Token; -ModportTerm : /(?-u:\b)modport(?-u:\b)/ : Token; -ModuleTerm : /(?-u:\b)module(?-u:\b)/ : Token; -MsbTerm : /(?-u:\b)msb(?-u:\b)/ : Token; -OutputTerm : /(?-u:\b)output(?-u:\b)/ : Token; -OutsideTerm : /(?-u:\b)outside(?-u:\b)/ : Token; -PackageTerm : /(?-u:\b)package(?-u:\b)/ : Token; -ParamTerm : /(?-u:\b)param(?-u:\b)/ : Token; -ProtoTerm : /(?-u:\b)proto(?-u:\b)/ : Token; -PubTerm : /(?-u:\b)pub(?-u:\b)/ : Token; -RefTerm : /(?-u:\b)ref(?-u:\b)/ : Token; -RepeatTerm : /(?-u:\b)repeat(?-u:\b)/ : Token; -ResetTerm : /(?-u:\b)reset(?-u:\b)/ : Token; -ResetAsyncHighTerm : /(?-u:\b)reset_async_high(?-u:\b)/ : Token; -ResetAsyncLowTerm : /(?-u:\b)reset_async_low(?-u:\b)/ : Token; -ResetSyncHighTerm : /(?-u:\b)reset_sync_high(?-u:\b)/ : Token; -ResetSyncLowTerm : /(?-u:\b)reset_sync_low(?-u:\b)/ : Token; -ReturnTerm : /(?-u:\b)return(?-u:\b)/ : Token; -BreakTerm : /(?-u:\b)break(?-u:\b)/ : Token; -SignedTerm : /(?-u:\b)signed(?-u:\b)/ : Token; -StepTerm : /(?-u:\b)step(?-u:\b)/ : Token; -StringTerm : /(?-u:\b)string(?-u:\b)/ : Token; -StructTerm : /(?-u:\b)struct(?-u:\b)/ : Token; -SwitchTerm : /(?-u:\b)switch(?-u:\b)/ : Token; -TriTerm : /(?-u:\b)tri(?-u:\b)/ : Token; -TypeTerm : /(?-u:\b)type(?-u:\b)/ : Token; -U32Term : /(?-u:\b)u32(?-u:\b)/ : Token; -U64Term : /(?-u:\b)u64(?-u:\b)/ : Token; -UnionTerm : /(?-u:\b)union(?-u:\b)/ : Token; -UnsafeTerm : /(?-u:\b)unsafe(?-u:\b)/ : Token; -VarTerm : /(?-u:\b)var(?-u:\b)/ : Token; +// -- keyword begin -- +AlwaysCombTerm : /always_comb/ : Token; +AlwaysFfTerm : /always_ff/ : Token; +AssignTerm : /assign/ : Token; +AsTerm : /as/ : Token; +BitTerm : /bit/ : Token; +CaseTerm : /case/ : Token; +ClockTerm : /clock/ : Token; +ClockPosedgeTerm : /clock_posedge/ : Token; +ClockNegedgeTerm : /clock_negedge/ : Token; +ConstTerm : /const/ : Token; +DefaultTerm : /default/ : Token; +ElseTerm : /else/ : Token; +EmbedTerm : /embed/ : Token; +EnumTerm : /enum/ : Token; +ExportTerm : /export/ : Token; +F32Term : /f32/ : Token; +F64Term : /f64/ : Token; +FinalTerm : /final/ : Token; +ForTerm : /for/ : Token; +FunctionTerm : /function/ : Token; +I32Term : /i32/ : Token; +I64Term : /i64/ : Token; +IfResetTerm : /if_reset/ : Token; +IfTerm : /if/ : Token; +ImportTerm : /import/ : Token; +IncludeTerm : /include/ : Token; +InitialTerm : /initial/ : Token; +InoutTerm : /inout/ : Token; +InputTerm : /input/ : Token; +InsideTerm : /inside/ : Token; +InstTerm : /inst/ : Token; +InterfaceTerm : /interface/ : Token; +InTerm : /in/ : Token; +LetTerm : /let/ : Token; +LogicTerm : /logic/ : Token; +LsbTerm : /lsb/ : Token; +ModportTerm : /modport/ : Token; +ModuleTerm : /module/ : Token; +MsbTerm : /msb/ : Token; +OutputTerm : /output/ : Token; +OutsideTerm : /outside/ : Token; +PackageTerm : /package/ : Token; +ParamTerm : /param/ : Token; +ProtoTerm : /proto/ : Token; +PubTerm : /pub/ : Token; +RefTerm : /ref/ : Token; +RepeatTerm : /repeat/ : Token; +ResetTerm : /reset/ : Token; +ResetAsyncHighTerm : /reset_async_high/ : Token; +ResetAsyncLowTerm : /reset_async_low/ : Token; +ResetSyncHighTerm : /reset_sync_high/ : Token; +ResetSyncLowTerm : /reset_sync_low/ : Token; +ReturnTerm : /return/ : Token; +BreakTerm : /break/ : Token; +SignedTerm : /signed/ : Token; +StepTerm : /step/ : Token; +StringTerm : /string/ : Token; +StructTerm : /struct/ : Token; +SwitchTerm : /switch/ : Token; +TriTerm : /tri/ : Token; +TypeTerm : /type/ : Token; +U32Term : /u32/ : Token; +U64Term : /u64/ : Token; +UnionTerm : /union/ : Token; +UnsafeTerm : /unsafe/ : Token; +VarTerm : /var/ : Token; +// -- keyword end -- DollarIdentifierTerm : /\$[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; -IdentifierTerm : /(?:r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; +IdentifierTerm : /(r#)?[a-zA-Z_][0-9a-zA-Z_$]*/ : Token; AnyTerm : < Embed>/[^{}]*/ : Token; // ----------------------------------------------------------------------------