-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
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? |
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. |
A good method to detect R6RS is the #!r6rs annotation, but lots of Scheme programmers do not write this annotation:( |
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. |
@infininight Did you get a chance to look into this? Should we consider that support for R6RS is dropped? |
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 |
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). |
I would also like to see this merged. |
I support this getting merged. Is there anyone that can be contacted to speed things up? |
@sanssecours Could you help out a few fellow hackers? Do you have the access needed to merge this fix? |
Nope sorry, I only have write access to TextMate’s LaTeX bundle. |
@robsonpeixoto @infininight |
@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). |
Just a quick note to inform you, that Github now uses a different repository for its Scheme grammar. |
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.