padolsey/SIML

Single quotes in comments break compilation

Anaphase opened this issue · 1 comments

For some reason single quotes in comments break compilation. For example:

div
  // this is a valid comment
  p 'This is a paragraph.'

compiles fine, but this doesn't:

div
  // this isn't a valid comment
  p 'This is a paragraph.'

It returns this error:
SyntaxError: SIML: Line 2, column 3: Expected "(", ":", "[", "}", AttributeName, Directive, HTML, String, [#.], [\r\n\t ], [a-z0-9_\-]i or [a-zA-Z_$] but "/" found.

I took a look through the source and I think the issue is caused by having the string tokens replaced before the comments are removed. Would it brealk anything to move the comment removal before the string tokens are replaced?

Same issue happens with double-quotes.