Skip to content

Commit

Permalink
Add reset to QasmParser
Browse files Browse the repository at this point in the history
Add a test which can serve as example including the modifications to
support the `reset` keyword in the import of QASM files in the PLY based
lexer/parser.
  • Loading branch information
rscircus committed Sep 14, 2024
1 parent 2adc218 commit bfac925
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 88 deletions.
5 changes: 5 additions & 0 deletions cirq-core/cirq/contrib/qasm_import/_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self):
reserved = {
'qreg': 'QREG',
'creg': 'CREG',
'reset': 'RESET',
'measure': 'MEASURE',
'if': 'IF',
'->': 'ARROW',
Expand Down Expand Up @@ -91,6 +92,10 @@ def t_CREG(self, t):
r"""creg"""
return t

def t_RESET(self, t):
r"""reset"""
return t

def t_MEASURE(self, t):
r"""measure"""
return t
Expand Down
Loading

0 comments on commit bfac925

Please sign in to comment.