-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 language issues #1451
Comments
It seems that numbers are correct and string regex don't match single quote string but symbols, so only function without arguments is not marked as function, will create PR. |
|
Found another 2 issues with scheme mode:
Example: (display (list->array '(1 2 3 "foo
bar
baz")))
(list 1 2 3) on GitHub multiline strings works and list->array don't have list highlighted (on GitHub scheme syntax function names are black)
|
I can create PR with the fix. Last one was not merged, @Golmote did you notice it? |
1 in |
I think that this do the trick for last number issue: /([\s()])[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?([\s()])/
|
@jcubic I want to close this issue with #2263 but I have two questions:
Can you please give an example with
An example of this one as well, please. Also, I changed your comments a bit, so that I could track which parts of the issue were already done. Please tell me in case I missed anything. |
I forgot to mention this: |
The for numbers the regex need to be I have no idea what the issue was with numbers without space. Numbers always need to have space, maybe this "(number? `10)" biwascheme return true for this even that it's quote. I think this can be ignored. |
Maybe rational numbers? Anyway, I'll just ignore it. |
Found another issue, rational numers literals are ok but not complex one: Some of them are marked as numbers other not: (list 10i +10i -10i 10.10i 10+10i 10.10+10.10i 10-10i 10e+10i 10+10e+10i) (the are all valid complex numbers acording to Kawa scheme intereter that I'm testing this agains). it can be ("+" "-") number ("+" "-") number "i", where number can be float or integer, float can use scientific notation and first 3 items are optional. I can help with regex since I'm now working on my Scheme interpreter in JavaScript and I also need to parse those correctly. |
Fixed this in #2263. I also removed the optional spaces around the [+-] linking the rational and imaginary parts of a complex number. |
Also, I found this grammar of Scheme numbers. Should Prism support this as well or is the current pattern sufficient? |
Those works in Kawa and Guile: (list #xAFD #b1110011 #o777) Guile is more compilant it have:
as inexact (float) hex, or #i#x10+10i float hex complex Guile also works with this: #b10+10i binary complex number. I think since Prism is not a parser I think that it would be ok to add:
|
I think I know what was the issue with numbers "10" is not marked as number. so beginning of regex need to be I can try update the regex and create unit tests. |
The |
Binary, octal, and hexadecimal numbers are now supported in #2263. |
#2263 is merged and I think it addresses all issues here. Feel free to reopen this in case I missed something. |
So I found few issues:
'
in scheme'
is for quote (you can quote names, which become symbols or lists) (Scheme: Improvements #2263)solution: remove
|'[^('\s]*
from string regex(lambda (foo bar) (concat foo bar))
foo is mark as function, I've try to came up with regex but was not able to find one. (Scheme: Improvements #2263)solution:
/(\()[^\s()]*(?=[\s)])/,
added(?=[\s)])
instead of(?=\s)
(fix function without arguments in scheme language #1463)numbers that don't have space before them are not marked as numberssolution: optional space in the beginning of number regex
(\s?|[()])
Wanted to create PR but don't know how to fix function with define and lambda.
The text was updated successfully, but these errors were encountered: