Add the ability to ignore errors in ExprTags

This commit is contained in:
2024-02-07 18:27:21 -08:00
parent 958a25d559
commit 703e55df04
6 changed files with 350 additions and 316 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]*