Small tweaks

This commit is contained in:
Gregory Schier
2023-02-26 15:25:55 -08:00
parent 5658da34a2
commit 83f84ded8d
3 changed files with 10 additions and 19 deletions

View File

@@ -3,21 +3,14 @@
@top Template { (directive | Text)* }
directive {
// Insert |
// Conditional { ConditionalOpen (directive | Text)* ConditionalClose }
Insert
}
@skip {space} {
Insert { "{{" DirectiveContent "}}" }
// ConditionalOpen { "{%" kw<"if"> DirectiveContent "%}" }
// ConditionalClose { "{%" kw<"endif"> "%}" }
}
kw<word> { @specialize[@name={word}]<Identifier, word> }
@tokens {
Identifier { @asciiLetter+ }
Text { ![{] Text? | "{" (@eof | ![%{] Text?) }
space { @whitespace+ }
DirectiveContent { ![%}] DirectiveContent? | $[%}] (@eof | ![}] DirectiveContent?) }
@@ -25,4 +18,4 @@ kw<word> { @specialize[@name={word}]<Identifier, word> }
"{{" "}}" // "{%" "%}"
}
@external propSource twigHighlight from "./twig-highlight.ts"
@external propSource twigHighlight from "./twig-highlight"