Skip to content
Merged
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
10 changes: 7 additions & 3 deletions src/qir_formatter/labeled_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ def emit_values_in_shot(self, qo: StringIO, shot: QsysShot):
"""Given a shot, check the format and emit each user value"""
for cvar in shot:
if cvar is not None and len(cvar) >= 2 and cvar[0] is not None:
fields = cvar[0].split(":", maxsplit=2)
if len(fields) >= 3 and fields[0] == "USER":
self.emit(qo, fields[1], fields[2], cvar[1])
name = cvar[0]
if not name.startswith("USER:"):
continue

ftype, sep, tag = name[5:].partition(":")
if sep:
self.emit(qo, ftype, tag, cvar[1])

def qir_labeled_output(
self, results: QsysShots, attributes: Dict[str, str | None]
Expand Down
Loading