Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/oq3_parser/src/grammar/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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!['('];
Expand Down
2 changes: 1 addition & 1 deletion crates/oq3_parser/src/grammar/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: ')'
Expand Down
4 changes: 2 additions & 2 deletions crates/oq3_semantics/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub struct Context {
pub const_values: HashMap<SymbolId, asg::TExpr>,

/// 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<asg::Annotation>,
}

Expand Down
5 changes: 3 additions & 2 deletions crates/pipeline-tests/tools/expect_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading