-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MOREL-202] Allow unbounded variables (
from
and join
without in
…
…), and remove `suchthat` keyword We remove `suchthat` because it is superfluous. Previously, `from e suchthat condition1 where condition2` would allow you to define a variable `v` and infer its bounded extent based on conditions, but after this change you can accomplish the same with `from e where condition1 andalso condition2`, and there may be even be intervening clauses. Following #208 `FromBuilder` should flatten nested `from` with tuple. Change type of `TuplePat.type` to `RecordLikeType`, because it is always `PrimitiveType.UNIT` or a `TupleType`. In `SuchThatShuttle`, infer extent of `x` from `where x = y.field`, and move `from y` forward if necessary. In `from x where condition`, `x` must be an identifier, or a list of identifiers such as `from x, y where condition`. With `suchthat` we allowed patterns such as `(x, y)`, `{x, y}`, but this makes no sense because we are doing no assignment, and the variables have no intrinsic order (except when composed into a record in the final `yield`). `FromBuilder` now checks that the type of the scan variable and extent are consistent. For example, in `from e in emps`, `emps` must be have a list type, and `e` must have the same type as an element of the list. Remove `suchthat` from parser and documentation, remove Op.SUCH_THAT, and remove dead code. Fixes #202
- Loading branch information
1 parent
77809e3
commit bfd37e8
Showing
34 changed files
with
2,132 additions
and
1,070 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
Oops, something went wrong.