This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Remove recursive expression matching within function names#86
Open
maxbrunsfeld wants to merge 1 commit into
Open
Remove recursive expression matching within function names#86maxbrunsfeld wants to merge 1 commit into
maxbrunsfeld wants to merge 1 commit into
Conversation
Contributor
Author
|
I'm gonna hold off on this for now, because I think that we may be able to fix the bug in the highlighting engine so that it can handle this rule better. |
|
Hey @maxbrunsfeld! 👋
Sounds good, if you want a review just let us know ✌️ |
|
We've decided to fix the parser itself: although it doesn't look like the existing rule in the Clojure grammar is valid, we'd rather fix the parser so it doesn't choke on these bad grammars. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Background
The
entity.name.function.clojurerule matches function names: within a S-expression, it matches the entry right after the opening parenthesis. Currently, once a function name is matched, we recursively try to match for other expressions within the function name.Problem
In GitHub.com's TextMate highlighting engine, this recursion is somehow preventing us from matching the end of the outer S-expression, leading to deeper and deeper nesting as we encounter more and more parenthesized S-expressions.
Drawbacks
Atom works fine with this Grammar. VSCode also works fine with the same grammar. This makes me thing there is a bug in our TextMate engine, but I haven't investigated deeply.
On the other hand, I don't understand why we would need to match syntactic structure within a function name. Maybe this is to handle namespaced symbols?
/cc @hanjos because you added this rule in #13. Could you explain the purpose of the
$selfpattern that I am removing here? I am guessing that there's a good reason for it; I'm just trying to work around some problems we're seeing./cc @jhawthorn @vmg @kivikakk