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

Sequence of parser macros #12

Closed
jcubic opened this issue May 9, 2019 · 2 comments
Closed

Sequence of parser macros #12

jcubic opened this issue May 9, 2019 · 2 comments
Labels
bug Something isn't working resolved

Comments

@jcubic
Copy link
Collaborator

jcubic commented May 9, 2019

with this code:

(define-symbol-macro (# arg)
  "#(1 2 3)

   Parser macro for defining arrays."
  `(list->array (list ,@arg)))

(define-symbol-macro ({} expr)
  "(make-object :name value)

   Macro that create JavaScript object using key like syntax."
  (object-expander expr))

there is problem while executing:

#({}(:foo 10))

The problem probably is with this:

lips.parse(lips.tokenize('`(1 ,(:foo 10))'))[0].toString()
"(quasiquote (1 (unquote (:foo 10))))"
lips.parse(lips.tokenize('`(,(:foo 10))'))[0].toString()
"(quasiquote (unquote (:foo 10)))"

second code should give list with single value:

(quasiquote ((unquote (:foo 10))))
@jcubic
Copy link
Collaborator Author

jcubic commented May 9, 2019

lips.parse(lips.tokenize('`,(:foo 10)'))[0].toString()
"(quasiquote (unquote (:foo 10)))"

it seems that the parenthesis is swallowed.

jcubic added a commit that referenced this issue May 9, 2019
@jcubic
Copy link
Collaborator Author

jcubic commented May 9, 2019

There was also issue when parsing:

`(+ ,,(list 'foo))

'foo was breaking the parser

@jcubic jcubic added bug Something isn't working resolved labels May 9, 2019
@jcubic jcubic closed this as completed May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

1 participant