Skip to content

add missing syntax tests#1834

Merged
OmarTawfik merged 1 commit into
mainfrom
OmarTawfik/add-missing-syntax-tests
Jun 9, 2026
Merged

add missing syntax tests#1834
OmarTawfik merged 1 commit into
mainfrom
OmarTawfik/add-missing-syntax-tests

Conversation

@OmarTawfik

Copy link
Copy Markdown
Contributor

Add missing syntax tests for a few solc syntax errors that are already covered by our LALRPOP grammar, so we don't need a specific diagnostic for it:

  • ParserError 9182:
    • var at contract-member position
  • ParserError 6933:
    • unchecked primary expressions in for-loop initializer and iterator slots
    • missing primary expressions in storage layout specifiers
  • ParserError 2314:
    • file-level constant with a visibility modifier
    • user-defined value type with a missing identifier
    • error definition with a parameter data location
    • empty inline-assembly flag list
    • user-defined operator with a missing function name

Add missing syntax tests for a bunch of solc syntax errors that are already covered by our LALRPOP grammar, so we don't need a specific diagnostic for it:

- ParserError 9182:
  - `var` at contract-member position
- ParserError 6933:
  - unchecked primary expressions in for-loop initializer and iterator slots
  - missing primary expressions in storage layout specifiers
- ParserError 2314:
  - file-level constant with a visibility modifier
  - user-defined value type with a missing identifier
  - error definition with a parameter data location
  - empty inline-assembly flag list
  -  user-defined operator with a missing function name
@changeset-bot

changeset-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 75f7293

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

BranchOmarTawfik/add-missing-syntax-tests
Testbedci

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

🚨 3 Alerts

🐰 View full continuous benchmarking report in Bencher

@OmarTawfik OmarTawfik marked this pull request as ready for review June 9, 2026 01:56
@OmarTawfik OmarTawfik requested review from a team as code owners June 9, 2026 01:56
@OmarTawfik OmarTawfik enabled auto-merge June 9, 2026 01:56

@teofr teofr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! Just one question

use super::*;

#[test]
fn empty_flags() -> Result<()> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if these tests should live in the diagnostics directory, since:

  • The only part we care about is the error (the cst itself has no value)
  • That way we can compare with solc

@OmarTawfik OmarTawfik added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 8c446bf Jun 9, 2026
17 checks passed
@OmarTawfik OmarTawfik deleted the OmarTawfik/add-missing-syntax-tests branch June 9, 2026 09:19
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.

2 participants