Commit Graph

19 Commits

Author SHA1 Message Date
Niko Matsakis
2fa5a66310 remove mutable cycle from ast_fold 2012-05-21 20:07:14 -07:00
Lindsey Kuper
b8880e3254 Remove be keyword.
Closes #2227.
2012-05-15 10:41:14 -07:00
Tim Chevalier
5428a22b95 First cut at dtors for classes
Classes with dtors should compile now. Haven't yet tested
whether they actually run correctly.

Beginnings of support for #2295, though that won't be done until
there's more test cases and resources are removed.
2012-05-14 14:26:10 -07:00
Paul Stansifer
13c924c049 Remove do { ... } while ... from the language. 2012-05-10 15:09:33 -07:00
Marijn Haverbeke
96a159a6ea Support visibility modifiers and attributes on view items
Issue #1893
Tangentially, issue #2357
2012-05-08 23:14:24 +02:00
Marijn Haverbeke
b619954457 Start parsing pub/priv on regular items
Issue #1893
2012-05-08 16:09:40 +02:00
Niko Matsakis
50ec6bd2c3 new cap clause syntax 2012-05-04 12:33:08 -07:00
Niko Matsakis
825fd1808e lots of work to make iface/impls parameterized by regions
- paths can now take region parameters, replacing the dirty hack
  I was doing before of abusing vstores.  vstores are now a bit
  of a hack though.

- fix various small bugs:
  - we never checked that iface types were compatible when casting
    to an iface with `as`
  - we allowed nonsense like int<int>
  - and more! (actually that may be it)
2012-04-25 19:26:56 -07:00
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Marijn Haverbeke
a872a99bfe Simplify representation of ast::path 2012-04-23 13:04:46 +02:00
Tim Chevalier
37b0549730 Add new syntax for patterns that match the head constructor only
Adds a new kind of pattern C(*) where C is a constructor that may
have any number of fields. This pattern matches any value
constructed with C, without binding names for any of the fields.

Closes #1701.
2012-04-20 00:56:46 -07:00
Niko Matsakis
3c995fb8f3 make nominal types optionally parameterized by a self region.
Issue #2201.
2012-04-19 21:01:11 -07:00
Tim Chevalier
1da18c70ac Clean up FIXMEs in syntax::fold
Eta-reduce a function, fold over ty constrs, and annotate a FIXME.
2012-04-19 15:30:58 -07:00
Tim Chevalier
5c12cd72f4 Allow classes to implement ifaces
Introduce syntax like:

iface animal { ... }
class cat implements animal { ... }

to allow classes to implement ifaces. Casting classes to ifaces
is *not* yet supported. ifaces that a class implements are not
yet included in metadata.

The syntax is subject to change, and may go away completely if we
decide to use duck typing to relate classes with ifaces (see
http://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/ )
2012-04-11 16:20:01 -07:00
Graydon Hoare
7a3b290245 Add vstore/evec/estr to compiler. 2012-04-11 11:08:40 -07:00
Tim Chevalier
fd26743bed Generic classes and generic class methods work cross-crate
Classes can have ty params now. So can methods inside classes.
That was probably true before, but now it should still work if you
call methods in a class that's defined in a different crate. Yay!
2012-04-10 11:01:36 -07:00
Marijn Haverbeke
fc202ca034 Remove support for old-style for
Closes #1619
2012-04-06 20:38:23 +02:00
Marijn Haverbeke
c902eafa14 Convert old-style for loops to new-style
Most could use the each method, but because of the hack used to
disambiguate old- and new-style loops, some had to use vec::each.

(This hack will go away soon.)

Issue #1619
2012-04-06 20:38:23 +02:00
Brian Anderson
5c25e78b27 rustc: Move fold to rustsyntax 2012-03-29 14:42:30 -07:00