rigetti / quil-rs

Quil Parser & Program Builder
https://rigetti.github.io/quil-rs/
Apache License 2.0
18 stars 9 forks source link

Multiple levels of indentation should be invalid #391

Open MarquessV opened 3 weeks ago

MarquessV commented 3 weeks ago

The Quil spec defines an indent as 4 spaces following a new line. Because an indentation must follow a new line, it is impossible for a valid Quil program to have multiple levels of indentation. quil-rs, however, makes no assertion that a program follows this rule. For example, it's possible to put a DEFCIRCUIT inside of another DEFCIRCUIT and serialize said instructions to a program with two levels of indentation.