From 439b52c12f02526535b9afc84156b5d0916cf868 Mon Sep 17 00:00:00 2001 From: John Lapeyre <1969884+jlapeyre@users.noreply.github.com> Date: Sun, 30 Nov 2025 23:55:35 -0500 Subject: [PATCH 1/2] Neaten output of expect_summary.py --- crates/pipeline-tests/tools/expect_summary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/pipeline-tests/tools/expect_summary.py b/crates/pipeline-tests/tools/expect_summary.py index 520a97c..2c1d929 100755 --- a/crates/pipeline-tests/tools/expect_summary.py +++ b/crates/pipeline-tests/tools/expect_summary.py @@ -81,9 +81,10 @@ def main(): for st in STAGES: c = counts[st] # Print in a fixed order; include unset if present - parts = [f"{k}={c[k]}" for k in order if c[k] > 0] +# parts = [f"{k}={c[k]}" for k in order if c[k] > 0] + parts = [f"{k}={c[k]:<3}" for k in order if c[k] > 0] total = sum(c.values()) - print(f"- {st:<{STAGE_W}}: total={total}; " + ", ".join(parts)) + print(f"- {st:<{STAGE_W}}: total={total:<3}; " + ", ".join(parts)) return 0 From e4a63d2c81ec4996e23637c754dca49a50ed1f57 Mon Sep 17 00:00:00 2001 From: John Lapeyre <1969884+jlapeyre@users.noreply.github.com> Date: Sun, 30 Nov 2025 23:57:29 -0500 Subject: [PATCH 2/2] Correct function -> subroutine OQ3 procedures are called "subroutines" This corrected in many places in the code --- crates/oq3_parser/src/grammar/expressions.rs | 8 ++++---- crates/oq3_parser/src/grammar/params.rs | 2 +- crates/oq3_semantics/src/context.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/oq3_parser/src/grammar/expressions.rs b/crates/oq3_parser/src/grammar/expressions.rs index 1978367..9dd8537 100644 --- a/crates/oq3_parser/src/grammar/expressions.rs +++ b/crates/oq3_parser/src/grammar/expressions.rs @@ -387,14 +387,14 @@ fn postfix_expr( (lhs, block_like) } -// Consumes either a function (def) call, or a gate call. +// Consumes either a subroutine (def) call, or a gate call. fn call_expr(p: &mut Parser<'_>, lhs: CompletedMarker) -> CompletedMarker { assert!(p.at(T!['('])); let m = lhs.precede(p); call_arg_list(p); // If after consuming `(x,y,..)` we find an identifier, it must be // a gate call statement. `expr_stmt` has already begun but will be abandoned. - // If there is no identifier, it is a function call. + // If there is no identifier, it is a subroutine call. if matches!(p.current(), IDENT | HARDWAREIDENT) { params::arg_list_gate_call_qubits(p); return m.complete(p, GATE_CALL_EXPR); @@ -535,7 +535,7 @@ pub(crate) fn designator(p: &mut Parser<'_>) -> bool { // syntax errors here. // // We assume here that it is not allowed to cast types to integer, even - // those that would be allowed in, say, arguments to function calls. I don't + // those that would be allowed in, say, arguments to subroutine calls. I don't // see this addressed in the spec. if matches!( p.current(), @@ -602,7 +602,7 @@ pub(crate) fn index_operator(p: &mut Parser<'_>) { m.complete(p, INDEX_OPERATOR); } -// For function call and gate call +// For subroutine call and gate call // Cannot enforce no empty parens in gate call here. pub(crate) fn call_arg_list(p: &mut Parser<'_>) { let bra = T!['(']; diff --git a/crates/oq3_parser/src/grammar/params.rs b/crates/oq3_parser/src/grammar/params.rs index 09f7592..976603b 100644 --- a/crates/oq3_parser/src/grammar/params.rs +++ b/crates/oq3_parser/src/grammar/params.rs @@ -28,7 +28,7 @@ pub(super) fn arg_list_gate_call_qubits(p: &mut Parser<'_>) { } pub(super) fn param_list_def_params(p: &mut Parser<'_>) { - // Function definition parameter list: (t0 p0, t1 p1, ...) + // Subroutine definition parameter list: (t0 p0, t1 p1, ...) // - parens: yes // - typed: yes // - terminator: ')' diff --git a/crates/oq3_semantics/src/context.rs b/crates/oq3_semantics/src/context.rs index 2defd1d..182b0fd 100644 --- a/crates/oq3_semantics/src/context.rs +++ b/crates/oq3_semantics/src/context.rs @@ -25,8 +25,8 @@ pub struct Context { pub const_values: HashMap, /// Temporary storage for annoations. Annotations are pushed here as they are - /// parsed. When the annotated function definition is parsed, the annotations are attached - /// to the representation of the function definition. + /// parsed. When the annotated subroutine definition is parsed, the annotations are attached + /// to the representation of the subroutine definition. pub annotations: Vec, }