-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Modules #111
Modules #111
Conversation
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.
This is a huge change, @tertsdiepraam, well done! Modules are going to make Roto even cooler.
} else if self.next_is(Token::Period) { | ||
let ident = self.identifier()?; | ||
let span = self.merge_spans(&expr, &ident); | ||
expr = | ||
self.spans.add(span, Expr::Access(Box::new(expr), ident)); |
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.
Quick question: how do you distinguish the expression foo.bar
from meaning "field bar
of object foo
" or "declaration bar
in module foo
"? Or does Expr::Access
work on modules too?
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.
Ah yeah that's an interesting detail. So a path can be both, but access is always a field. foo.bar
is parsed as a path, but (1 + 1).bar
is an access. The former is disambiguated by the typechecker.
Closes #91
To do:
.
)todo!
s with proper errors and make tests for those errors where necessary.