QuTech-Delft / libqasm

libQASM: Library to parse cQASM files
https://arxiv.org/abs/1805.09607
Other
15 stars 16 forks source link

[Language] Allow breaking long lines using `\` #217

Open rturrado opened 2 months ago

rturrado commented 2 months ago

For example, the code below should be a valid example:

version \
3

This is not supported by the lexer at the moment. \ is not a recognized token. I don't think it should be a big change. I'm sure there are already solutions out there for this issue. The lexer should say something like: OK, whenever you find the token \ followed by the token NEW_LINE, update the line counter, but delete the new line. Something like that.