Skip to content

Improve lexer - #4551

Merged
andimarek merged 5 commits into
masterfrom
codex/improve-lexer
Nov 11, 2026
Merged

andimarek merged 5 commits into
masterfrom
codex/improve-lexer

Conversation

@andimarek

@andimarek andimarek commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Oversized numeric literals are now rejected while the lexer is matching them, before it scans the entire literal or converts it to an arbitrary-precision number. The configured numeric-character limit also stops long malformed exponents.

The lexer throws an internal exception carrying the start line, column, and configured limit. Parser.parseImpl translates it into the existing localized ParseCancelledTooManyNumericLiteralCharactersException, preserving source mapping and normal GraphQL error reporting. This removes the numeric-limit callback from SafeTokenSource, its fallback rethrow, and the synthetic token/text copy previously used to invoke the callback.

Regression coverage checks numeric boundaries and early lexing cancellation, source locations across multiple SDL sources, localized messages, standalone value parsing, and GraphQL execution returning an InvalidSyntaxError without invoking a data fetcher. The callback-specific tests are removed because that contract no longer exists. NumericLexerBenchmark covers small valid input, many small numbers, a large integer, and a malformed exponent.

Validation:

  • 304 focused parser tests passed on Java 25.
  • Full local Java 25 validation passed: Spock (6,279 passed, 7 skipped), TestNG (141 passed, 49 skipped), checks, Javadoc, and JaCoCo.
  • The local per-class coverage comparison found no regressions across 992 classes.
  • GitHub CI passed on 5bdf8e14d: Java 17/21/25 tests and TestNG, build checks, Javadoc, jcstress, file validation, and the per-class coverage gate.
  • The coverage baseline is unchanged.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 17 6443 (+24 🟢) 6387 (+24 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 21 6443 (+24 🟢) 6387 (+24 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 25 6443 (+24 🟢) 6387 (+24 🟢) 0 (±0) 0 (±0) 56 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 19361 (+72 🟢) 19193 (+72 🟢) 0 (±0) 0 (±0) 168 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 30511 3031 91.0% ±0.0%
Branches 9052 1498 85.8% ±0.0%
Methods 8142 1168 87.5% ±0.0%

No per-class coverage changes detected.

Full HTML report: build artifact jacoco-html-report

Updated: 2026-11-11 22:58:24 UTC

@andimarek
andimarek merged commit 2f17eaf into master Nov 11, 2026
10 checks passed
@andimarek andimarek added this to the 27 milestone Nov 11, 2026
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.

2 participants