Move the ignore error question mark to after the pound symbol
This commit is contained in:
parent
703e55df04
commit
b7669282e3
@ -192,7 +192,7 @@ Salix's expressions mostly work like Go's, but there are some extra features wor
|
|||||||
|
|
||||||
### Ignoring errors
|
### Ignoring errors
|
||||||
|
|
||||||
If you'd like to ignore errors in an expression tag, you can do that by adding a question mark at the end.
|
If you'd like to ignore errors in an expression tag, you can do that by adding a question mark after the pound symbol.
|
||||||
|
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@ -200,7 +200,7 @@ If you'd like to ignore errors in an expression tag, you can do that by adding a
|
|||||||
#(example.Example())
|
#(example.Example())
|
||||||
|
|
||||||
<!-- This would ignore any error and keep executing the rest of the template -->
|
<!-- This would ignore any error and keep executing the rest of the template -->
|
||||||
#(example.Example())?
|
#?(example.Example())
|
||||||
```
|
```
|
||||||
|
|
||||||
### Ternary Expressions
|
### Ternary Expressions
|
||||||
|
598
parser/parser.go
598
parser/parser.go
File diff suppressed because it is too large
Load Diff
@ -75,7 +75,7 @@ EndTag = "#!" name:Ident {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprTag = "#(" item:Expr ')' ignoreErr:'?'? {
|
ExprTag = '#' ignoreErr:'?'? '(' item:Expr ')' {
|
||||||
return ast.ExprTag{
|
return ast.ExprTag{
|
||||||
Value: item.(ast.Node),
|
Value: item.(ast.Node),
|
||||||
IgnoreError: ignoreErr != nil,
|
IgnoreError: ignoreErr != nil,
|
||||||
|
Loading…
Reference in New Issue
Block a user