Closed edemaine closed 2 months ago
I think we can add support for other positions in the future, but my thought was that everything else would end up being consumed by the pattern, so last position makes sense.
But we could have conditionals before is like
. For example, x? is like ...
could make sense as x? and x is like ...
, similar to how x? < y?
works now. Currently it matches the Boolean x?
which isn't terrible useful. Similarly, x < y is like ...
could make sense as x < y && y is like ...
.
UPDATE: Implemented!
Fixes #391
Most of this PR is code cleanup:
getPatternConditions
no longer requires a thirdconditions
argument; it starts as an empty array that gets returned.
feature)source/parser/ref.civet
to house ref helpersmakeRefAssignment
to ease creation ofhoistDec
andrefAssignment
maybeRefAssignment
=maybeRef
+makeRefAssignment
flatJoin
to ease combining expressions with&&
or||