Skip to content
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

Include expression text in "&requires failed" message #1343

Closed
awelzel opened this issue Jan 9, 2023 · 0 comments · Fixed by #1458
Closed

Include expression text in "&requires failed" message #1343

awelzel opened this issue Jan 9, 2023 · 0 comments · Fixed by #1458
Assignees

Comments

@awelzel
Copy link
Contributor

awelzel commented Jan 9, 2023

While writing up zeek/spicy-plugin#160.

Nice-to-have: In the &requires violation messages, having the textual version of the expression may provide more information without resorting to opening the involved spicy analyzer (which may not be at hand depending on where one looks at those messages).

So &requires failed might be nicer as &requires=(self.length >= 9) failed.

violation, Analyzer::ANALYZER_SPICY_MINI, C21rnr2KzAmlQ38u52, &requires failed (/home/awelzel/corelight-oss/projects/spicy-mini/analyzer/mini.spicy:4:24)
@bbannier bbannier transferred this issue from zeek/spicy-plugin Jan 9, 2023
@bbannier bbannier self-assigned this Jun 12, 2023
bbannier added a commit that referenced this issue Jun 12, 2023
With this patch we now include the `&requires` condition in the failure
message in case the condition is not met. We render the literal
expression as HILTI and not Spicy code for now which could; this can
lead to the failure message looking different from the actual code the
parser developer has written (e.g., for `$$` we emit the desugared
`__dd`).

Closes #1343.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants