mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Fix semicolon parsing
This commit is contained in:
parent
028632a3a1
commit
c1637054a4
@ -529,7 +529,9 @@ fn embedded_code_expr(p: &mut Parser) {
|
|||||||
p.unexpected();
|
p.unexpected();
|
||||||
}
|
}
|
||||||
|
|
||||||
let semi = p.eat_if(SyntaxKind::Semicolon);
|
let semi =
|
||||||
|
(stmt || p.directly_at(SyntaxKind::Semicolon)) && p.eat_if(SyntaxKind::Semicolon);
|
||||||
|
|
||||||
if stmt && !semi && !p.eof() && !p.at(SyntaxKind::RightBracket) {
|
if stmt && !semi && !p.eof() && !p.at(SyntaxKind::RightBracket) {
|
||||||
p.expected("semicolon or line break");
|
p.expected("semicolon or line break");
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 6.6 KiB |
@ -10,6 +10,10 @@ K #if true [L] else []M \
|
|||||||
#let c = true; N#while c [#(c = false)O] P \
|
#let c = true; N#while c [#(c = false)O] P \
|
||||||
#let c = true; Q #while c { c = false; "R" } S \
|
#let c = true; Q #while c { c = false; "R" } S \
|
||||||
T#for _ in (none,) {"U"}V
|
T#for _ in (none,) {"U"}V
|
||||||
|
#let foo = "A" ; \
|
||||||
|
#foo;B \
|
||||||
|
#foo; B \
|
||||||
|
#foo ;B
|
||||||
|
|
||||||
---
|
---
|
||||||
// Test spacing with comments.
|
// Test spacing with comments.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user