summaryrefslogtreecommitdiff
path: root/crates/typst-syntax
diff options
context:
space:
mode:
authorIan Wrzesinski <133046678+wrzian@users.noreply.github.com>2024-11-01 05:45:08 -0400
committerGitHub <noreply@github.com>2024-11-01 09:45:08 +0000
commita70b8a56ef17d493c8ebf8c3fee6f86b4bb1e994 (patch)
tree7cd9acac3dbfc9bf76622e23f3569aed60b41e81 /crates/typst-syntax
parent23313b0af0e9a70f313863db6bb1f5f5beca7de4 (diff)
Disallow space between ident and paren in set rule (#5269)
Diffstat (limited to 'crates/typst-syntax')
-rw-r--r--crates/typst-syntax/src/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs
index 8c783ffe..a8bec626 100644
--- a/crates/typst-syntax/src/parser.rs
+++ b/crates/typst-syntax/src/parser.rs
@@ -1224,8 +1224,11 @@ fn array_or_dict_item(p: &mut Parser, state: &mut GroupState) {
/// Parses a function call's argument list: `(12pt, y)`.
fn args(p: &mut Parser) {
- if !p.at(SyntaxKind::LeftParen) && !p.at(SyntaxKind::LeftBracket) {
+ if !p.directly_at(SyntaxKind::LeftParen) && !p.directly_at(SyntaxKind::LeftBracket) {
p.expected("argument list");
+ if p.at(SyntaxKind::LeftParen) || p.at(SyntaxKind::LeftBracket) {
+ p.hint("there may not be any spaces before the argument list");
+ }
}
let m = p.marker();