Prevent silent swallowing of return expressions trailing arguments (#2545)
Fixes #2104
This commit is contained in:
parent
c0f6d2004a
commit
e550f0a8f7
|
|
@ -605,6 +605,7 @@ fn embedded_code_expr(p: &mut Parser) {
|
||||||
| SyntaxKind::Show
|
| SyntaxKind::Show
|
||||||
| SyntaxKind::Import
|
| SyntaxKind::Import
|
||||||
| SyntaxKind::Include
|
| SyntaxKind::Include
|
||||||
|
| SyntaxKind::Return
|
||||||
);
|
);
|
||||||
|
|
||||||
let prev = p.prev_end();
|
let prev = p.prev_end();
|
||||||
|
|
|
||||||
|
|
@ -80,3 +80,10 @@
|
||||||
]
|
]
|
||||||
|
|
||||||
#test(f(), "nope")
|
#test(f(), "nope")
|
||||||
|
|
||||||
|
---
|
||||||
|
// Test rejection of extra value
|
||||||
|
#let f() = [
|
||||||
|
// Error: 16-16 expected semicolon or line break
|
||||||
|
#return a + b Hello World
|
||||||
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue