Open
Description
Thanks for the quick release!
Sadly I discovered one more bug with the annotation lexing 😅.
(Sry for all these weird ede-cases 🙈)
POC
Consider the following OpenQASM 3 snippet:
@annotation
@annotation value
@annotation.long.namespace
@annotation.long.namespace value
@annotation.long.namespace
@annotation.long.namespace value
Issue
Using the current regex, the last namespace segment get's captured in a separate capture-group that will currently be marked as whitespace instead of the actual whitespace (last capture-group) at the end.
openqasm-pygments/src/openqasm_pygments/qasm3.py
Lines 83 to 84 in e7eed12
https://regex101.com/r/a6mCWI/1
Solution
Use a non-capturing group for the namespace part.
- r"^([ \t]*)(@\w+(\.\w+)*)([ \t]*)",
+ r"^([ \t]*)(@\w+(?:\.\w+)*)([ \t]*)",
Metadata
Metadata
Assignees
Labels
No labels