forked from tuplex/tuplex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add preliminary support for iterators and built-in iterator…
… functions (tuplex#25) Add support for builtin iterator functions `iter, zip, enumerate, next, reversed`. Fix bug when calling `len` on an empty list `[]`. Add support for multiple identifiers in loop, e.g. `for a, b in (t1, t2), (t3, t4)` Details: - Add iterator type and related functions for typing - Add symbol for iterator-related functions (iter, zip, enumerate, next, reversed) - Add iterator-specific annotation - Add iterator-related helping functions in LLVMEnvironment - Fix getListType for list of tuples - Refactor code refactoring for error handling for unsupported types - Refactor code for error handling for unsupported types - Add iterator core class - Add functions for creating iterator-related calls in FunctionRegistry - Fix the case when expression (also called testlist) in for loop contains multiple elements, i.e. "for a, b in (t1, t2), (t3, t4)" should work now - Update BlockGeneratorVisitor 1. Update visit NCall, declareVariables, assignToSingleVariable to make iterator related calls work 2. Fix codegen for list of tuples 3. Add support for for loops with iterator as expression - Use fallback mode for mixed AST node types in for loop exprlist for now - Add tests about iterators - Fix len() call on EMPTYLIST - Fix bug in UnrollLoopsVisitor. Add tests authored by: Yunzhi Shao (yunzhi_shao@brown.edu)
- Loading branch information
1 parent
be085b3
commit b0a7d35
Showing
29 changed files
with
3,211 additions
and
167 deletions.
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
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.