diff --git a/CHANGELOG.md b/CHANGELOG.md index 06fdf77..9f7f892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.9.0...Unreleased) - ReleaseDate +* [Fixed] begin_keywords "1364-2001-noconfig" failure [#28](https://github.com/dalance/sv-parser/issues/28) * [Changed] update nom to 6.0.0 ## [v0.9.0](https://github.com/dalance/sv-parser/compare/v0.8.3...v0.9.0) - 2020-11-11 diff --git a/sv-parser-parser/src/general/compiler_directives.rs b/sv-parser-parser/src/general/compiler_directives.rs index eaf4770..2eea5f6 100644 --- a/sv-parser-parser/src/general/compiler_directives.rs +++ b/sv-parser-parser/src/general/compiler_directives.rs @@ -849,14 +849,14 @@ pub(crate) fn version_specifier(s: Span) -> IResult { begin_keywords("1364-2005"); x }), - map(keyword("1364-2001"), |x| { - begin_keywords("1364-2001"); - x - }), map(keyword("1364-2001-noconfig"), |x| { begin_keywords("1364-2001-noconfig"); x }), + map(keyword("1364-2001"), |x| { + begin_keywords("1364-2001"); + x + }), map(keyword("1364-1995"), |x| { begin_keywords("1364-1995"); x diff --git a/sv-parser-parser/src/tests.rs b/sv-parser-parser/src/tests.rs index 4e5e00c..002d942 100644 --- a/sv-parser-parser/src/tests.rs +++ b/sv-parser-parser/src/tests.rs @@ -428,6 +428,15 @@ mod unit { r##"module a; always begin a = b.c'(0); end endmodule"##, Ok((_, _)) ); + test!( + source_text, + r##"`begin_keywords "1364-2001-noconfig" // use IEEE Std 1364-2001 Verilog keywords + module m2; + reg [63:0] logic; // OK: "logic" is not a keyword in 1364-2001 + endmodule + `end_keywords"##, + Ok((_, _)) + ); } }