fix scanner and update regexes

This commit is contained in:
danhanson committed 2026-09-06 05:01:03 -05:00
1 parent 140e099275
commit d86f6533a8
6 files changed
+1312 -1270

No files matched your search

+2 -2
View File
@@ -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))),