Commit 9c12fbc
committed
fix(grammar): use fixed-length look-behind in FunC function definitions
The function-definition rule used a variable-length look-behind,
`(?<=^|[;{]\s*)`. Oniguruma accepts it, so VS Code highlighting is
unaffected, but engines that require fixed-length look-behind reject it
(for example the grammar compiler GitHub Linguist uses), which prevents
the grammar from being reused there.
Split the assertion into two fixed-length look-behinds, `(?<=^)` and
`(?<=[;{])`, and move `\s*` into the match. Behavior is unchanged: a
function name is still matched at the start of a line, or after `;` or `{`
with optional whitespace.1 parent 611df4f commit 9c12fbc
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
0 commit comments