| Age | Commit message (Collapse) | Author | Lines |
|
|
|
the recv syntax.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Change ty_fn to have a controlflow field. A 'controlflow' is
essentially a bit of data that says whether or not this function
never returns to the caller (if it never returns, that means it calls
"fail" or another "never-returns" function on every control path).
Also add syntax for annotating functions that never return:
fn foo() -> ! {
fail;
}
for example. Functions marked with ! implicitly have a result type of
ty_bot, which is a new type that this commit also adds.
|
|
data structures
|
|
And fix a the single screw-up in the source code it caught.
|
|
|
|
|
|
This only shaves a measly 19k off the rustc binary... but hey, every
little thing helps.
|
|
Except for _task, which is still a keyword.
|
|
|
|
Conflicts:
src/comp/middle/trans.rs
|
|
|
|
|
|
annotations
* Reorganized typestate into several modules.
* Made typestate check that any function with a non-nil return type
returns a value. For now, the check is a warning and not an error
(see next item).
* Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and
fail that don't locally return a value that can be inspected. "bot"
is distinct from "nil". There is no concrete syntax for _|_, while
the concrete syntax for the nil type is ().
* Added support to the parser for a ! annotation on functions whose
result type is _|_. Such a function is required to have either a
fail or a call to another ! function that is reached in all control
flow paths. The point of this annotation is to mark functions like
unimpl() and span_err(), so that an alt with a call to err() in one
case isn't a false positive for the return-value checker. I haven't
actually annotated anything with it yet.
* Random bugfixes:
* * Fixed bug in trans::trans_binary that was throwing away the
cleanups for nested subexpressions of an and or or
(tests: box-inside-if and box-inside-if2).
** In typeck, unify the expected type arguments of a tag with the
actual specified arguments.
|
|
|
|
|
|
So that the type parser won't go off and try to parse a vec
type when it sees vec::init_op.
|
|
|
|
Plus renaming the anonymous objects test to a more descriptive name,
and XFAILing it because it doesn't work yet.
|
|
|
|
Fixed infinite loop on anonymous objects in parser; added
expr_anon_obj to walk.rs; fixed syntax of test case.
|
|
Still segfaulting on the method-overriding.rs test, though.
|
|
|
|
|
|
This prevents insane things like 'auto while = 2', which would parse
in the previous revision, but then break when you tried to mutate it
with 'while = 10'.
|
|
Keywords are now only recognized in contexts where they are valid. The
lexer no longer recognizes them, all words are lexed as IDENT tokens,
that get interpreted by the parser.
|
|
This should be a snapshot transition.
|
|
This will need to be a snapshot.
|
|
|
|
One step closer to removing fold and having a single, immutable AST.
Resolve still uses fold, because it has to detect and transform
expr_field expressions. If we go through on our plan of moving to a
different syntax for module dereferencing, the parser can spit out
expr_field expressions, and resolve can move to walk.
(I am truly sorry for the things I did in typestate_check.rs. I expect
we'll want to change that to walk as well in the near future, at which
point it should probably pass around a context record, which could
hold the def_map.)
|
|
|
|
|
|
They are now created by the resolve pass, which is the only pass that
needs them, and kept internal to that pass.
|
|
|
|
|
|
* Cleans up the algorithm
* Move first pass to walk (second still folds)
* Support part of a type/value namespace split
(crate metadata and module indices still need to be taught about this)
* Remove a few blatant inefficiencies (import tables being recreated for
every lookup, most importantly)
|
|
|
|
|
|
(Have fun mergining your stuff with this.)
|
|
This commit reinstates the requirement that the predicate in a
"check" must be a manifest call to a special kind of function
declared with the new "pred" keyword instead of "fn". Preds must
have a boolean return type and can only call other preds; they
can't have any effects (as enforced by the typechecker).
The arguments to a predicate in a check expression must be
slot variables or literals.
|
|
This should make compilation a bit less noisy.
|
|
environment.
|
|
|
|
This reverts commit 6871c245a67fab222eccc2a21dcb620d11d3b0d0.
|