mirror of https://github.com/openqasm/openqasm.git
83 lines
2.1 KiB
YAML
83 lines
2.1 KiB
YAML
# indent w/ 2 spaces
|
|
source: |
|
|
if (x == a) {
|
|
for uint i in [0:2:4] x[i] += 1;
|
|
}
|
|
else CX x[0], x[1];
|
|
reference: |
|
|
program
|
|
statementOrScope
|
|
statement
|
|
ifStatement
|
|
if
|
|
(
|
|
expression
|
|
expression
|
|
x
|
|
==
|
|
expression
|
|
a
|
|
)
|
|
statementOrScope
|
|
scope
|
|
{
|
|
statementOrScope
|
|
statement
|
|
forStatement
|
|
for
|
|
scalarType
|
|
uint
|
|
i
|
|
in
|
|
[
|
|
rangeExpression
|
|
expression
|
|
0
|
|
:
|
|
expression
|
|
2
|
|
:
|
|
expression
|
|
4
|
|
]
|
|
statementOrScope
|
|
statement
|
|
assignmentStatement
|
|
indexedIdentifier
|
|
x
|
|
indexOperator
|
|
[
|
|
expression
|
|
i
|
|
]
|
|
+=
|
|
expression
|
|
1
|
|
;
|
|
}
|
|
else
|
|
statementOrScope
|
|
statement
|
|
gateCallStatement
|
|
CX
|
|
gateOperandList
|
|
gateOperand
|
|
indexedIdentifier
|
|
x
|
|
indexOperator
|
|
[
|
|
expression
|
|
0
|
|
]
|
|
,
|
|
gateOperand
|
|
indexedIdentifier
|
|
x
|
|
indexOperator
|
|
[
|
|
expression
|
|
1
|
|
]
|
|
;
|
|
<EOF>
|