Skip to content

[CQT-435] Comments are included in libQASM AST - #323

Open
elenbaasc wants to merge 6 commits into
developfrom
CQT-435-Comments-are-included-in-libQASM-AST
Open

elenbaasc wants to merge 6 commits into
developfrom
CQT-435-Comments-are-included-in-libQASM-AST

Conversation

@elenbaasc

Copy link
Copy Markdown
Contributor

Comments are now kept in the syntactic and semantic ASTs.

  • Lexer: // and /* */ comments are no longer discarded. They go to ANTLR's hidden channel, so the parser and the language are unaffected.
  • Syntactic AST: a new Comment statement holds the comment text and its source location. Comments are inserted among the other statements in source order.
  • Semantic AST: a new Comment statement holds the text plus start_line, start_column, end_line and end_column. Lines and columns start at 1, and end_column is one past the last character.
  • Added tests for single/multi-line comments.
  • New entry under to the Changelog.

@elenbaasc elenbaasc changed the title [CQT-435] Comments are included in libQASM AST DRAFT: [CQT-435] Comments are included in libQASM AST Oct 26, 2026
@elenbaasc elenbaasc changed the title DRAFT: [CQT-435] Comments are included in libQASM AST [CQT-435] Comments are included in libQASM AST Oct 26, 2026
@elenbaasc elenbaasc self-assigned this Oct 28, 2026

This branch has not been deployed

No deployments
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.

1 participant