Closed radeksimko closed 5 years ago
I think what's going on here is that a trailing newline is part of the definition of a single-line comment, and so without that trailing newline the scanner doesn't recognize # comment
as being a comment at all. I think fixing this will be a little tricky, though we may be able to do something clever with one of Ragel's advanced end-condition features to get this working.
We may be able to get away with a more straightforward solution in the short term of recognizing this situation better (I assume this can be recognized as a TokenInvalid
whose bytes start with either #
or //
) and, at least, produce a more specialized error explaining that comments must end with newlines. Not the ideal solution by any means, but at least it would guide the user to a working solution for now until we're able to add this exception to the scanner and handle it fully.
This was fixed in d1ed8ee6992b35a7995cde2654c3a5111eecaa50.
This may be just another mutation of https://github.com/hashicorp/hcl2/issues/18
main.tf