Repository navigation
for..in WIP - #671
for..in WIP#671jcdickinson wants to merge 1 commit into
Conversation
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| #[derive(Clone, Debug, Trace, Finalize, PartialEq)] | ||
| struct InnerForInLoop { | ||
| variable: Node, |
There was a problem hiding this comment.
This really smells.
I think we might need an AST node that can represent a single const, let or var. Thoughts?
There was a problem hiding this comment.
This will probably be really difficult for execution, too.
| /// Inner structure to avoid multiple indirections in the heap. | ||
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| #[derive(Clone, Debug, Trace, Finalize, PartialEq)] | ||
| struct InnerForInLoop { |
There was a problem hiding this comment.
I'm wondering if this should be IterableForLoop containing an enum (In, Of), because both are basically the same syntax and In is supposed to use an iterator internally (according to the spec).
There was a problem hiding this comment.
This would block this implementation on #576.
| Ok(ForInLoop::new(variable, object, body).into()) | ||
| } | ||
| Some(tok) if tok.kind() == &TokenKind::identifier("of") => { | ||
| Some(tok) if tok.kind() == &TokenKind::identifier("of") && can_iterate => { |
There was a problem hiding this comment.
Is TokenKind::identifier("of") a placeholder, or intentional? i.e. Should there be TokenKind::Keyword(Keyword::Of)?
|
Dropping in favor of the existing work done for #576. |
This Pull Request fixes/closes 670.
It changes the following:
for..insupport