Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

maxbrunsfeld
Copy link
Contributor

@maxbrunsfeld maxbrunsfeld commented Aug 22, 2019

⚠️ WIP ⚠️

Background

The entity.name.function.clojure rule 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 $self pattern 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

@maxbrunsfeld
Copy link
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.

@rsese
Copy link

rsese commented Aug 23, 2019

Hey @maxbrunsfeld! 👋

I'm gonna hold off on this for now

Sounds good, if you want a review just let us know ✌️

@vmg
Copy link
Contributor

vmg commented Aug 27, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants