-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax errors due to streaming with
operator
#693
Labels
style-linter
Verilog style-linter issues
Comments
b/181792412 |
Context: this is LRM 11.4.14 |
Also caught by sv-tests |
More context: this was indeed thought of but not added initially due to parser generation conflicts. |
nikhiljha
pushed a commit
to nikhiljha/verible
that referenced
this issue
Sep 27, 2022
switches to fortls from fortran-language-server
jbylicki
pushed a commit
to antmicro/verible
that referenced
this issue
Jun 28, 2023
The stream expression has an expression followed by an optional 'with' '[' array_range_expression ']' (LRM 11.4.14) There are a few other cases where an expression can be trailed with 'with', with_constraint_block: there we expect an identifier list in parenthesis after 'with' similar with array methods with predicate with '(' ...) Since the parser with one look-ahead can't see beyond the 'with', it runs into a shift/reduce conflict as it does not know if '(' or '[' is to follow. Disambiguate that in the lexer by creating a separate token TK_with__followed_by_bracket which is a TK_with, where the lexer already looked ahead and knows that it will be followed by '['. After seeing the '[', everything but the "with" is put back into the stream to be processed separately. Changed lexer and parser as well as associated unit tests including formatter. Fixing chipsalliance#693 Signed-off-by: Henner Zeller <hzeller@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The SV linter is throwing unexpected errors on the
with
construct used in streaming operations, even though this construct is part of the LRM.Example error message:
../src/lowrisc_dv_mem_bkdr_if_0/sram_scrambler_pkg.sv:58:28: syntax error, rejected "with" (https://github.com/google/verible).
Example test case:
The text was updated successfully, but these errors were encountered: