Skip to content

fix: highlight Java binary integer literals - #43

Merged
exKAZUu merged 1 commit into
mainfrom
fix/java-binary-highlights
Oct 22, 2026
Merged

exKAZUu merged 1 commit into
mainfrom
fix/java-binary-highlights

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Why

The shipped highlight query leaves binary integer literals such as 0b101 unhighlighted, although equivalent decimal, hexadecimal, and octal literals receive @number captures.

Requirements

  • required: Improve our forked tree-sitter repository and all forked grammar repositories as much as possible, ignoring backward compatibility.
  • required: Prevent duplicates and open a dedicated PR from the latest main for each item that warrants resolution.
  • required: Run review-booster and complete-pr concurrently, then release to publish the changes.
  • chosen: Add the existing binary integer node to the numeric captures because the parser already recognizes it correctly; a query-only change fixes the omission without regeneration.

Customer Summary

Java binary integer literals receive numeric syntax highlighting, including uppercase prefixes, separators, and long suffixes.

Technical Summary

Add binary_integer_literal to the @number alternatives in queries/highlights.scm.

Testing

  • bun run verify passed, including type checking, linting, and code-gauge.
  • bun wb test test/unit/annotationTokens.test.ts test/unit/textBlockEscapes.test.ts test/unit/unicodeLiterals.test.ts: all 41 tests passed.
  • Executed the edited query through the published Java 10.0.0 Wasm parser and runtime 10.0.2: 0b101L, 0B1__01, 0xA, 42, and 017 all receive @number captures.
  • No new test was added for a static token-to-capture mapping.
  • PR CI passed on the pushed head, including full tests, Rust tests, three platform jobs, and fuzzing.

Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Oct 22, 2026
@exKAZUu
exKAZUu merged commit 16bc5cf into main Oct 22, 2026
10 checks passed
@exKAZUu
exKAZUu deleted the fix/java-binary-highlights branch October 22, 2026 16:48
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