From 9af3e1f3e06a6789d7cf0bbd59af571f275c821d Mon Sep 17 00:00:00 2001 From: Emilio Srougo Date: Tue, 19 Mar 2024 19:41:05 -0600 Subject: [PATCH] Add support for the explicit partial application syntax --- grammar.js | 3 +++ test/corpus/expressions.txt | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/grammar.js b/grammar.js index df94ee0..9f92f73 100644 --- a/grammar.js +++ b/grammar.js @@ -733,6 +733,7 @@ module.exports = grammar({ '(', optional($.uncurry), optional(commaSep1t($._call_argument)), + optional($.partial_application_spread), ')' ), @@ -744,6 +745,8 @@ module.exports = grammar({ $.labeled_argument, ), + partial_application_spread: $ => "...", + labeled_argument: $ => seq( '~', field('label', $.value_identifier), diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index bb09144..d50cbf8 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -111,6 +111,7 @@ blocky( ~third={3}, ) f(raise) +f(1, ...) -------------------------------------------------------------------------------- @@ -191,7 +192,13 @@ f(raise) (call_expression function: (value_identifier) arguments: (arguments - (value_identifier))))) + (value_identifier)))) + (expression_statement + (call_expression + function: (value_identifier) + arguments: (arguments + (number) + (partial_application_spread))))) ================================================================================ Pipe