fix(editor): drop dead -? from srccfg number regex
The `\b` word boundary anchor prevents the optional minus from ever matching from positions where signed numbers naturally appear (` -1`, `(-1`, `=-1` all word-boundary-from-non-word and the `-?` fires zero chars). Negative numbers are tokenised via the operator class instead, which is the consistent behaviour the grammar already exhibits. Plan source block updated to match so a fresh regeneration produces the same file. Addresses Minor #1 from the Task 2 code review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7cfbedb929
commit
db1a255223
2 changed files with 2 additions and 2 deletions
|
|
@ -207,7 +207,7 @@ Create `l4d2web/l4d2web/static/js/srccfg-grammar.js`:
|
|||
greedy: true,
|
||||
},
|
||||
keyword: /\b(?:exec|alias|bind|unbind|toggle)\b/,
|
||||
number: /\b-?\d+(?:\.\d+)?\b/,
|
||||
number: /\b\d+(?:\.\d+)?\b/,
|
||||
identifier: /\b[a-zA-Z_][a-zA-Z0-9_]*\b/,
|
||||
operator: /[+\-;]/,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
greedy: true,
|
||||
},
|
||||
keyword: /\b(?:exec|alias|bind|unbind|toggle)\b/,
|
||||
number: /\b-?\d+(?:\.\d+)?\b/,
|
||||
number: /\b\d+(?:\.\d+)?\b/,
|
||||
identifier: /\b[a-zA-Z_][a-zA-Z0-9_]*\b/,
|
||||
operator: /[+\-;]/,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue