-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: event exports #25
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.
More logic changes than I would expect to see given the linked issue
@@ -167,7 +167,7 @@ pass_stmt: _PASS | |||
break_stmt: _BREAK | |||
continue_stmt: _CONTINUE | |||
|
|||
log_stmt: _LOG NAME "(" [arguments] ")" | |||
log_stmt: _LOG (NAME | variable_access) "(" [arguments] ")" |
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.
Was this not failing before?
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.
no, previously only log Event()
was allowed
@@ -728,6 +728,10 @@ def validate(self): | |||
class Log(Stmt): | |||
__slots__ = ("value",) | |||
|
|||
def validate(self): | |||
if not isinstance(self.value, Call): |
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.
Is there a test that covers this?
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.
yea, it's in the structure exception tests somewhere
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.
hmm, i thought i saw it before but maybe i hallucinated, so i added one here 9ed427f
add `exports:` declaration to the language. this allows users to directly export functions marked `@external` from libraries instead of writing `@external` wrapper functions (and consequently, for library authors to define the external interface for their modules). important refactors: - remove expanded getters from module AST, change them to annotation on public VariablDecls. - redo order of node visitation in ModuleAnalyzer - refactor `InterfaceT.validate_implements()` to handle exported functions - add `exposed_functions` property to `ModuleT` which reflects the runtime functions exposed in the selector table - refactor IR generation to use new reachability analysis misc: - remove Module.add_to_body, Module.remove_from_body as they are dead now - move VariableDecl validation to vyper/ast/nodes.py - improve call-site annotations for error messages - improve annotations for exceptions which reference a previously- declared node.
- improve call graph analysis - called_functions and reachable_internal_functions start out as None - move analyze_call_graph into standalone function instead of method - tinker with _add_exposed_function to ensure we have all exposed functions by the time we get to ImplementsDecl
rely on analysis, not declared events
change the event member names in the builtin interfaces
rename a test file
This reverts commit 0747a5c.
b2ba9e6
to
dde7d81
Compare
What I did
clean diff
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture