Small tweaks

This commit is contained in:
Gregory Schier
2023-02-26 15:25:55 -08:00
parent 2c0a891838
commit fe18cd1806
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"

View File

@@ -1,19 +1,18 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
import { LRParser } from '@lezer/lr';
import { twigHighlight } from './twig-highlight';
import {LRParser} from "@lezer/lr"
import {twigHighlight} from "./twig-highlight"
export const parser = LRParser.deserialize({
version: 14,
states: "zQVOPOOO_QQO'#C^OOOO'#Cc'#CcQVOPOOOdQQO,58xOOOO-E6a-E6aOOOO1G.d1G.d",
stateData: 'l~OYOS~ORPOUQO~OSSO~OTUO~OYS~',
goto: 'cWPPXPPPP]TQORQRORTR',
nodeNames: '⚠ Template Insert {{ DirectiveContent }} Text',
stateData: "l~OYOS~ORPOUQO~OSSO~OTUO~OYS~",
goto: "cWPPXPPPP]TQORQRORTR",
nodeNames: "⚠ Template Insert {{ DirectiveContent }} Text",
maxTerm: 10,
propSources: [twigHighlight],
skippedNodes: [0],
repeatNodeCount: 1,
tokenData:
",gRRmOX!|X^'u^p!|pq'uqu!|uv#pv#o!|#o#p)y#p#q!|#q#r+_#r#y!|#y#z'u#z$f!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 -70,7 +70,6 @@ export const placeholders = ViewPlugin.fromClass(
this.placeholders = placeholderMatcher.createDeco(view);
}
update(update: ViewUpdate) {
console.log('VIEW UPDATE', update);
this.placeholders = placeholderMatcher.updateDeco(update, this.placeholders);
}
},