8000 [v2] `$`-prefix special keys · Issue #3912 · PrismJS/prism · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[v2] $-prefix special keys #3912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LeaVerou opened this issue Apr 28, 2025 · 0 comments
Open

[v2] $-prefix special keys #3912

LeaVerou opened this issue Apr 28, 2025 · 0 comments

Comments

@LeaVerou
Copy link
Member

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
@LeaVerou LeaVerou added v2 and removed v2 labels Apr 28, 2025
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

No branches or pull requests

1 participant
0