Skip to content

Commit

Permalink
Add support for the explicit partial application syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilios1995 committed Mar 20, 2024
1 parent 309fd25 commit 9af3e1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ module.exports = grammar({
'(',
optional($.uncurry),
optional(commaSep1t($._call_argument)),
optional($.partial_application_spread),
')'
),

Expand All @@ -744,6 +745,8 @@ module.exports = grammar({
$.labeled_argument,
),

partial_application_spread: $ => "...",

labeled_argument: $ => seq(
'~',
field('label', $.value_identifier),
Expand Down
9 changes: 8 additions & 1 deletion test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ blocky(
~third={3},
)
f(raise)
f(1, ...)

--------------------------------------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9af3e1f

Please sign in to comment.