mirror of
https://github.com/typst/typst
synced 2025-05-16 10:05:28 +08:00
use proper name for paren tokens
This commit is contained in:
parent
c7d97a7248
commit
d35a563b3c
@ -257,7 +257,7 @@ impl Lexer<'_> {
|
||||
let current_start = self.s.cursor();
|
||||
if !self.s.eat_if('(') {
|
||||
self.s.eat_until(is_newline);
|
||||
subtree.push(self.emit_error("expected left parenthesis", current_start));
|
||||
subtree.push(self.emit_error("expected opening paren", current_start));
|
||||
|
||||
// Return a single error node until the end of the decorator.
|
||||
return SyntaxNode::inner(SyntaxKind::Decorator, subtree);
|
||||
@ -317,7 +317,7 @@ impl Lexer<'_> {
|
||||
|
||||
// Right parenthesis (covered above)
|
||||
if !finished {
|
||||
subtree.push(self.emit_error("expected right parenthesis", self.s.cursor()));
|
||||
subtree.push(self.emit_error("expected closing paren", self.s.cursor()));
|
||||
}
|
||||
|
||||
SyntaxNode::inner(SyntaxKind::Decorator, subtree)
|
||||
|
@ -49,18 +49,18 @@ this is ok
|
||||
// Error: 4-18 expected identifier
|
||||
/! 555!**INVALID!
|
||||
|
||||
// Error: 9-12 expected left parenthesis
|
||||
// Error: 9-12 expected opening paren
|
||||
/! allow)")
|
||||
|
||||
// Error: 10-14 unclosed string
|
||||
// Error: 14 expected right parenthesis
|
||||
// Error: 14 expected closing paren
|
||||
/! allow("abc
|
||||
|
||||
// Error: 17-20 expected whitespace
|
||||
/! allow("abc") abc
|
||||
|
||||
// Error: 16-26 expected comma
|
||||
// Error: 26 expected right parenthesis
|
||||
// Error: 26 expected closing paren
|
||||
/! allow("abc" "abc") abc
|
||||
|
||||
// Error: 16-21 expected comma
|
||||
|
Loading…
x
Reference in New Issue
Block a user