-
Notifications
You must be signed in to change notification settings - Fork 7
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
Parse quote characters #13
Conversation
Yirmandias
commented
Jul 29, 2021
•
edited
Loading
edited
- Modification of the parse function to support quote, quasiquote and unquote characters.
- Modification of enum Token:
- Modification of the function tokenize to support new kind of Token.
- Modification of read to transform new tokens into corresponding symbols and construct and SList containing the quote expression.
Clippy errors are likely due to the release of Rust 1.54 that has new clippy rules automatically picked up by CI. I have addressed them in master and you can simply rebase. |
planning/src/parsing/sexpr.rs
Outdated
Ok(SExpr::List(SList { | ||
list: es, | ||
source: src.clone(), | ||
span: Span::new(*start, *start), //TODO: find a way to declare the span |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to fix this and the the tests for contextual display.
My intuition is that the span should finish at the end of e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function to get the end of e
returns a Loc object.
e.loc().end() -> Loc.
From this Loc we cannot get the end Pos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, you need e.span.end
.
span
is private is this case but you can add an accessor for the start and end Pos
of a Loc
bail! -> unreachable!
a808267
to
855824b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. There are just 3 minors changes I commented on.
At this point it might be good to split the Atom between a String, a symbol and a number. This could be done in another PR however.