Skip to content

Commit 9af3e1f

Browse files
committed
Add support for the explicit partial application syntax
1 parent 309fd25 commit 9af3e1f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

grammar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ module.exports = grammar({
733733
'(',
734734
optional($.uncurry),
735735
optional(commaSep1t($._call_argument)),
736+
optional($.partial_application_spread),
736737
')'
737738
),
738739

@@ -744,6 +745,8 @@ module.exports = grammar({
744745
$.labeled_argument,
745746
),
746747

748+
partial_application_spread: $ => "...",
749+
747750
labeled_argument: $ => seq(
748751
'~',
749752
field('label', $.value_identifier),

test/corpus/expressions.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ blocky(
111111
~third={3},
112112
)
113113
f(raise)
114+
f(1, ...)
114115

115116
--------------------------------------------------------------------------------
116117

@@ -191,7 +192,13 @@ f(raise)
191192
(call_expression
192193
function: (value_identifier)
193194
arguments: (arguments
194-
(value_identifier)))))
195+
(value_identifier))))
196+
(expression_statement
197+
(call_expression
198+
function: (value_identifier)
199+
arguments: (arguments
200+
(number)
201+
(partial_application_spread)))))
195202

196203
================================================================================
197204
Pipe

0 commit comments

Comments
 (0)