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

The Scheme highlighter currently colors square parentheses as errors #3089

Closed
davorb opened this issue Jun 28, 2016 · 9 comments
Closed

The Scheme highlighter currently colors square parentheses as errors #3089

davorb opened this issue Jun 28, 2016 · 9 comments

Comments

@davorb
Copy link

davorb commented Jun 28, 2016

Here is an example of the undesired behaviour. I'm pretty sure that we would all be better off if you switched to the Racket-highlighter.

@Alhadis
Copy link
Collaborator

Alhadis commented Jun 28, 2016

Can you please explain this, then?

Figure 1

@larsbrinkhoff
Copy link
Contributor

larsbrinkhoff commented Jun 28, 2016

Apparently, some Scheme implementations permit using brackets instead of parentheses. Found this in a Scheme FAQ:

R5RS states that square brackets are "reserved characters". However, the standard does not specify what an implementation is supposed to do when encountering reserved characters. Thus, Schemes using the above convention [using brackets] are standards-compliant, but code written for them may not be readable by other implementations.

@pchaigno
Copy link
Contributor

This issue was already reported upstream (textmate/scheme.tmbundle#9). If they drop support for R6RS (which considers brackets as synonymous of parentheses), please reopen an issue (or this issue) and we'll discuss alternatives (and how to detect R6RS files in Linguist).

@soegaard
Copy link

@pchaigno Can we reopen this? Despite some effort textmate/scheme.tmbundle#9 has never been pulled.

@pchaigno
Copy link
Contributor

@soegaard Do you have an alternate grammar we could use for highlighting?

@soegaard
Copy link

Two options:

  1. I/We fork textmate/scheme.tmbundle and fix the square brackets
  2. I/We fork the grammar used for Racket grammar and make a Scheme grammar.

I prefer 2., but note that I am not impartial (I wrote the Racket grammar [1]).
In either case I would like to make a new repo for a Scheme grammar and
add some Schemers to the repo. Having people from the Scheme community
responsible for the repo, will make it much easier to fix bugs.

The current grammar used for Racket is [1]:
https://github.com/soegaard/racket-highlight-for-github
The list of current grammars in use:
https://github.com/github/linguist/tree/master/vendor/grammars

PS: While looking up the Racket grammar, I see the problem originates from 2014
(when Github switched the highlighter) #1717 )
So using a grammar repo backed by Schemers would be welcome change.

@soegaard
Copy link

@pchaigno @sorawee

Hi. sorawee and I have made an alternate grammar.
We made a fork of the current Scheme grammar.
Applied the pull request that fixes squares brackets:

Here is an example wherein you can see that square brackets are now colored normally.

https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fgithub.com%2Fsicp-lang%2Fscheme.tmbundle%2Fblob%2Fmaster%2FSyntaxes%2FScheme.plist&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fgithub.com%2Fnitinchandrol%2FBackgammon%2Fblob%2Fmaster%2Fproject%2Fproject.rkt&code=

/Jens Axel

@pchaigno
Copy link
Contributor

@soegaard Great! Could you open a pull request to change the grammar? See the appropriate contribution guidelines. I can help if needed.

@sorawee
Copy link
Contributor

sorawee commented Feb 26, 2019

@soegaard @pchaigno Here! #4437

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants