fix scanner and update regexes
This commit is contained in:
1 parent
140e099275
commit
d86f6533a8
6 files changed
+1312
-1270
No files matched your search
+2
-2
@@ -73,8 +73,8 @@ const django = grammar({
|
||||
seq($.filter, repeat(seq(token.immediate("|"), $.filter))),
|
||||
value: ($) => choice($.literal, $.variable_attribute),
|
||||
literal: ($) => seq(choice($.number, $.string), $._after_literal),
|
||||
number: ($) => /-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE]-?[0-9]+)?/,
|
||||
string: ($) => /"(?:[^"\\]|\\\\|\\")*"|'(?:[^'\\]|\\\\|\\')*'/,
|
||||
number: ($) => /[-+]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][0-9]+)?/,
|
||||
string: ($) => /"(?:[^"\\]|\\[^\n])*"|'(?:[^'\\]|\\[^\n])*'/,
|
||||
attribute: ($) => /[a-zA-Z0-9_]+(?:\.[a-zA-Z0-9_]+)*/,
|
||||
variable_attribute: ($) =>
|
||||
seq($.identifier, optional(seq(token.immediate("."), $.attribute))),
|
||||
|
||||
Reference in new issue
Block a user