Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement Parser #2149

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft

Reimplement Parser #2149

wants to merge 58 commits into from

Conversation

idavis
Copy link
Collaborator

@idavis idavis commented Feb 4, 2025

Lexing

  • Basic raw tokens
  • Basic cooked tokens
  • Cook pragma and annotation

Parsing

Lowering

Compiling

  • Statements -
    • alias
    • array concatenation
    • assignment
    • barrier
    • box
      • pragma impls
    • break
    • cal
    • calibration grammar
    • classical decls
      • Bit, int, float, angle, bool, duration, stretch
      • uint 63 bitness with 64 bigint. Separate ops for uint?
      • creg
      • qreg
      • Arrays
      • Measurement result
    • def
    • end
    • expression statement
    • extern
    • for loops
    • gate call
    • gphase
    • if statement
    • IO decls
    • measure arrow
    • old style decl
    • quantum decl
    • reset
    • return
    • switch statements
    • while loops
    • gate def
      • simulatable
        out of scope:
    • delay
    • barrier?

@idavis idavis requested a review from orpuente-MS February 4, 2025 02:11
@idavis idavis self-assigned this Feb 4, 2025
Index,
}

// TODO: This seems to be an unnecessary wrapper.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
Keyword(Keyword),
}

// TODO: This seems to be an unnecessary wrapper.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
orpuente-MS and others added 4 commits March 8, 2025 09:24
Previously assignments and binary assignments were valid in any part of
the expression tree. This PR makes Assign and AssignOp valid only in
expression statements.
This PR turns assignment into a StmtKind (it was a ExprKind before).
This PR:
 1. Fixes a bug with block statements
 2. Adds grammar docstrings to the QASM3 parser.
3. Adds the invalid tests in the reference parser to make sure they are
invalid for our parser as well.
rc::Rc,
};

// TODO: Profile this with iai-callgrind in a large OpenQASM3

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment

let expr = if matches!(ty, Type::Complex(..)) {
if is_complex_binop_supported(op) {
// TODO: How do we handle complex binary expressions?

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
)
}

// TODO: which these are parsed as different types, they are effectively the same

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
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