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

Scheme syntax is outdated #5612

Open
jcubic opened this issue Oct 21, 2021 · 5 comments
Open

Scheme syntax is outdated #5612

jcubic opened this issue Oct 21, 2021 · 5 comments

Comments

@jcubic
Copy link

jcubic commented Oct 21, 2021

Describe the bug

Scheme syntax highlighting doesn't handle #; syntax for S-Expression comment. And probably a lot of other new syntaxes. I think that the project sicp-lang/scheme.tmbundle (as the name of the org suggests) is really old, SICP was created in 1985, The latest spec of the Scheme langauge is from 2016.

Here is an example of a few modern syntaxes. expression comment, block comment, and symbol with parenthesis inside.

(let ((x #;(expression
             comment ")") 10)
      (|this is )))) symbol| 20))
   #|
    this is comment ))))
   |#
   (+ x |this is )))) symbol|))

You can execute this in a modern Scheme and it should evaluate to 30.

Expected behavior

I expect no errors from the modern Scheme.

Related discussion

Maybe it's worth finding something more up-to-date. I don't know if sicp-lang/scheme.tmbundle supports anything beyond SICP.

Additional notes

@jcubic jcubic added the Bug label Oct 21, 2021
@lildude
Copy link
Member

lildude commented Oct 22, 2021

Maybe it's worth finding something more up-to-date.

As you are familiar with this language and the expected syntax highlighting, you're in the best position to find a more apt grammar and submit a PR to update Linguist to use it (see CONTRIBUTING.md).

Relabelling as this isn't a bug in Linguist.

@Alhadis
Copy link
Collaborator

Alhadis commented Oct 22, 2021

Here is an example of a few modern syntaxes. expression comment, block comment, and symbol with parenthesis inside.

@jcubic Are you sure this is standard Scheme syntax, and not an implementation-defined extension? I only ask because I found no mention of #; in Scheme's formal grammar.

I know nothing of Scheme, so please correct me if I'm missing something.

@jcubic
Copy link
Author

jcubic commented Oct 22, 2021

R7RS small is the current latest standard of Scheme, it was published in 2015 with errata that was integrated into a single document here https://standards.scheme.org/unofficial/errata-corrected-r7rs.pdf

All things I've mentioned in the original issue are included in the R7RS spec.

@jcubic
Copy link
Author

jcubic commented Jan 3, 2024

What is the syntax that you use for the highlighting? I can see if I can create a proper one. Or fork the project you use, but I'm not sure which file do you use.

Also, note that even the old standard Scheme doesn't work right:

(car (cons 1 2))
;; ==> 1
(cdr (cons 1 2))

Only the first S-Expression is valid according to GitHub even though they are both correct.

@lildude
Copy link
Member

lildude commented Jan 3, 2024

What is the syntax that you use for the highlighting? I can see if I can create a proper one. Or fork the project you use, but I'm not sure which file do you use.

We use the grammar linked in https://github.com/github-linguist/linguist/blob/master/vendor/README.md

Also, note that even the old standard Scheme doesn't work right:

There is an ongoing issue with the upstream highlighting engine which is likely to be coming into play here. We're tracking it publically in #6668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants