Repository navigation
Conversation
ABAP fences currently fall back to plaintext. This adds an isolated `abap` definition on the existing pattern helpers with a small linear scanner for comments and literals. It has no aliases, no new token classes, and no cross-language imports.
Context-aware behaviour: first-column `*` comments versus multiplication, `"` line comments, doubled-delimiter `'…'` and `` `…` `` literals, string templates whose `{ }` holes are tokenized as code, case-insensitive and hyphenated keywords (`CLASS-METHODS`, `START-OF-SELECTION`), field symbols, pragmas, and component selectors (`-`, `->`, `=>`, `~`) that keep keyword-like names plain. ABAP requires spaces inside expression parentheses and around operators, so a word touching a parenthesis is a call or declared name, and `-` or `/` inside names never become operators.
Deliberate limits: a variable named like a keyword (`value`, `length`, `key`) is highlighted as a keyword outside those positions, and templates end at a line break as in ABAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ABAP to the default entry and language barrel, with a size and benchmark profile, a representative fixture, docs tables, and a minor changeset. The all-language convenience entry grows from 17.68 KB to 18.94 KB gzip and its budget rises to 19.2 KB; core and existing selective profiles are unchanged. Most of the growth is the keyword list, which ABAP needs because it has no small reserved-word core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 86c7755 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ABAP fences currently fall back to plaintext. This adds an isolated
abapdefinition (no aliases), registers it in the default entry, and exposes it as a selective import (@tanstack/highlight/languages/abap). It uses the existingcollectPatternRangeshelpers with a small linear scanner for comments and literals: no new token classes, no new dependencies, no cross-language imports, and no changes to core or to existing language modules.Context-aware behaviour:
*comments in the first column versus multiplication, and"line comments'…'and`…`literals with doubled delimiters|…{ expr }…|, where the{ }holes are tokenized as codeCLASS-METHODS,START-OF-SELECTION)<fs>, pragmas##NEEDED, and class names before=>-,->,=>,~), which keep keyword-like names plain, for examplels_entry-typeupdate( … ),DATA(message)), and-or/inside names never become operatorsThe template scanner is iterative, so deeply nested templates cannot overflow the stack. A regression test tokenizes 50,000 nested holes in well under a second.
The branch is one commit for the module and tests, then one registration commit (default entry, barrel, size and bench profiles, fixture, docs tables, changeset).
Proposal: #35
Deliberate limits
value,length,key) is highlighted as a keyword outside the positions above. highlight.js behaves the same way.Validation
pnpm run verifypasses, including the newtest/abap.test.tsand a representative fixture intest/fixtures.ts. I also checked the output against a few hundred lines of real ABAP from static-analysis rule descriptions.Core + ABAP, local Node 24: 7.93 KB minified / 3.64 KB gzip / 3.27 KB Brotli, with a 3.8 KB gzip budget. Most of it is the keyword list, which ABAP needs because it has no small reserved-word core. Core and every existing selective profile are unchanged. The all-language convenience entry grows from 52.74 KB minified / 17.68 KB gzip to 56.13 KB / 18.94 KB gzip, and its budget rises from 18.0 KB to 19.2 KB gzip.
#36 (C) touches the same registration lines and size budget. Whichever merges second needs a small rebase.
🤖 Generated with Claude Code