-
Notifications
You must be signed in to change notification settings - Fork 9
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
Single quote bug in parse-result #69
Comments
Eclector constructs a concrete syntax tree (CST) - nodes of the tree correspond to parts of the input (which part of the input a particular result corresponds to is indicated by the For For Maybe I'm not understanding your report correctly, but at the moment, I don't see the bug. |
My impression from the documentation was that the parse-tree package is intended to be lower-level than CSTs and to leave the question of what is constructed to the client. It is at least very surprising that So if I understand it correctly now, "children" is not children in a tree-ish sense, but precisely and only the result of recursive reads? |
Yes, it should be up to the client, though in my understanding CSTs are the lower-level concept (compared to ASTs). The result protocol is intended to not tie Eclector to one particular result representation. concrete-syntax-tree, the library, is just one way to make a client and implement the protocol.
Currently, the "tree" is formed by recursive (eclector.parse-result:read-from-string (make-instance 'trivial-parse-result) "#-(and) 1 2")
(:RESULT 2 :CHILDREN
((:RESULT (:AND) :CHILDREN ((:RESULT :AND :CHILDREN NIL)))
(:RESULT NIL :CHILDREN NIL))) does not contain anything representing (defmethod eclector.parse-result:make-skipped-input-result
((client trivial-parse-result) stream reason source)
(list :skipped :stream stream :reason reason :source source)) changes the result to
i.e. one additional child for the skipped I'm open to (and actually plan to) changing the rules for composing the results into a tree, but I don't see a good way to add additional results that do not correspond to recursive |
Thank you for the explanation. I no longer think the current behavior is wrong, just surprising, and it might be worth dwelling on at greater length in the documentation. |
I will try to improve the documentation, maybe after settling on a way of composing skipped and "proper" results. |
* Main change: When *READ-SUPPRESS* is true ECLECTOR.PARSE-RESULT:READ{-PRESERVING-WHITESPACE,-FROM-STRING} return what MAKE-SKIPPED-INPUT-RESULT returned instead of NIL. * This removes two kinds of bogus results that were previously returned: 1) Bogus NIL children around non-toplevel skipped input due to *READ-SUPPRESS*. 2) An "orphan" result corresponding to toplevel skipped input due to *READ-SUPPRESS*. This result is now returned as the primary result as described above. In particular, this gets rid of the bogus results mentioned in #69.
When using
parse-result
, the symbolquote
does not appear as a child of the expression when using the single-quote reader macro.Minimal example:
If you write out
quote
you get one result:But if you use a single quote you get a different result:
The text was updated successfully, but these errors were encountered: