-
Notifications
You must be signed in to change notification settings - Fork 4
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
Rework Collections for Expect
and Name
#439
Commits on Jan 9, 2023
-
[ci skip] Add substitution of names
Remove the collection Expect construct. Instead, we use generics now and substitution of generics to deal with unification of collections. - Ignore collection type in output - Make temporary variables top-level Need to augment the unification rule for types a bit. If generics match and any generic is temporary, these must be substituted as well.
Configuration menu - View commit details
-
Copy full SHA for d7eb8fe - Browse repository at this point
Copy the full SHA d7eb8feView commit details -
Configuration menu - View commit details
-
Copy full SHA for bd7082f - Browse repository at this point
Copy the full SHA bd7082fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 90d135d - Browse repository at this point
Copy the full SHA 90d135dView commit details -
[ci skip] Create two constraints for every col
- __iter__() call, which gives iterator. We constrain this using a temporary type - __next__() call, whose return type is constrained to the collection type
Configuration menu - View commit details
-
Copy full SHA for cbe1add - Browse repository at this point
Copy the full SHA cbe1addView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64d7029 - Browse repository at this point
Copy the full SHA 64d7029View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c9f674 - Browse repository at this point
Copy the full SHA 0c9f674View commit details -
[ci skip] Get rid of weird Generic NodeTy
Need to generalize how we convert mamba types to Python types in generate stage. In particular: - When encountering types in the wild - When encountering constructors in the wild And _only_ in those situations so we don't accidentally change identifiers with say class names.
Configuration menu - View commit details
-
Copy full SHA for ae06d7f - Browse repository at this point
Copy the full SHA ae06d7fView commit details
Commits on Jan 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 6ef10db - Browse repository at this point
Copy the full SHA 6ef10dbView commit details -
Also get rid of tuple construct
Makes unification logic much simpler.
Configuration menu - View commit details
-
Copy full SHA for 6d534f0 - Browse repository at this point
Copy the full SHA 6d534f0View commit details -
Now easier to check whether something callable or tuple. Also simply generate by not looking at type annotations, except for class arguments. We are now dependent on the check stage to annotate variables
Configuration menu - View commit details
-
Copy full SHA for e5d6cbd - Browse repository at this point
Copy the full SHA e5d6cbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7beaa09 - Browse repository at this point
Copy the full SHA 7beaa09View commit details -
[ci skip] Match generics when checking parent
When looking up classes in context, we convert generic parents to concrete parents (in the form of StringNames). So, Collection[Int] is a super of Set[Int]: - Set has a parent Collection[Int] - We check that Collection[Int] is super of itself: - The first part is equal to itself. We also see that it has the same amount of generics as itself. - We proceed to perform this now for each generic by matching them.
Configuration menu - View commit details
-
Copy full SHA for e471732 - Browse repository at this point
Copy the full SHA e471732View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45d4cb3 - Browse repository at this point
Copy the full SHA 45d4cb3View commit details
Commits on Jan 11, 2023
-
Rework identifier matching with ty, expr
We added extra logic to deal with: - tuple literals - streamlining of tuples of identifiers Tuple matching still trips up when not matching with tuple literals. Perhaps we do need some logic in the unification stage, but this should be a last resort.
Configuration menu - View commit details
-
Copy full SHA for 77a087d - Browse repository at this point
Copy the full SHA 77a087dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad2cbad - Browse repository at this point
Copy the full SHA ad2cbadView commit details -
[ci skip] Recursively deconstruct builders
Also match identifier with any expression if no type present.
Configuration menu - View commit details
-
Copy full SHA for 72981c9 - Browse repository at this point
Copy the full SHA 72981c9View commit details
Commits on Jan 12, 2023
-
And remove unnecessary push_ty in unify_ty.
Configuration menu - View commit details
-
Copy full SHA for 38e9a51 - Browse repository at this point
Copy the full SHA 38e9a51View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9fbb6b - Browse repository at this point
Copy the full SHA e9fbb6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 46ba1ba - Browse repository at this point
Copy the full SHA 46ba1baView commit details -
Add extra __str__ rule to unify stage
For tuples we make an exception by iterating over the elements and checking that they each define __str__(). Also add extra rule for self. In union, self is always equal to entity_name. Other arguments are left as-is.
Configuration menu - View commit details
-
Copy full SHA for 896cf25 - Browse repository at this point
Copy the full SHA 896cf25View commit details -
Ensure nested Unions to_py deterministic
Should restructure name such the Name can have nested unions.
Configuration menu - View commit details
-
Copy full SHA for aaf2c25 - Browse repository at this point
Copy the full SHA aaf2c25View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7ff495 - Browse repository at this point
Copy the full SHA a7ff495View commit details -
Configuration menu - View commit details
-
Copy full SHA for c83cb10 - Browse repository at this point
Copy the full SHA c83cb10View commit details
Commits on Jan 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for cb8fb18 - Browse repository at this point
Copy the full SHA cb8fb18View commit details