From bae90b8b804de2cc90689c2818f7598c4631d04a Mon Sep 17 00:00:00 2001 From: Jesse Brault Date: Sun, 7 Sep 2025 18:37:49 -0500 Subject: [PATCH] Fix calls. --- src/parser/ast.yaml | 12 ++++++++++++ src/parser/deimos.pest | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/parser/ast.yaml b/src/parser/ast.yaml index 6b2d658..6c6e7b2 100644 --- a/src/parser/ast.yaml +++ b/src/parser/ast.yaml @@ -560,6 +560,18 @@ ParenthesizedExpression: # Calls Call: + rules: + - ParenthesesCall + - NonParenthesesCall +ParenthesesCall: + children: + - turbo_fish: + optional: true + - expression_list: + optional: true + - closure: + optional: true +NonParenthesesCall: children: - turbo_fish: optional: true diff --git a/src/parser/deimos.pest b/src/parser/deimos.pest index fb0d409..8fd2e28 100644 --- a/src/parser/deimos.pest +++ b/src/parser/deimos.pest @@ -755,6 +755,11 @@ ParenthesizedExpression = { // Calls Call = { + ParenthesesCall + | NonParenthesesCall +} + +ParenthesesCall = { TurboFish? ~ "(" ~ ExpressionList? @@ -762,6 +767,15 @@ Call = { ~ Closure? } +NonParenthesesCall = { + TurboFish? + ~ ( + Closure + | ExpressionList + | ExpressionList ~ Closure + ) +} + TurboFish = { "::" ~ GenericArguments