Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix tokenization of sexp and map nested at beginning of another sexp #39
Conversation
|
Updated title and description to make it more clear that my change excludes ( and { from the function match entirely, not just at the very start. |
| @@ -274,7 +274,7 @@ | |||
| 'include': '#vector' | |||
| } | |||
| { | |||
| 'match': '(?<=\\()(.+?)(?=\\s|\\))' | |||
| 'match': '(?<=\\()([^\\(\\{]+?)(?=\\s|\\))' | |||
50Wliu
Mar 4, 2016
Member
\\{ can simply be {.
\\{ can simply be {.
pjago
Nov 23, 2016
How about a match for sets?
As in ;=> (#{:a :b} k)
How about a match for sets?
As in ;=> (#{:a :b} k)
|
This will need some specs. |
|
Specs aside, I think the same result can be achieved by adding the following above the {
'include': '#map'
}
{
'include': '#sexp'
}Would you consider this preferable to the current solution I've proposed above? I think it's more readable, but I'm not sure if using |
|
I think your new method would definitely be preferred. I'm not aware of there being any performance impacts with recursive rules - some other languages use them as well and are fine. |
|
I've redone my grammar change to use included patterns instead of modifying the function match. I've also added some specs for the improved tokenization. |
Fix tokenization of sexp and map nested at beginning of another sexp
|
Looks good, thanks! |
Fix tokenization of sexp and map nested at beginning of another sexp
Fix tokenization of sexp and map nested at beginning of another sexp

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I'm new to Clojure, but something that jumped out at me while learning in Atom was parentheses being colored as function characters if they immediately followed another parenthesis. As someone else mentioned in #35, this also happens when maps are used as functions.
I've made a small tweak to the
entity.name.function.clojurematch to exclude ( and { as function characters. I've included screenshots below of the syntax highlighting before and after my change.Before

After
