summaryrefslogtreecommitdiff
path: root/parse/infer.c
AgeCommit message (Collapse)Author
2019-04-28Fix float conversions in casts.Ori Bernstein
We were dropping the intness, and didn't registerize the args to comisd.
2019-04-12Rename traits correctly.Ori Bernstein
2019-03-14Get a bit better at wrangling type bindings.Ori Bernstein
2019-02-28Fix type substitution in sizeof.Ori Bernstein
2019-02-26Accept that `file` isn't a node.Ori Bernstein
Shrink node sizes, simplify code a bit.
2019-02-26Add support for `__fini__` functions.Ori Bernstein
2019-02-18We don't need the last array, just the count.Ori Bernstein
Fixes #187
2019-02-16Clean up redundant code.Ori Bernstein
2019-02-10Pass the type envs through properly in delayed unification.Ori Bernstein
2019-02-10Work towards removing the streq check.Ori Bernstein
2019-02-09Work towards removing the streq check.Ori Bernstein
2019-02-07Fix declaration of mktraitmapOri Bernstein
2018-10-27Not all arrays have defined sizes.Ori Bernstein
2018-10-15Disallow negative array sizes. And do some cleanup.Ori Bernstein
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-07-18Top level anonymous unions may not have their type set.Ori Bernstein
2018-07-14Fix stupid mistake.Ori Bernstein
2018-07-14Push down named unions types into union tagsOri Bernstein
Currently, union tags are given the type of their enclosing union, by default: type u = union `Foo ;; var x = `Foo will currently infer the variable 'x' as having type 'union `Foo ;;'. To make the type of 'x' infer as 'foo', the code needs to force 'x' to unify with something that is explicitly declared as a 'u'. This change makes it so that union tags declared in the manner above will default to type 'u', instead. This is a special case, but it makes the behavior less surprising.
2018-07-04Fix infinite recursion in type inference.Ori Bernstein
2018-06-09Consistently and corretly add Oundef.Ori Bernstein
2018-04-18Merge remote-tracking branch 'ori/master' into HEADS. Gilles
2018-04-17Don't mutate the traits on builtin types.Ori Bernstein
mktylike() should return a generic type based on the builtin, and that means that if we mutate the builtin, we will be adding traits to our literals. This is wrong on multiple levels. First off, it means that '@t :: numeric,integral @t' will now require whatever other types are implemented over literals. And second, it means that if, for example, a trait is implemented for flt64, flt32 literals will also need it.
2018-04-17Remove stray ',' from error message.Ori Bernstein
2018-04-08Add support for `-T` option to compile in test mode.Ori Bernstein
Tests can now access hidden declarations.
2018-03-25Make output buffers bigger.Ori Bernstein
Shuts up warning on GCC 8.
2018-03-13Merge branch 'autoexpr' into libmathS. Gilles
2018-03-06Add ternary operator.Ori Bernstein
2018-02-18Resolve the impl() type.Ori Bernstein
2018-01-31Check that if we default to int, all necessary traits are there.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.free(r)} ;; regex.exec(auto std.try(regex.compile("f..bar")), "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,
2018-01-25Improve error message.Ori Bernstein
2018-01-17Hack in seqaux.Ori Bernstein
It's not perfect, and the right solution would be to keep a trait->aux mapping, but for now it works good enough.
2018-01-17Only set the base type on iter traits.Ori Bernstein
2018-01-17Infer after generating init functions.Ori Bernstein
Pull out the usefile loading, so we can call it separately from inference. Then shuffle the infer() call to after we generate init().
2018-01-14Remove a global-global.Ori Bernstein
Now it's static.
2018-01-14Pass in the context node to our error printing..Ori Bernstein
2018-01-14Fix binding of type env in traits.Ori Bernstein
2018-01-14Unify with the existing iterator.Ori Bernstein
2018-01-13Add code to fix up iterators.Ori Bernstein
2018-01-13Clean up iterator unification.Ori Bernstein
2018-01-11Get closer to typechecking generic args correctly.Ori Bernstein
2018-01-11Fix how we bind types.Ori Bernstein
Now we accept most valid programs, and reject most invalid ones.
2018-01-11Try harder to specialize. Still some bugs.Ori Bernstein
2018-01-11Move to new trait syntax.Ori Bernstein
2017-12-30Clean up some more dead code.Ori Bernstein
2017-11-28Remove impossible checks.Ori Bernstein
None of the removed variants on syntax trees should be possible in a working compiler.
2017-11-28Allow local variables to shadow namespaces.Ori Bernstein
It means you can't access the namespace in that scope, but it also means that we don't get the weird behavior that the undotted name refers to the variable, but the dotted name refers to the namespace. Fixes #158
2017-11-05Accept the globalness of file.Ori Bernstein
2017-10-29Fix traits when exported cross-namespaces.Ori Bernstein
2017-10-19Push the env before specializing the proto type.Ori Bernstein