Fixed grammar to account for d8 not being a name

This commit is contained in:
Stefan Zermatten
2023-01-31 20:55:35 +02:00
parent 67da641244
commit deca9786b9
3 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
// Must contain a letter, and be made of word characters only
const VARIABLE_NAME_REGEX = /^[a-zA-Z~][a-zA-Z_0-9]+$/i;
const VARIABLE_NAME_REGEX = /^[~#]?[a-zA-Z]*[a-ce-zA-Z][a-zA-Z0-9_]*$/i;
export default VARIABLE_NAME_REGEX;

View File

@@ -13,7 +13,7 @@ function id(x) { return x[0]; }
value: s => s.slice(1, -1).replace('\\n', '\n'),
},
name: {
match: /[a-zA-Z~#][a-zA-Z0-9_]+/,
match: /[~#]?[a-zA-Z]*[a-ce-zA-Z][a-zA-Z0-9_]*/,
type: moo.keywords({
'keywords': ['true', 'false'],
}),

View File

@@ -11,7 +11,7 @@
value: s => s.slice(1, -1).replace('\\n', '\n'),
},
name: {
match: /[a-zA-Z~#][a-zA-Z0-9_]+/,
match: /[~#]?[a-zA-Z]*[a-ce-zA-Z][a-zA-Z0-9_]*/,
type: moo.keywords({
'keywords': ['true', 'false'],
}),