Prevent silent swallowing of return expressions trailing arguments (#2545)

Fixes #2104
This commit is contained in:
Samuel Tardieu 2023-11-06 21:42:38 +01:00 committed by GitHub
parent c0f6d2004a
commit e550f0a8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -605,6 +605,7 @@ fn embedded_code_expr(p: &mut Parser) {
| SyntaxKind::Show
| SyntaxKind::Import
| SyntaxKind::Include
| SyntaxKind::Return
);
let prev = p.prev_end();

View File

@ -80,3 +80,10 @@
]
#test(f(), "nope")
---
// Test rejection of extra value
#let f() = [
// Error: 16-16 expected semicolon or line break
#return a + b Hello World
]