Skip to content

Scala: ScalaSpace class for handling nesting comments#7915

Merged
greg-at-moderne merged 2 commits into
mainfrom
greg-scala-nested-block-comments
Jun 5, 2026
Merged

Scala: ScalaSpace class for handling nesting comments#7915
greg-at-moderne merged 2 commits into
mainfrom
greg-scala-nested-block-comments

Conversation

@greg-at-moderne
Copy link
Copy Markdown
Contributor

@greg-at-moderne greg-at-moderne commented Jun 5, 2026

What's changed?

Introducing and using ScalaSpace - a variant of the Space.java utility for parsing whitespace.

What's your motivation?

The driver for the change is that in Scala the multiline comments can be nested. As opposed to Java. See:

// Java
/* outer /* inner */ comment */

vs.

// Scala
/* outer /* inner */ comment */

Thus, we cannot use the same approach for parsing Scala comments. Otherwise it fails big time.

@greg-at-moderne greg-at-moderne marked this pull request as ready for review June 5, 2026 13:51
@greg-at-moderne greg-at-moderne merged commit 5e614da into main Jun 5, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jun 5, 2026
@greg-at-moderne greg-at-moderne deleted the greg-scala-nested-block-comments branch June 5, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant