Open peterolson opened 11 years ago
Or, perhaps, your coding style would be improved by adhering to Vigil's unspoken rules about swear
and implore
statements?
Why would you wish to divide yourself from a whole into parts? I believe that your code is immoral and must be punished!
In all seriousness, though, this would probably improve readability on long swear/implore statements. While, personally, I can't think of a particular reason that doesn't seem contrived, I'm sure someone will run into a valid use case eventually.
+1 from me.
Vigil has a naïve implementation for parsing
implore
andswear
statements. Here is the relevant section of the source, starting at line 82.Vigil is just passing in everything on a line after an
implore
orswear
statement into avigil_implore
orvigil_swear
function call. This will fail if you have multiline expressions in you code, such as in this very contrived examplePython will interpret everything inside the parentheses as part of a single line, but
f.readlines
will not. If I understand correctly, Vigil will rewrite the above example thus:which is not syntactically valid.
Also, in Python you may put a
\
before a newline and it will interpret the following line as if it were part of the current line. Vigil fails here for the same reason.Vigil would be improved if it were able to parse these multiline expressions correctly.