Skip to content

Commit 6bf3976

Browse files
GiggleLiuclaude
andcommitted
Address PR review feedback and fix CI issues
- Remove duplicate method definitions in parse_v3.jl that caused precompilation failures - Remove unsupported operators from documentation (** power operator, % modulo operator) - Fix while loop example in README to not use unimplemented assignments - Fix Aqua persistent tasks test (now passes after removing duplicate methods) All tests now pass successfully including Aqua quality checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5503590 commit 6bf3976

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ This package currently supports the following OpenQASM 3.0 features:
9595
- **Control Flow**: `if-else`, `while`, `for` loops, `break`, `continue`
9696
```julia
9797
if (c == 1) { x q; } else { h q; }
98-
while (i < 10) { i = i + 1; }
98+
while (c == 0) { x q; }
9999
for int i in [0:10] { ... }
100100
for int i in {1, 5, 10} { ... }
101101
```
@@ -141,7 +141,7 @@ Important differences to be aware of when migrating from QASM 2.0 to 3.0:
141141

142142
2. **New Syntax**: Prefer `qubit[n]` over `qreg`, and `bit[n]` over `creg` in QASM 3.0 (though legacy syntax is still supported)
143143

144-
3. **Enhanced Expressions**: QASM 3.0 supports logical operators (`&&`, `||`), comparison operators (`==`, `!=`, `<`, `>`, `<=`, `>=`), and power operator (`**`)
144+
3. **Enhanced Expressions**: QASM 3.0 supports logical operators (`&&`, `||`) and comparison operators (`==`, `!=`, `<`, `>`, `<=`, `>=`)
145145

146146
## Roadmap
147147

src/parse_v3.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ struct QASM3Lang end
1414
# Customize struct names to avoid collisions with QASM 2.0
1515
RBNF.typename(::Type{QASM3Lang}, name::Symbol) = Symbol(:QASM3_, name)
1616

17-
# QASM 3.0 specific type conversions (only define what's unique to v3.0)
18-
Base.convert(::Type{Bool}, t::Token{:reserved}) = (t.str == "const")
19-
Base.convert(::Type{Bool}, ::Nothing) = false
20-
2117
# RBNF crate methods for QASM 3.0 specific types
2218
RBNF.crate(::Type{TypesV3.QASMType}) = TypesV3.IntType()
2319
RBNF.crate(::Type{TypesV3.IntType}) = TypesV3.IntType()
@@ -181,7 +177,7 @@ RBNF.@parser QASM3Lang begin
181177
# ========== Expressions ==========
182178

183179
# Expression grammar with operator precedence
184-
# Supports: logical (&&, ||), comparison (==, !=, <, >, <=, >=), arithmetic (+, -, *, /, %), power (**)
180+
# Supports: logical (&&, ||), comparison (==, !=, <, >, <=, >=), arithmetic (+, -, *, /)
185181

186182
expr = logical_or_expr
187183

test/aqua.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ using OpenQASM
3939

4040
# Test for persistent tasks
4141
@testset "Persistent tasks" begin
42-
# Skip persistent tasks test - it fails due to precompilation issues
43-
# with RBNF.Token wrapper constructor
44-
Aqua.test_persistent_tasks(OpenQASM; broken=true)
42+
Aqua.test_persistent_tasks(OpenQASM)
4543
end
4644
end

0 commit comments

Comments
 (0)