From 8110fcd572cb3952f0b53fefb1afce31176762ed Mon Sep 17 00:00:00 2001 From: dalance Date: Mon, 2 Dec 2019 11:48:44 +0900 Subject: [PATCH] Fix constant_bit_select --- CHANGELOG.md | 1 + sv-parser-parser/src/expressions/primaries.rs | 2 +- sv-parser-parser/src/tests.rs | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55488c7..e8491d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.4.5...Unreleased) - ReleaseDate +* [Fix] constant_bit_select * [Fix] wrong linebreak at define macro usage ## [v0.4.5](https://github.com/dalance/sv-parser/compare/v0.4.4...v0.4.5) - 2019-11-28 diff --git a/sv-parser-parser/src/expressions/primaries.rs b/sv-parser-parser/src/expressions/primaries.rs index abd40ac..a307d28 100644 --- a/sv-parser-parser/src/expressions/primaries.rs +++ b/sv-parser-parser/src/expressions/primaries.rs @@ -20,7 +20,7 @@ pub(crate) fn constant_primary(s: Span) -> IResult { }), constant_primary_mintypmax_expression, map( - terminated(constant_function_call, peek(not(one_of("[")))), + terminated(constant_function_call, peek(not(one_of("[.")))), |x| ConstantPrimary::ConstantFunctionCall(Box::new(x)), ), constant_primary_ps_parameter, diff --git a/sv-parser-parser/src/tests.rs b/sv-parser-parser/src/tests.rs index 3ea4f83..71ec1d8 100644 --- a/sv-parser-parser/src/tests.rs +++ b/sv-parser-parser/src/tests.rs @@ -393,6 +393,11 @@ mod unit { r##"module a; b #( .a(a+1)) a (); endmodule"##, Ok((_, _)) ); + test!( + source_text, + r##"module A; always begin a[ a_a[i] ].b <= c; end endmodule"##, + Ok((_, _)) + ); } } @@ -15853,7 +15858,7 @@ mod spec { fn debug() { test!( source_text, - r##"module a; b #( .a(a+1)) a (); endmodule"##, + r##"module A; always begin a[ a_a[i] ].b <= c; end endmodule"##, Ok((_, _)) ); nom_tracable::cumulative_histogram();