Skip to content
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

Fix #6 (square brackets are highlighted as errors) #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #6 (square brackets are highlighted as errors) #9

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 3, 2016

This is my fix for #6 (square brackets are highlighted as errors)

Test result on Github's Lightshow

I've only tested this using Github's Lightshow because I don't have a copy of TextMate.

@infininight
Copy link
Member

The most recent scheme spec I find lists square brackets as reserved for future use so the invalid highlighting seems to fit. Is there some reason they should be allowed somewhere?

@infininight
Copy link
Member

OK, here is where my confusion comes in. In R5RS square brackets are listed as reserved, in the newer R6RS they are listed as synonymous with parenthesis. However in the even newer still R7RS they are again listed as reserved. Not sure where this leaves there usage. :)

I'm going to take a look at various scheme language grammars to see if there are some general improvements that can be made to the language. I don't like the solution of simply making them not illegal, if they are legal in some cases they should be matched correctly for scoping purposes. But will have to figure out the contexts they can appear in to do that correctly.

@ghost
Copy link
Author

ghost commented Feb 12, 2016

A good method to detect R6RS is the #!r6rs annotation, but lots of Scheme programmers do not write this annotation:(

@ghost
Copy link
Author

ghost commented Feb 22, 2016

The R7RS explicitly allows extensions to its lexical syntax and procedures, so implementations of the R7RS are free to extend the read procedure to accept R6RS lexical syntax as well as R7RS syntax. So, square brackets can be valid even in R7RS Scheme.

@pchaigno
Copy link

@infininight Did you get a chance to look into this? Should we consider that support for R6RS is dropped?

@wasamasa
Copy link

I considered opening a PR for this just to discover that it had already been made. There are a bunch of Scheme implementations where brackets can be used interchangeably with parentheses, such as CHICKEN, Guile, Racket, Gauche, Sagittarius and Larceny. In Kawa, brackets quote their contents (and are therefore not illegal). Others like Chibi, MIT-Scheme and Picrin don't support brackets at all and error out if you try evaluating [+ 1 1]. I therefore consider brackets as a piece of syntax implementations may use as they see fit and would like for this limitation to be lifted.

@melted
Copy link

melted commented Mar 9, 2018

The highlighting of square brackets impedes the readability of a lot of code on Github, like the Chez sources (example: https://github.com/cisco/ChezScheme/blob/fb9f854d449ee96cccb63a12629a729046f0bee1/s/5_1.ss#L35).

@gwatt
Copy link

gwatt commented Dec 1, 2018

I would also like to see this merged.

@soegaard
Copy link

I support this getting merged.

Is there anyone that can be contacted to speed things up?

@weinholt
Copy link

@sanssecours Could you help out a few fellow hackers? Do you have the access needed to merge this fix?

@sanssecours
Copy link
Member

@sanssecours Do you have the access needed to merge this fix?

Nope sorry, I only have write access to TextMate’s LaTeX bundle.

@soegaard
Copy link

@robsonpeixoto @infininight
You seem to be the last committers in this repo.
Could you pull this PR?

@sorawee
Copy link

sorawee commented Feb 22, 2019

@sorbits , could you pull this PR? It's been three years, and it's really painful to read code with erroneous syntax highlight (see https://github.com/racket/racket/blob/master/racket/src/cs/rumble/define.ss for instance).

@soegaard
Copy link

Just a quick note to inform you, that Github now uses a different repository for its Scheme grammar.
It would still be a good idea to merge this commit into TextMate - but at least Scheme now looks
okay on Github.

jeandeaual added a commit to jeandeaual/vscode-scheme that referenced this pull request Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants