Skip to content
CAI
Software that uses CAICheck a score

scala/scala-parser-combinators

60.6

Adequate · 28 September 2026

2.6k

lines of production code

Scala

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the Scala Parser Combinators library, providing a framework for constructing parsers from reusable components. It offers lexical and syntactical parsing capabilities, including tokenization and regex-based parsing, across JVM, Scala.js, and Scala Native platforms. The library manages input streams and position tracking while ensuring compatibility with multiple Scala versions through cross-compilation support.

How it got here

2013–2016 — Parser Combinators library creation and cross-platform support

10 changes.

This period focused on the initial development and release of the Scala Parser Combinators library, establishing core parsing, lexical, and input abstractions. Significant effort was dedicated to enabling cross-compilation for Scala.js by sharing source code and implementing platform-specific optimizations like position caching. The work also included comprehensive testing and a major governance overhaul to transition the project to a community-maintained model under the Apache 2.0 license.

2017–2021 — Scala Native support and test coverage

4 changes.

This period focused on enabling Scala Native compatibility by implementing position caching and adapting collection interfaces for Scala 2.13. Significant effort was also dedicated to improving reliability through comprehensive test coverage for parsing positions, lexical tokenization, and stack overflow safety.

Features

Add JVM-specific PositionCache for parsing input

A new PositionCache trait is introduced in the JVM source directory (jvm/src/main/scala/scala/util/parsing/input/PositionCache.scala) to manage character index caching for parsing inputs. This implementation uses a ThreadLocal wrapping a WeakHashMap to store index arrays, ensuring that cache data is isolated per thread and does not leak references unnecessarily, which addresses potential memory or concurrency issues associated with using DynamicVariable in this context.

jvm · high confidence

Add Scala Native support for parsing input position caching

This change introduces a new \PositionCache\ trait within the \scala.util.parsing.input\ package, specifically located in the \native\ source directory. The implementation provides a no-op cache for character sequence positions, ensuring that parsing operations behave consistently on Scala Native by avoiding unsupported map operations. This enables the parsing library to function correctly on the Scala Native platform.

native · high confidence

Add Scala.js support to the syntactical parser components

The \StandardTokenParsers\, \StdTokenParsers\, and \TokenParsers\ classes in the \scala.util.parsing.combinator.syntactical\ package have been added to the shared source directory, enabling cross-compilation for Scala.js. This change allows users to utilize these specific token-parsing components in Scala.js environments, extending the library's compatibility beyond the JVM.

shared/src/main/scala/scala/util/parsing/combinator/syntactical · high confidence

Add standard token definitions for lexical parsing

The \token\ package now includes \StdTokens\ and \Tokens\ traits that define the core token types used by the combinator library. \Tokens\ provides the abstract \Token\ base class along with \ErrorToken\ and \EOF\ implementations, while \StdTokens\ extends this to offer standard token classes for keywords, numeric literals, string literals, and identifiers. This establishes the foundational data structures for lexical analysis within the parser combinators.

shared/src/main/scala/scala/util/parsing/combinator/token · high confidence

Initial release of Scala Parser Combinators library

The \scala.util.parsing.combinator\ package is introduced, providing a suite of generic parser combinator components. This includes the core \Parsers\ trait for constructing parsers from primitives and composition operators, \RegexParsers\ which adds implicit conversions for strings and regular expressions and handles whitespace skipping, and \JavaTokenParsers\ offering pre-defined parsers for Java-style identifiers and literals. The library also supports \PackratParsers\ for memoized, linear-time parsing with left-recursion support, and provides \ImplicitConversions\ to simplify applying functions to nested parser results.

shared/src/main/scala/scala/util/parsing/combinator · high confidence

Introduce lexical parsing components for Scala.js

Added new \Lexical.scala\, \Scanners.scala\, and \StdLexical.scala\ files to the \shared\ source directory, making the lexical parsing components available for cross-compilation to Scala.js. This change enables the \StdLexical\ parser to function in JavaScript environments by sharing the core scanner and tokenization logic previously available only on the JVM.

shared/src/main/scala/scala/util/parsing/combinator/lexical · high confidence

Introduce new parsing input abstractions for character streams and positions

The \scala.util.parsing.input\ package now includes a suite of new classes and traits to handle character input and source positioning. This adds \Reader\ as the base interface for character streams, with concrete implementations like \CharArrayReader\, \CharSequenceReader\, \PagedSeqReader\, and \StreamReader\ to read from arrays, character sequences, paged sequences, and Java readers respectively. It also introduces a position tracking system with the \Position\ trait, \NoPosition\, and \OffsetPosition\ (which supports line/column calculation and caching), along with a \Positional\ trait for associating positions with objects. These components provide the foundational input and location tracking capabilities for the parser combinator library.

shared/src/main/scala/scala/util/parsing/input · high confidence

Behavioural changes

Add no-op PositionCache for Scala.js

A new PositionCache trait has been added to the Scala.js source tree, providing a dummy implementation of the position index cache. This implementation uses an empty AbstractMap that ignores all put operations, effectively disabling position caching for the JavaScript platform to ensure compatibility with the 1.0.x series.

js · high confidence

Repository governance and documentation overhaul

The project has transitioned to a community-maintained model under the Apache 2.0 license, replacing previous licensing and governance structures. This change is accompanied by the addition of a Code of Conduct, a standardized .gitignore for modern Scala tooling (sbt, Metals, VS Code), and a .mailmap to consolidate contributor identities. Documentation has been refreshed with a new README featuring build badges for Scala 2.12, 2.13, and 3, links to Scaladex, and a dedicated Getting Started guide, while legacy support channels like Gitter and Travis-CI have been removed in favor of GitHub Discussions and GitHub Actions.

(repo-wide) · high confidence

Scala 2.13-specific implementation for PagedSeq

The library now provides version-specific implementations for the \ScalaVersionSpecificPagedSeq\ trait within the \scala.util.parsing.input\ package. For Scala 2.13 and later, the trait implements \iterableFactory\ to return \collection.IndexedSeq\, aligning with changes in the standard library's collection hierarchy. For Scala 2.12 and earlier, the trait remains empty, ensuring backward compatibility while allowing the codebase to leverage Scala 2.13-specific collection features where available.

shared/src/main/scala-2.13- · high confidence

Test coverage

Added comprehensive test suite for Scala parser combinators; Added tests for OffsetPosition line handling and PagedSeq stack overflow safety; Added unit tests for StdLexical tokenization and error handling.

Dependencies

Upgrade to Scala 2.13.18, 2.12.21, and 3.3.8 with cross-platform support

The build system has been updated to support Scala versions 2.13.18, 2.12.21, and 3.3.8, replacing previous versions. This change enables cross-compilation for JVM, JavaScript, and Native platforms, with specific compiler flags and test configurations tailored for each platform and Scala version (e.g., enabling unused warnings on Scala 2.13 and 3, and disabling forked tests for Scala.js and Native). The project also includes OSGi support for the JVM platform and maintains binary compatibility checks via MiMa, with specific filters applied.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 61 (-0.3)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 53 → 51 (-2.8)
  • Readiness 53 → 56 (+3.4)
  • Security 70 → 70 (+0.0)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (1)

  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • project/plugins.sbt — 1 commit

Notable commits

  • change: Merge pull request #656 from scala-steward/update/sbt-mima-plugin-1.2.1
  • change: Update sbt-mima-plugin to 1.2.1

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

scala/scala-parser-combinators was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit fbcaf5a2088d8b2dab451845839ffcf26203585e — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d46da229e3fd.