path: root/parse/ops.def
AgeCommit message (Collapse)Author
2018-07-19Support direct tuple access operators "tuple.N"Quentin Carbonneaux
This patch adds tuple access expressions. If t is a tuple, its N-th component can be retrieved with the syntax t.N. Of course, the components are zero indexed. I believe the code also works if 't' is a pointer to a tuple (but I have not checked this).
2018-03-13Merge branch 'autoexpr' into libmathS. Gilles
2018-03-06Add ternary operator.Ori Bernstein
2018-01-26New auto operator.Quentin Carbonneaux
Summary: -------- During the Myrcon in September Ori suggested an 'auto' operator that would evaluate what it applies to, store the result in a temporary t, and call __dispose__(t) when the current block exits. This patch implements this idea under the form of a unary operator. This, for instance, allows to have: impl disposable regex# = __dispose__ = {r;} ;; regex.exec(auto std.try(regex.compile("")), "foobar") Like before, it is guaranteed that __dispose__ is called in reverse order of auto appearance. Backward compatibility: ----------------------- Nope. Auto variables are now gone. This should not be a problem, simply rewrite: var auto x = foo() into: var x = auto foo() Implementation: --------------- It largely reuses the code I had written for 'auto' variables but needs a little finer grain tracking because we don't always want to call __dispose__ for *all* auto expression results when leaving a block (some might not be evaluated yet). For example: auto 1 if b -> void ;; auto 2 Only __dispose__(1) must be called when '-> void' is executed. If the block falls through, __dispose__(2) and __dispose__(1) will be called in sequence. TODO: ----- - Err when goto jumps in/out of a block that has auto expressions. - Support auto in patterns. match ... | `std.Some (auto x): ... is essentially rewritten to: match ... | `std.Some (auto x): auto x ... - Test edge cases (e.g., auto in loop condition) Actually, test. Cheers,
2016-01-26Remove the '$' shorthand for end of array.Ori Bernstein
2015-11-06Add support for '$' operator.Ori Bernstein
2015-10-19Work towards better match statements.Ori Bernstein
Generate decision trees from mi/match.c. Still slightly broken, so not enabled.
2015-09-27Add indirect call operator.Ori Bernstein
This should allow us to split up direct calls and environment calls. Currently, it doesn't actually do anything.
2015-07-05Add proper support for a 'gap' variable.Ori Bernstein
'_' is now a reserved token.
2015-07-05Improve error messages.Ori Bernstein
2015-05-08Use before def checking is closer to working.Ori Bernstein
Reduce spurious errors.
2015-05-07Add 'undef' operator.Ori Bernstein
Marks values as undefined, useful for reaching defn dummy analysis.
2015-05-06A huge amount of work on checking.Ori Bernstein
We now check for return types, and have a partly fleshed out use-before-def analysis.
2015-05-06Compile error on reaching end of func without return.Ori Bernstein
2015-02-07Fix typo in op strings.Ori Bernstein
2015-01-25Clear structs.Ori Bernstein
When creating stack structs, clear them. TODO: only clear uninitialized values.
2015-01-06Improve error messages.Ori Bernstein
This involved lots of table changes.
2014-11-10Operator shuffling.Ori Bernstein
Preparation for better compilation of match statements.
2014-09-22Fix flt32<->flt64 casts.Ori Bernstein
2014-01-20Correctly handle signed/unsigned comparisons.Ori Bernstein
2014-01-14Add support for break/continue in loops.Ori Bernstein
Yeah, I resisted until now. Oh well.
2013-12-29More principled FP support started.Ori Bernstein
2013-09-25Closer to floating point support.Ori Bernstein
2013-06-18Move away from literal types that aren't actual compile time constants.Ori Bernstein
2012-08-18Change 'cons' to 'ucon', add uget.Ori Bernstein
Makes it clearer what operators act on unions.
2012-08-15We don't need the load instruction.Ori Bernstein
2012-08-05Squash indirection bugs.Ori Bernstein
2012-07-27Make truncating casts not broken.Ori Bernstein
2012-07-23Ostor must ALWAYS write through the pointer.Ori Bernstein
Ostor(Ovar(name), ...) will no longer write to the variable, but through it. This is needed to make indirections work. What was I smoking?
2012-07-16Move away from literals for tuples.Ori Bernstein
2012-06-24Add parsing for union constructors.Ori Bernstein
2012-06-07Add blit operator.Ori Bernstein
For copying around structs/slices/anything that doesn't fit into a register.
2012-06-06More work towards working slices.Ori Bernstein
Implement more operators, don't error out as early.
2012-06-06Don't generate function calls too many times.Ori Bernstein
We used to return the subtree of impure stores. Don't do that.
2012-05-07Improve instruction selection.Ori Bernstein
Fix selection of loads and stores a bit.
2012-03-09The backend now compiles.Ori Bernstein
It's still nowhere near working.
2011-12-14Start stubbing in inference.Ori Bernstein
2011-11-05Initial commitOri Bernstein