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 6faee02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 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
5 changes: 4 additions & 1 deletion src/qibolab/_core/instruments/qblox/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ def from_pulses(
options: ExecutionParameters,
):
return cls(
waveforms={}, weights={}, acquisitions={}, program=Program(elements=[])
waveforms={},
weights={},
acquisitions={},
program="",
)

0 comments on commit 6faee02

Please sign in to comment.