Add the ability to ignore errors in ExprTags

This commit is contained in:
2024-02-07 18:27:08 -08:00
parent 958a25d559
commit 93550b0420
6 changed files with 365 additions and 318 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -75,10 +75,11 @@ EndTag = "#!" name:Ident {
}, nil
}
ExprTag = "#(" item:Expr ')' {
ExprTag = "#(" item:Expr ')' ignoreErr:'?'? {
return ast.ExprTag{
Value: item.(ast.Node),
Position: getPos(c),
Value: item.(ast.Node),
IgnoreError: ignoreErr != nil,
Position: getPos(c),
}, nil
}
@@ -248,4 +249,4 @@ ArithmeticOp = ('+' / '-' / '/' / '*' / '%') {
Text = . [^#]* { return ast.Text{Data: c.text, Position: getPos(c)}, nil }
_ "whitespace" ← [ \t\r\n]*
_ "whitespace" ← [ \t\r\n]*