lock3 / cppx

Extensions to Clang for Compiling the Blue & Gold Languages
29 stars 4 forks source link

Comment Separator Corner Case #86

Open sdgoodrick opened 3 years ago

sdgoodrick commented 3 years ago
new_allocator[T:type] : type = class:
  # Type declarations
  size_type : type = uint64

We discard newlines after comments in the case where the last token was significant (not a newline or whitespace). Here the last token was a newline. We can fix this by only considering whitespace insignificant if it starts a line.

sdgoodrick commented 3 years ago

this is harder than i thought. it's actually an indent, but we can't tell from the line scanner where this is relevant.