Add the ability to ignore errors in ExprTags
This commit is contained in:
647
parser/parser.go
647
parser/parser.go
File diff suppressed because it is too large
Load Diff
@@ -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]*
|
||||
|
||||
Reference in New Issue
Block a user