| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
The check for whether a pat_ident is a variant or a binding
is simple and fast. Normalizing patterns again and again is
slow and error-prone (several places were forgetting to do it).
|
|
paths.
|
|
first step towards issue #1273
|
|
It is only a way to flag an alt as intentionally non-exhaustive right now.
Issue #1679
|
|
|
|
|
|
|
|
|
|
|
|
Closes #1728
Comments out a section of debuginfo.rs. This code was already broken
(only being called when --xg was passed, and only working on trivial
programs).
|
|
|
|
|
|
Added class support to the parser, prettyprinter, fold, and visit.
(See Issue 1726.)
This is WIP -- the test case is xfailed, and attempting to compile
it will error out in resolve.
|
|
|
|
|
|
|
|
Note: the body is the part of the macro syntax between the {}.
|
|
|
|
Issue #1673
|
|
Now that core exports "option" as a synonym for option::t, search-and-
replace option::t with option.
The only place that still refers to option::t are the modules in libcore
that use option, because fixing this requires a new snapshot
(forthcoming).
|
|
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
|
|
|
|
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have
been removed.
|
|
It was being used as a clumsy synonym of ty_fn.
|
|
|
|
This should reduce confusion of people trying to read the code.
|
|
variants
See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are
to export all of t's variants as well. "export t{};" exports t but not its
variants, while "export t{a, b, c};" exports only variants a, b, c of t.
To do:
- documentation
- there's currently no checking that a, b, c are actually variants of t in the
above example
- there's also no checking that t is an enum type, in the second two examples above
- change the modules listed in issue 1426 that should have the old export
semantics to use the t{} syntax
I deleted the test export-no-tag-variants since we're doing the opposite now,
and other tests cover the same behavior.
|
|
Support Lenny222's proposed syntax for exporting a tag without
its variants, or selected tags from a variant, in the AST and parser.
No support further down the line yet. Tests are xfailed.
|
|
|
|
|
|
|
|
Does what it says on the tin.
The next commit will remove support for this syntax.
|
|
This commit allows patterns like:
alt x { some(_) { ... } none { } }
without the '.' after none. The parser suspends judgment about
whether a bare ident is a tag or a new bound variable; instead,
the resolver disambiguates.
This means that any code after resolution that pattern-matches on
patterns needs to call pat_util::normalize_pat, which consults
an environment to do this disambiguation.
In addition, local variables are no longer allowed to shadow
tag names, so this required changing some code (e.g. renaming
variables named "mut", and renaming ast::sub to subtract).
The parser currently accepts patterns with and without the '.'.
Once the compiler and libraries are changed, it will no longer
accept the '.'.
|
|
Remove disr_val from ast::variant_ and always use ty::variant_info
when the value is needed. Move what was done during parsing into
other passes, primary typeck.rs. This move also correctly type checks
the disr. value expression; thus, fixing rustc --pretty=typed when
disr. values are used.
|
|
|
|
|
|
Removes the obj system from the compiler.
Closes #1484
|
|
Addresses issue #1393.
For now disallow disr. values unless all variants use nullary
contractors (i.e. "enum-like").
Disr. values are now encoded in the crate metadata, but only when it
will differ from the inferred value based on the order.
|
|
|
|
|
|
|
|
this will address the (crashing) new test added.
|
|
The AST no longer references it.
|
|
Issue #1227
|
|
|
|
The (temporary) syntax is
iface seq<T> {
fn len() -> uint;
fn iter(f: block(T));
}
// The 'blah<T>' can be left of to default the name of the
// impl to seq<T>. The 'of seq<T>' can be left off when
// not implementing a named interface.
impl blah<T> of seq<T> for [T] {
fn len() -> uint { vec::len(self) }
fn iter(f: block(T)) { for x in self { f(x); } }
}
|