You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throw an error.
We would detect duplicates and throw if we were to find one. Let the creator of the language decide how this case should be handled.
Remove duplicates from inside.
We remove all duplicates from the grammar of inside and then go on as usual. This ensures that new patterns are both at the correct position and not overwritten by old patterns.
Don't insert duplicates.
If we detect that a token of insert is also present in inside, we ignore it.
I personally prefer option number 2 because it's what I intuitively expected.
Right now, the documentation of
insertBefore
does not specify how the function behaves if the grammar ofinside
andinsert
have keys in common.Example
Let's assume the following language:
Now, we insert a new pattern for a existing token:
And in the other direction: (
Prism.languages.foo
as originally defined)The text was updated successfully, but these errors were encountered: