Skip to content

Handle general expression statements - #425

Open
danielgaskins wants to merge 1 commit into
qBraid:mainfrom
danielgaskins:fix/expression-statement-validation
Open

Handle general expression statements#425
danielgaskins wants to merge 1 commit into
qBraid:mainfrom
danielgaskins:fix/expression-statement-validation

Conversation

@danielgaskins

Copy link
Copy Markdown

Summary

  • evaluate and discard standalone expressions instead of assuming every expression statement is a function call
  • preserve operations produced by subroutine and extern calls
  • apply the same behavior inside OpenPulse calibration blocks while retaining specialized handling for pulse functions
  • validate unknown gate names before their operands so the error identifies the gate

Testing

  • pytest -q tests
  • pytest -q --cov=pyqasm --cov-report=term tests
  • isort --check-only src tests bin examples
  • black --check --target-version py310 src tests bin examples
  • pylint src tests bin examples
  • mypy src examples
  • qbraid admin headers src tests bin examples --skip=src/pyqasm/_version.py --type=apache
  • sphinx-build -W -b html docs /tmp/pyqasm-388-docs

Closes #388

Signed-off-by: Daniel Gaskins <danielgaskins99@gmail.com>
@argus-eye

argus-eye Bot commented Sep 10, 2026

Copy link
Copy Markdown

Argus review

Auto-review is off for this repo. Tick the box below to run a review on this PR.

  • Trigger Argus review

Estimated cost

  • Files changed: 5
  • Diff lines (±): 200
  • Historical avg: ~317.3k tokens · ~$0.95 · across last 12 review(s)

Tip: you can also comment @argus-eye review at any time.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1ce86e7d-0e11-4973-b1cb-47a150c80ef1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey there! It looks like the changelog might need an update.

Please take a moment to edit the CHANGELOG.md with:

  • A brief, one-to-two sentence summary of your changes.
  • A link back to this PR for reference.
  • (Optional) A small working example if you've added new features.

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.

Bare expression statements crash with AttributeError instead of raising ValidationError

1 participant