-
Notifications
You must be signed in to change notification settings - Fork 137
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
Slang incorrectly claims that a parameter is recursively defined #972
Comments
For the sake of completeness, I edited the original issue to include the expected output when the bug is not triggered, which I forgot to include earlier. |
This is essentially an API bug; the API should not allow you to access the parameter list before the instance body has been elaborated, but currently it does. If you do something like call .members() prior to accessing the parameters things will work correctly. I'll add an accessor that enforces this. |
I am confused.
The truth is, I couldn't find any document/tutorial that explains how to use slang as a parser. I could only rely on the In sv-lang.com, you have several sections: I'm left with so many questions:
|
Yeah, it's on my list to write some higher level documentation for the AST constructs. The key points to get you going:
|
I just independently confirmed this. For the sake of the test, I added an additional silent
Apparently, as you wrote, it does more work as it gets the diagnostics messages. |
Fixed in b9d5423 |
Describe the bug
In some places when calling the AST to get a parameter value, it triggers an erroneous error message.
To Reproduce
Run the following with:
slang-hier test.v
Which produces:
Then run again with:
slang-hier --params test.v
Which produces:
Notice that the error appears only when 2 parameters are both defined in a macro and one depends on the other.
All other test cases, where only one is defined in the macro, do not trigger this.
The error is triggered by the following lines in
slang-hier.v
on lines 93-94:The
assign
is in the test because this was an effort to get a minimum sized example to another bug where a parameter on the same code was incorrectly inferred as 0, but instead it triggered this bug I already ran into earlier but didn't have a clue as how to recreate.The text was updated successfully, but these errors were encountered: