Allow patterns in use expressions (#49)

pull/844/head
Michael Davis 2023-03-02 22:25:47 +07:00 committed by GitHub
parent 1ef8e0f02d
commit 7bfdc49a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

@ -444,7 +444,7 @@ module.exports = grammar({
use: ($) => use: ($) =>
seq( seq(
"use", "use",
optional(series_of($.identifier, ",")), optional(series_of($._pattern, ",")),
"<-", "<-",
field("value", $._expression) field("value", $._expression)
), ),

@ -105,6 +105,8 @@ use a <- f()
use a, b, c, d, e <- f() use a, b, c, d, e <- f()
use #(a, b) <- blah
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
(source_file (source_file
@ -125,4 +127,9 @@ use a, b, c, d, e <- f()
(identifier) (identifier)
(function_call (function_call
(identifier) (identifier)
(arguments)))) (arguments)))
(use
(tuple_pattern
(identifier)
(identifier))
(identifier)))