Skip to content

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

Merged
elenbaasc merged 6 commits into
developfrom
CQT-435-Comments-are-included-in-libQASM-AST
Nov 2, 2026
Merged

elenbaasc merged 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

@davidbakker123 davidbakker123 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.

I don't see any obvious problems, although I'm no expert on the AST/ Antler stuff.

@elenbaasc
elenbaasc merged commit bab2cb7 into develop Nov 2, 2026
45 checks passed
@elenbaasc
elenbaasc deleted the CQT-435-Comments-are-included-in-libQASM-AST branch November 2, 2026 14:17
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