-
-
Couldn't load subscription status.
- Fork 1.3k
Introduce grammar patch from the simplify branch
#4019
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
base: v2
Are you sure you want to change the base?
Conversation
765068a to
29284d8
Compare
29284d8 to
35d6181
Compare
✅ Deploy Preview for dev-prismjs-com ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
538eaec to
3328581
Compare
Authored by: Lea Verou <[email protected]>
3328581 to
f1faac8
Compare
| return source; | ||
| } | ||
|
|
||
| return source ?? target; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this part to handle the $merge special property correctly. Before, it was target ?? source, and we couldn't merge numbers, strings, regexes, etc.
Summary
isObject(),isPlainObject(),deepMerge(),deepClone(),betterAssign(),insert(), andinsertAfter(). UpdateinsertBefore()accordingly.extend()to support new special properties ($insertBefore,insertAfter,$insert,$delete, and$merge) that allow defining grammars more declaratively and adding a newgrammarPatch()util (all authored by @LeaVerou). See [v2] Language combinations / extensions / embeddings / ... #3927 for details.Those are non-breaking changes. Corresponding changes to language definitions are in a separate PR.
This is part 2 of 3 in a stack made with GitButler:
simplifybranch #4019 👈languagesfrom thesimplifybranch #4016