-
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
Allow for simple import of other files #21
Conversation
@@ -241,6 +257,26 @@ public void reportContextSensitivity(@NotNull Parser recognizer, @NotNull DFA df | |||
} | |||
} | |||
|
|||
class ImportVisitor extends ManifoldBaseVisitor<Void> { |
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.
Didn't we have a plan to remove visitor classes (including ExpressionContextVisitor
) out of Main.java
and into their own files?
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.
Yes. This seems as good a place to do it as any.
importExpr #ImportExpression | ||
| rvalue #RValueExpression | ||
// | declaration | ||
; |
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.
Why do we need expression when it is only doing unit productions? Right now the semantics of expression are questionable. In what situations should we be treating import expressions and rvalue expressions interchangeably? For instance what is the meaning of using an import expression in a tuple value entry?
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.
My bad, I thought expressions weren't nestable. I'll hoist it to a statement
I also added the option of not adding the |
LGTM 🚀 Should probably get a second opinion, though. |
Basic implementation. Parses any files that are imported (regardless of position in the file since that doesn't really make sense) and combines their ExpressionGraphs together, then parses the file that included them. I may be able to make something similar to public/private work, but for now it's dumb.