-
-
Notifications
You must be signed in to change notification settings - Fork 806
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: implement "stateless" modules #3663
Merged
charles-cooper
merged 140 commits into
vyperlang:master
from
charles-cooper:feat/libraries
Dec 16, 2023
Merged
Changes from 130 commits
Commits
Show all changes
140 commits
Select commit
Hold shift + click to select a range
8a56425
feat: implement pure libraries
charles-cooper 0625bbb
fix topsort
charles-cooper 684a83d
fix a typo
charles-cooper 3ef38c4
introduce ModuleInfo
charles-cooper e3edb7e
fix a circular import
charles-cooper eca6379
change a docstring
charles-cooper bb37ee2
`at()` to convert ModuleT to InterfaceT
charles-cooper 2038549
fix a bug
charles-cooper 3f38b43
feat: module.at(<address>)
charles-cooper 2caaf9d
Merge branch 'master' into feat/libraries
charles-cooper aba6558
fix some bugs
charles-cooper febaa96
fix some tests
charles-cooper 19404e9
detect import cycles
charles-cooper 21a04c3
remove `.name` from module ast
charles-cooper 52943e1
abstract out a common exception rewriting pattern
charles-cooper 4a8cc12
remove a note
charles-cooper 0a786f7
rollback `module.at()` method
charles-cooper b61176e
fix some tests
charles-cooper 6c7f795
refactor builtin interfaces to `.vyi` files
charles-cooper c923714
wip: .vyi files
charles-cooper 924980a
implement ellipsis in interfaces
charles-cooper e9da1f2
whitespace
charles-cooper 4a3cfd2
fix getter generation in ABI
charles-cooper 6a7e603
rename "type" metadata to "func_type" on function declaration objects
charles-cooper 9171934
Merge branch 'master' into feat/libraries
charles-cooper 6c81142
fix some interface tests
charles-cooper e7e37b8
fix some more tests
charles-cooper 1b7162b
revert change enabling `Bytes[...]`
charles-cooper 26fb9e0
fix old usage of reachable_internal_functions
charles-cooper 1e2a235
fix another type error
charles-cooper c58bfa0
fix sqrt
charles-cooper 467720b
ensure _ir_info is populated whether or not functions are reachable
charles-cooper c6eba5e
fix a bad test
charles-cooper 9c537cc
fix some interfaces in tests
charles-cooper 25563f6
fix a bad type dispatch
charles-cooper 9838ad6
fix call to validate_semantics
charles-cooper 90731a2
fix InterfaceT.from_Module
charles-cooper a86cc02
set search path correctly in nested imports
charles-cooper 82cb5bd
fix some tests
charles-cooper 0a3d618
fix another small test
charles-cooper c6d8892
fix lint
charles-cooper 88843e9
fix some calls to validate_semantics
charles-cooper 2f739d0
fix mypy
charles-cooper 0ce2a58
add a todo
charles-cooper ba50a83
fix an old key
charles-cooper dc506a8
move test_interfaces.py to codegen/ tests
charles-cooper ecb3841
remove dead code
charles-cooper 5bb66b5
remove dead package pytest-rerunfailures
charles-cooper 3d5e3b1
add a note
charles-cooper ad78f07
remove dead function
charles-cooper 7ebd09c
refactor: move `parse_*` functions, remove vyper.ast.annotation
charles-cooper a0ff2b8
refactor: CompilerInput.from_string
charles-cooper 84a33db
implement eq/hash on ModuleT
charles-cooper 84f2298
remove dead comment
charles-cooper 21abfb6
fix some bad imports
charles-cooper 2a9db07
fix lint
charles-cooper 0b78923
remove `remove_unused_statements()`
charles-cooper 269a9cf
refactor cycle detection
charles-cooper b0ac484
remove expand_annotated_ast
charles-cooper a95000d
fix analysis on imported modules
charles-cooper 50f388e
small fixes
charles-cooper 9b5bff2
factor out parse_and_fold_ast
charles-cooper a43beff
fix mypy
charles-cooper 487e29b
fix global namespace
charles-cooper abbe697
fix generate_inline_function
charles-cooper 9509dc9
Merge branch 'master' into feat/libraries
charles-cooper fa4a30f
fix tokenization of comments in lark grammar
charles-cooper 292d085
rename storage layout test directory
charles-cooper 5b8847e
relax import restrictions
charles-cooper b26c00a
improve ModuleNotFound error
charles-cooper e4693a0
fix name/alias resolution
charles-cooper 93401f3
add library test to test_compile_files
charles-cooper 4295dcc
missing import
charles-cooper 373abd6
update interfaces output
charles-cooper 663dc1e
change function labels in IR
charles-cooper 7ac2f62
add a note
charles-cooper d297418
fix: use codegen.core._freshname to generate self call labels
charles-cooper 34b45c8
make compilation targets adhere to outputSelection
charles-cooper 5c0d3a7
use orderedset for json inputs
charles-cooper 9902baf
add library to json tests
charles-cooper 9bdf12c
remove dead code
charles-cooper 64f6840
fix lint
charles-cooper 42dfd2b
fix lint
charles-cooper ba11cff
fix a signature
charles-cooper c7ea5c9
disambiguate types with same name across different modules
charles-cooper 418eb97
fix some small bugs
charles-cooper e64b52c
update some hardcoded asm
charles-cooper f5ff470
fix unassigned variable
charles-cooper c86d267
fix lint
charles-cooper 0ac1043
make module argument optional for structs
charles-cooper 5ebb252
fix some updates to json cli api
charles-cooper d880e58
add libraries test file
charles-cooper 34052b0
roll back changes require threading around the module ast
charles-cooper 15ad3cc
fix lint
charles-cooper 91642f0
add InputBundle._normalize_path
charles-cooper 4db4928
rename ModuleInfo.module to ModuleInfo.module_t
charles-cooper 028d96c
fix source_id threading
charles-cooper 8d7a5dd
enrich CompilerInput
charles-cooper 0a37e1c
change compile_code api from contract_name= to contract_path=
charles-cooper 8b477eb
introduce source_id= back into compile_code
charles-cooper 64a5379
add compile_from_file_input
charles-cooper 39575e8
fix bunch of bugs in path resolution of imports
charles-cooper 9ef6ea7
fix compile for regular files
charles-cooper b64035d
add support for attribute access on modules/interfaces: structs and e…
charles-cooper 58940a0
allow string input to CompilerData
charles-cooper f34d7d1
remove ability to `implements: ModuleT`
charles-cooper be07dfd
fix small type bug
charles-cooper 88250cc
fix a bad function call
charles-cooper 183aada
fix a bug in _normalize_path
charles-cooper 0a84ef2
fix another bad function call
charles-cooper 3d2c95f
handle self calls in statements
charles-cooper 2e32ba8
fix transitive imports
charles-cooper 5476076
trap calls to external functions in libraries
charles-cooper bfde0cb
add more tests for libraries
charles-cooper 7aa80e3
new scheme for IR identifiers -- use function ID
charles-cooper 91c16e5
update selector table stability tests
charles-cooper 5a9eea7
fix asm tests
charles-cooper 59922f3
fix lint, mypy
charles-cooper a734b09
hygiene: raise proper exception
charles-cooper dd1ea14
test imported structs
charles-cooper c7584bd
add a couple more tests for libraries
charles-cooper 76f3abb
fix a regression
charles-cooper 48a76b4
handle some errors better
charles-cooper 1fafca6
fix mypy
charles-cooper a441e2f
remove a dead variable
charles-cooper 6e1a05e
update a test name
charles-cooper 94ff82b
change an argument name
charles-cooper 6edcbdd
reject duplicate imports
charles-cooper d9b9f3b
fix some tests
charles-cooper 0b64abe
rename test file
charles-cooper 255a93a
refactor: move InterfaceT into vyper/semantics/types/module.py
charles-cooper 9ec83d4
address review comments
charles-cooper 74c630e
remove unneeded F401
charles-cooper 132fde0
add library code eliminator test
charles-cooper 64bc3a5
make nested libraries work
charles-cooper dcb55b4
refactor a side effect
charles-cooper d26f401
fix missing import
charles-cooper bea05ca
add test for imported slice
charles-cooper 7066688
remove stray print
charles-cooper b0c6684
add a note on Module.__eq__
charles-cooper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We could just call this input_bundle, given it can be easily overridden in other tests.
Alternatively,
empty_input_bundle
might be clearer.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 interesting. well,
InputBundle()
is actually not fully functioning since it's a base class, it will raise exceptions if you try to use it: https://github.com/charles-cooper/vyper/blob/74c630ece2723cf24418acf9c635418ab2c2a461/vyper/compiler/input_bundle.py#L73-L77so i wanted to use it for tests which need an object of type InputBundle, but can never actually call into it.