Skip to content

Commit

Permalink
fix: Ignore multiple newlines in q1asm snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Dec 5, 2024
1 parent 7f873fa commit edf1dca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/qibolab/_core/instruments/qblox/ast_.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ def asm(self, width: Optional[int] = None) -> str:

class Line(Model):
instruction: Instruction
label: Optional[str]
comment: Optional[Annotated[str, AfterValidator(lambda c: c.strip())]]
label: Optional[str] = None
comment: Optional[Annotated[str, AfterValidator(lambda c: c.strip())]] = None

def __rich_repr__(self):
yield self.instruction
Expand Down
4 changes: 2 additions & 2 deletions src/qibolab/_core/instruments/qblox/q1asm.lark
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ comment: COMMENT NEWLINE

%import common.ESCAPED_STRING
%import common (INT, HEXDIGIT)
%import common (NEWLINE, WS_INLINE)
%ignore WS_INLINE
%import common (NEWLINE, WS)
%ignore WS
4 changes: 1 addition & 3 deletions src/qibolab/_core/instruments/qblox/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ def from_pulses(
sweepers: list[ParallelSweepers],
options: ExecutionParameters,
):
return cls(
waveforms={}, weights={}, acquisitions={}, program=Program(elements=[])
)
return cls(waveforms={}, weights={}, acquisitions={}, program="")

0 comments on commit edf1dca

Please sign in to comment.