Skip to content

Commit

Permalink
Merge pull request #439 from eed3si9n/wip/sip-47
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n authored Dec 12, 2024
2 parents 1405853 + ca827fb commit 45803f9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
8 changes: 6 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,14 @@ module.exports = grammar({
prec.right(
seq(
field("name", $._identifier),
field("type_parameters", optional($.type_parameters)),
field(
"parameters",
repeat(seq(optional($._automatic_semicolon), $.parameters)),
repeat(seq(optional($._automatic_semicolon),
choice(
$.parameters,
$.type_parameters
)
)),
),
optional($._automatic_semicolon),
),
Expand Down
55 changes: 54 additions & 1 deletion test/corpus/definitions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,11 @@ class A:
val y = 2
x + y

// SIP-47 - Clause Interleaving
def getOrElse(k: Key)[V >: k.Value](default: V): V

def aaa[A](using a: A)(b: List[A])[C <: a.type, D](cd: (C, D))[E]: Unit

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

(compilation_unit
Expand All @@ -1175,7 +1180,55 @@ class A:
(infix_expression
(identifier)
(operator_identifier)
(identifier)))))))
(identifier))
(comment)))
(function_declaration
(identifier)
(parameters
(parameter
(identifier)
(type_identifier)))
(type_parameters
(identifier)
(lower_bound
(stable_type_identifier
(identifier)
(type_identifier))))
(parameters
(parameter
(identifier)
(type_identifier)))
(type_identifier))
(function_declaration
(identifier)
(type_parameters
(identifier))
(parameters
(parameter
(identifier)
(type_identifier)))
(parameters
(parameter
(identifier)
(generic_type
(type_identifier)
(type_arguments
(type_identifier)))))
(type_parameters
(identifier)
(upper_bound
(singleton_type
(identifier)))
(identifier))
(parameters
(parameter
(identifier)
(tuple_type
(type_identifier)
(type_identifier))))
(type_parameters
(identifier))
(type_identifier)))))

================================================================================
Extension methods (Scala 3 syntax)
Expand Down

0 comments on commit 45803f9

Please sign in to comment.