Fix dollar sign in Twig grammar

This commit is contained in:
Gregory Schier
2024-08-13 10:12:09 -07:00
parent c69bee251d
commit ed214367d3
4 changed files with 14 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
import { styleTags, tags as t } from '@lezer/highlight';
export const highlight = styleTags({
Open: t.tagName,
Close: t.tagName,
Content: t.keyword,
TagOpen: t.tagName,
TagClose: t.tagName,
TagContent: t.keyword,
});

View File

@@ -1,17 +1,17 @@
@top Template { (Tag | Text)* }
@local tokens {
Close { "]}" }
@else Content
TagClose { "]}" }
@else TagContent
}
@skip { } {
Open { "${[" }
Tag { Open (Content)+ Close }
TagOpen { "${[" }
Tag { TagOpen (TagContent)+ TagClose }
}
@tokens {
Text { ![$] Text? }
Text { ![$] Text? | "$" (@eof | ![{] Text?) }
}
@external propSource highlight from "./highlight"

View File

@@ -1,8 +1,7 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
export const
Template = 1,
export const Template = 1,
Tag = 2,
TagContent = 4,
Open = 3,
Content = 4,
Close = 5,
Text = 6
Text = 6;

View File

@@ -6,13 +6,14 @@ export const parser = LRParser.deserialize({
states: "!^QQOPOOOOOO'#C_'#C_OYOQO'#C^OOOO'#Cc'#CcQQOPOOOOOO'#Cd'#CdO_OQO,58xOOOO-E6a-E6aOOOO-E6b-E6bOOOO1G.d1G.d",
stateData: "g~OUROYPO~OSTO~OSTOTXO~O",
goto: "nXPPY^PPPbhTROSTQOSQSORVSQUQRWU",
nodeNames: "⚠ Template Tag Open Content Close Text",
nodeNames: "⚠ Template Tag TagOpen TagContent TagClose Text",
maxTerm: 10,
propSources: [highlight],
skippedNodes: [0],
repeatNodeCount: 2,
tokenData: "![~RTOtbtuyu;'Sb;'S;=`s<%lOb~gSU~Otbu;'Sb;'S;=`s<%lOb~vP;=`<%lb~|P#o#p!P~!SP!}#O!V~![OY~",
tokenData: "#]~RTOtbtu!hu;'Sb;'S;=`!]<%lOb~gTU~Otbtuvu;'Sb;'S;=`!]<%lOb~yUO#ob#p;'Sb;'S;=`!]<%l~b~Ob~~!c~!`P;=`<%lb~!hOU~~!kVO#ob#o#p#Q#p;'Sb;'S;=`!]<%l~b~Ob~~!c~#TP!}#O#W~#]OY~",
tokenizers: [1, new LocalTokenGroup("b~RP#P#QU~XP#q#r[~aOT~~", 17, 4)],
topRules: {"Template":[0,1]},
tokenPrec: 0
})