-
Notifications
You must be signed in to change notification settings - Fork 16
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
Local/GlobalState custom keys & descriptions #111
Merged
Merged
Conversation
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
- allow module constants args, and in args to urange within - handle negatives - check for third arg to urange being non-zero to avoid crash - allow just a single urange call - allow list exprs - add tests for the above and tests for failure cases start on state reservation add stubs for state key & descriptions
…stant ordering issue
- remove unused `module_asts` on ASTConversionContext - convert ALLOWED_OCA list to frozenset - add/remove/address some TODOs - simplify FunctionASTConverter.visit_assignment_stmt a bit
…t we can choose a better encoding when e.g. combining constants in optimisation
…gnarly to plumb this through everywhere, and given the lack of uproar over ruff's complete lack of handling of non-utf8 files astral-sh/ruff#6791, we can just warn about it instead. the only potential negative effects are that the bytes on disk in the python file for something like a LocalState that takes it's key from the member name, might not match exactly what's in the TEAL file (and thus on chain). - refactor to slightly reduce mypy dependencies in ParseResult - pull out component orderding and checking to the parse level - construct read_source directly and add caching at the top level
robdmoore
reviewed
Mar 1, 2024
tristanmenzel
approved these changes
Mar 5, 2024
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.
LGTM
- remove unrequired `attrs.field()`'s - add auxiliary constructor to CheckedMaybe to build from tuple items
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add the ability to specify a custom
key
and/or provide adescription
forLocalState
andGlobalState
objects. The resolution of a member name to the key has thus been deferred to the IR phase. To support this, additional nodes have been introduced for dealing with state keys by member name, which has also allowed for an approach that significantly improves the generated code in certain cases.Solve the issue of requiring module level constructs (such as constants) to come before their usage
scratch_slots reservation fixes:
urange
withinurange
being non-zero to avoid crashurange
callFixes a bug where types declared in other modules wouldn't work on import.
Check file encodings and warn if it's not UTF-8.
Fix potential issue with TemporaryAssignmentExpressionBuilder not being picked up as a value.
Add "unknown" bytes encoding for raw bytes. default to hex output, but we can choose a better encoding when e.g. combining constants in optimisation (will be addressed in another PR).
Don't generate code/calls to an empty
__init__
function (todo in another PR: remove all empty function calls, and remove unreferenced functions after optimisation).