Fix begin_keywords "1364-2001-noconfig" #28

This commit is contained in:
dalance 2020-12-21 19:44:05 +09:00
parent 483cd7a20e
commit a60246e8b7
3 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -849,14 +849,14 @@ pub(crate) fn version_specifier(s: Span) -> IResult<Span, VersionSpecifier> {
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

View File

@ -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((_, _))
);
}
}