-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Digit separators are a C/C++ feature to visually group digits in large hex numbers more clearly (reducing the risk of slipping in typos):
uint32_t Test1 = 0xffff'ffff;
uint32_t Test2 = 0xffff'ffff;
In micro, ' is detected as the start of a character literal, so this ends up with incorrect syntax highlighting all the way up to the next ' (or possibly the end of the file). In practice, this effectively disables syntax highlighting in large parts of the projects I work with.
Some observations about the C++ grammar that may help to fix this problem:
- A digit-separating
'may not be preceded or followed by a space - A digit-separating
'is always preceded or followed by a (hex) digit (0-9, a-f, A-F) - A single integer literal may contain multiple digit separators
- A character literal may not contain line breaks (assuming utf-8 file encoding)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels