Packages
Packages copied to clipboard
[C] Wrong scoping of number if sign and number are on different lines.
What happened?
The following test case fails with the digit 1 not being scoped as part of the number.
int x = -
//^ storage.type.c
// ^ keyword.operator.assignment.c
// ^ keyword.operator.arithmetic.c
1.53;
// ^^^^ meta.number.float.decimal.c constant.numeric.value.c
// ^ punctuation.separator.decimal.c
// ^ punctuation.terminator.c
Interestingly, the scoping works if there are no leading spaces.
Having looked at this some more, it seems to me the culprit is
global:
- include: early-expressions
- match: '^\s*(?=\w+)'
push: global-modifier
- include: late-expressions
This won't match anything from early-expressions if it is following some leading spaces.
C family needs definitly a rewrite.