Skip to content

Conversation

@two-horned
Copy link

@two-horned two-horned commented Dec 3, 2025

Library and tests compile. Tests pass.

I am going to mark it as a draft, till I fixed some formatting issues (e.g. formatter creates function calls over MANY lines in PythonParserTests.scala).

Project's been updated sbt version 1.11.7 and Scala version 3.7.4. See comment below for more info.

Update: Formatting has been fixed.

@two-horned
Copy link
Author

two-horned commented Dec 3, 2025

Many lines have changed due to formatting (autoformatter using a default .scalafmt.conf file).

A quick recap about my significant changes

  • Remove ParserUsage (lazy values cannot be used for paths) in favor of cake pattern. This also caused the paper object and the tests to change.
  • Remove view bounds (unsupported) in favor of explicit type declaration
  • Remove implicit classes (unsupported) in favor of extensions
  • Remove implicit def (old style) in favor of given [e.g., for implicit conversions] ^1
  • Use enum instead defining many case classes
  • Remove do { ... } while (unsupported)
  • Remove private[this] statements (deprecated)
  • Remove deprecated data structures (e.g. mutable.ListMap) in favor of others
  • Remove Symbol (or Symbol literal expressions) with plain ol' String, due to this
  • Use infix notation (backticks) or infix keyword for infix functions
  • Prettify comments to some extend (otherwise broken by the formatter)
  • Minor simplifications of lambda expressions or function definitions
  • Remove optional new keywords
  • Remove some unneeded type annotations. Some places used type annotations for a super-type which I consider bad practice, so removing them at these places was important to me.

^1 a single implicit def survived, due to this issue

Possibly todo

  • More aggressive removal of type annotations, especially for hidden/private values
  • Remove lazy keyword for as many values as possible. If it is not needed, why keep it?
  • Reconsider the type of Printable. I think, it should rather be a trait not an abstract class. The parsers that extend Printable are Parsers first, Printables second, so having Printable as abstract class is a bit odd.

TLDR

Not too much (complicated) work has been done. My focus wasn't to refactor anything, just port the code.
The Scala formatter caused a bit of a big commit, but again, nothing scary really.

@two-horned two-horned marked this pull request as ready for review December 4, 2025 01:10
Enable unsafe binPack for call site
Remove exclusion for simpler formatting cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant