PrismJS / PrismJS/prism

[v2] `$`-prefix special keys

Open
#3,912 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

We currently use a convention where we quote token names and leave predefined special keys (e.g. inside, greedy etc) unquoted, but that's a bit obscure, and it means that any code that handles grammars needs to maintain a list of special keys to figure out what the actual tokens are. Using a naming convention makes that very clear and gives us several benefits:

  • Code that handles grammars can figure out what is a token name without hardcoding all special keys
  • Token names and special keys can co-exist in the same object literal
  • Much more obvious what is what

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the grammar-handling code that distinguishes predefined special keys, then determine the scope for adopting a $ prefix and updating affected grammar data and consumers. Done should allow token names and special keys to coexist without maintaining a hardcoded special-key list.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.