Skip to content

SIP-47 Clause Interleaving support #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const PREC = {

Check notice on line 1 in grammar.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

ok, scala_scala/src/library/: 100.00%, expected at least 100%

Check notice on line 1 in grammar.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

ok, scala_scala/src/compiler/: 96.65%, expected at least 96%

Check notice on line 1 in grammar.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

ok, dotty/compiler/: 83.62%, expected at least 83%

Check notice on line 1 in grammar.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

ok, lila/modules/: 84.81%, expected at least 84%
comment: 1,
using_directive: 2,
control: 1,
Expand Down Expand Up @@ -550,10 +550,14 @@
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 Expand Up @@ -891,7 +895,7 @@
),
),

tuple_type: $ => seq("(", trailingCommaSep1($._type), ")"),

Check notice on line 898 in grammar.js

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

ok, complexity of the most complex definition tuple_type: 1217, lower than the allowed ceiling 1400

singleton_type: $ =>
prec.left(
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
Loading