Skip to content

Conversation

@lola831
Copy link
Collaborator

@lola831 lola831 commented Dec 15, 2025

Description

This PR fixes the parser issue where valid expressions like x in [0] or complex behavior conditions were incorrectly matched by invalid_scenic_instance_creation, causing Scenic to raise a “Perhaps you forgot new?” error at the wrong line. The problem was that operator-like specifiers (in, at, offset by, offset along) were treated the same as normal Scenic instance specifiers. I split these into two groups and restricted the “forgot new” rule to non-operator specifiers only. This resolves both #345 and #356: valid expressions are no longer misinterpreted, and incorrect instance specifiers are now reported at the correct location.

Issue Link

# 345
# 356

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Additional Notes

@lola831 lola831 requested a review from dfremont December 15, 2025 19:50
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.88%. Comparing base (f0e3e60) to head (91a38fb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #426      +/-   ##
==========================================
- Coverage   89.93%   89.88%   -0.06%     
==========================================
  Files          54       54              
  Lines       13567    13560       -7     
==========================================
- Hits        12202    12188      -14     
- Misses       1365     1372       +7     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@dfremont dfremont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, thanks Lola!

@dfremont dfremont merged commit e24aa16 into BerkeleyLearnVerify:main Dec 16, 2025
31 checks passed
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 this pull request may close these issues.

Syntax error wrongly attributed to valid in syntax Syntax parser working incorrectly in some cases

2 participants