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 function call #2609

Closed
jcubic opened this issue Oct 26, 2020 · 2 comments · Fixed by #2611
Closed

Scheme function call #2609

jcubic opened this issue Oct 26, 2020 · 2 comments · Fixed by #2611

Comments

@jcubic
Copy link
Contributor

jcubic commented Oct 26, 2020

Information:
Tested in https://prismjs.com/test.html#language=scheme

Description
first argument inside parentheses not always should be mark as function name

Example

'(foo bar baz)
`(foo bar baz)
#(foo bar baz)
'#(foo bar baz)

(NOTE: GitHub is also wrong about this).

in those cases first token should not be function. I think (not 100% sure) that you only need (?:$|\s|\()\( in front of the regex (maybe just in case (?:$|[()[\]\s])[([] to support brackets and open close before) that match function call if before parentheses is not space, bracket or beginning of the of the string it should not be marked as function call.

@RunDevelopment
Copy link
Member

I think the easiest solution here is to just disallow ['`#] characters before the (.

Btw. What are these examples? I know that the first one is a list but I've never seen the other three.

@jcubic
Copy link
Contributor Author

jcubic commented Oct 26, 2020

'(foo bar baz)  ;; quoted list same as (list 'foo 'bar 'baz)
`(foo bar baz)  ;; backquoted list that allow special tokens , and ,@ that evaluate the expression (unescape)
#(foo bar baz)  ;; vector like array in JavaScript
'#(foo bar baz) ;; this is similar as vector but symbols are quoted like with '(foo bar baz) without this foo bar baz need to be variable

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

Successfully merging a pull request may close this issue.

2 participants