Commit Graph

267 Commits

Author SHA1 Message Date
Brian Anderson
c0c8d3aa8f core: Demode int/uint mods 2012-08-29 16:23:36 -07:00
Brian Anderson
8337fa1a54 Camel case the option type 2012-08-26 15:56:16 -07:00
Niko Matsakis
a8f1bee457 fix some unused pattern binding warnings 2012-08-24 15:37:21 -07:00
Michael Sullivan
0f996f70a6 Remove purity from fn_decl and move it out to containing AST elements. 2012-08-23 19:40:01 -07:00
Paul Stansifer
1153b5dcc8 intern identifiers 2012-08-22 14:59:25 -07:00
Niko Matsakis
652b312122 more sound treatment of fn& regions; change all & to be distinct 2012-08-21 10:28:34 -07:00
Patrick Walton
3038968f28 rustc: Perform some AST surgery to separate out class fields from methods 2012-08-15 16:20:35 -07:00
Patrick Walton
bdb206f285 rustc: Parse labeled loop, break, and again 2012-08-15 16:20:34 -07:00
Brian Anderson
6a0720b439 Convert impls to new syntax 2012-08-08 18:19:24 -07:00
Patrick Walton
4f98e80db1 rustc: Do some plumbing work in preparation for common fields in enums 2012-08-08 17:15:37 -07:00
Patrick Walton
438765da59 rustc: Box struct_defs 2012-08-07 17:46:51 -07:00
Michael Sullivan
7f7f47620e Implement static typeclass methods. Closes #3132. 2012-08-07 17:18:14 -07:00
Patrick Walton
a3f9e18b7a libsyntax: Allow users of the visitor to visit struct defs 2012-08-07 15:55:33 -07:00
Brian Anderson
42540841f3 Add missing comma 2012-08-07 14:34:00 -07:00
Patrick Walton
727c7c7499 rustc: Add stub support for struct variants to the AST 2012-08-07 14:25:53 -07:00
Brian Anderson
2772b2e5c7 syntax: Make match arm parsing more restrictive again
Require comma separators for all expression types except the plain block
2012-08-07 12:23:43 -07:00
Patrick Walton
253dfc3387 rustc: Implement pattern matching for structs 2012-08-06 17:36:24 -07:00
Brian Anderson
ecaf9e39c9 Convert alt to match. Stop parsing alt 2012-08-06 15:36:30 -07:00
Brian Anderson
025d86624d Switch alts to use arrows 2012-08-05 22:08:09 -07:00
Niko Matsakis
31c5cec55b Purge placement new; Make borrowck know about unary move.
cc #3071
2012-08-02 22:36:36 -07:00
Lindsey Kuper
65e0e30e59 Make typeck::collect aware of provided methods in traits. 2012-08-02 17:15:36 -07:00
Michael Sullivan
2fe299d1a5 Extend ast_map to know about method declarations in traits. 2012-08-02 16:02:30 -07:00
Niko Matsakis
97452c0ca1 Remove modes from map API and replace with regions.
API is (for now) mostly by value, there are options to use it by
reference if you like.  Hash and equality functions must be pure
and by reference (forward looking to the day when something
like send_map becomes the standard map).
2012-08-02 15:53:28 -07:00
Brian Anderson
b355936b4d Convert ret to return 2012-08-01 19:16:06 -07:00
Brian Anderson
507fba57d1 syntax: Allow any block-like expr to be used as alt arm w/o comma separator 2012-08-01 17:57:03 -07:00
Patrick Walton
b414db041b rustc: Parse by-reference pattern bindings with the "ref" keyword 2012-07-31 19:26:25 -07:00
Niko Matsakis
c206d024eb accept naked exprs with commas in pattern arms
pretty printing will use them, but indentation is slightly off
if the expr is long
2012-07-31 15:41:26 -07:00
Paul Stansifer
fd52df1901 Fix pretty-printer breakage: 1000f -> 1000. 2012-07-31 11:03:22 -07:00
Graydon Hoare
290f079474 Frontend bits for #2317, general const-expr classification. 2012-07-30 19:06:06 -07:00
Patrick Walton
93c2f5e0e4 rustc: Use coherence for operator overloading.
The only use of the old-style impls is now placement new.
2012-07-27 19:35:24 -07:00
Tim Chevalier
a0d05844ed Correctly forbid upvars in nested impls, traits and classes
Previously, resolve was allowing impls, traits or classes that were
nested within a fn to refer to upvars, as well as referring to type
parameters bound by the fn. Fixing this required adding a new kind of
def: def_typaram_binder, which can refer to any of an impl, trait or
class that has bound ty params. resolve uses this to enforce that
methods can refer to their parent item's type parameters, but not to
outer items' type parameters; other stages ignore it. I also made
sure that impl, trait and class methods get checked inside a
MethodRibKind thing so as to forbid upvars, and changed the definition
of MethodRibKind so that its second argument is an optional node_id
(so that required trait method signatures can be checked with a
MethodRibKind as well).
2012-07-27 17:31:42 -07:00
Patrick Walton
afd9a75c9e rustc: Fix cross-crate max/min-class-style constructors 2012-07-26 15:30:15 -07:00
Patrick Walton
978ca03cb2 Revert "accept naked exprs with commas in pattern arms" due to pretty-printing failures
This reverts commit f712b2d76b.

In alt arms, the parser needs to do a little lookahead to determine
whether it's looking at a record literal or a block.

Also there are some indentation issues in the expected source.
2012-07-19 07:53:55 -07:00
Niko Matsakis
f712b2d76b accept naked exprs with commas in pattern arms
pretty printing will use them, but indentation is slightly off
if the expr is long
2012-07-18 20:16:41 -07:00
Patrick Walton
db020ab63c rustc: Implement and enforce instance coherence 2012-07-17 15:46:43 -07:00
Tim Chevalier
b5729bd600 Support attributes on class ctors and dtors
Closes #2660
2012-07-17 12:40:59 -07:00
Niko Matsakis
41a21f053c remove typestate from code, tests, and docs 2012-07-14 17:37:20 -07:00
Michael Sullivan
92743dc2a6 Move the world over to using the new style string literals and types. Closes #2907. 2012-07-14 01:03:43 -07:00
Michael Sullivan
985b52be6d Support prefix notation for vstore strings. Closes #2906. 2012-07-13 17:03:49 -07:00
Lindsey Kuper
fc9c4c3245 Front-end support for default impls in traits. 2012-07-13 11:16:07 -07:00
Tim Chevalier
78ec6fe30c Obliterate the callee_id hack
Exprs that could be applications of overloaded operators
(expr_unary, expr_binary, expr_index) relied on the previous node ID
being "reserved" to carry extra typechecking info. This was
incredibly error-prone. Fixed it; now all exprs have two node IDs
(which will be wasted in some cases; future work could make this
an option instead if the extra int field ends up being a performance
problem).

Closes #2804
2012-07-12 19:02:07 -07:00
Niko Matsakis
b9aa9def85 infer when types are region parameterized rather than requiring /&
- removes various fields from various variants in the AST
- also update tests not to use this notation
2012-07-11 14:41:41 -07:00
Gareth Daniel Smith
be0141666d convert doc-attributes to doc-comments using ./src/etc/sugarise-doc-comments.py (and manually tweaking) - for issue #2498 2012-07-04 19:18:13 -07:00
Brian Anderson
ae6ea068a1 Revert "Remove rule requiring non-nil block-style statements to be semi-terminated"
This reverts commit 0f5eaef5fb.
2012-07-03 17:30:25 -07:00
Brian Anderson
0f5eaef5fb Remove rule requiring non-nil block-style statements to be semi-terminated
This is a subtle rule that no longer seems to be required.
2012-07-03 17:03:52 -07:00
Patrick Walton
f093d374ed rustc: Implement a new resolve pass behind a compile flag 2012-07-02 18:30:12 -07:00
Brian Anderson
d1fc2b5995 Convert to new closure syntax 2012-07-01 19:19:32 -07:00
Brian Anderson
a3382b6f26 Eliminate usages of old sugared call syntax 2012-06-30 16:01:49 -07:00
Michael Sullivan
98e161f00e Switch the compiler over to using ~[] notation instead of []/~. Closes #2759. 2012-06-29 17:41:45 -07:00
Graydon Hoare
697f1e38d6 Change 'native' and 'crust' to 'extern'.
This comes with a terminology change. All linkage-symbols are 'extern'
now, including rust syms in other crates. Some extern ABIs are
merely "foreign". The term "native" is retired, not clear/useful.

What was "crust" is now "extern" applied to a _definition_. This
is a bit of an overloading, but should be unambiguous: it means
that the definition should be made available to some non-rust ABI.
2012-06-26 16:18:37 -07:00
Eric Holk
b9d3ad0736 Getting rid of lots more vector +=. (issue #2719) 2012-06-26 00:39:18 -07:00
Michael Sullivan
329eca6044 Make vectors uglier ([]/~). Sorry. Should be temporary. Closes #2725. 2012-06-25 20:00:46 -07:00
Tim Chevalier
487cbf8e90 Remove resources
Also fixed shapes for classes with dtors, as well as handling
offsets for classes with dtors correctly in take glue.

Closes #2485
2012-06-24 15:09:57 -07:00
Graydon Hoare
312faf31df Tag all remaining FIXMEs with bugs. Install rule in tidy script to enforce this. 2012-06-21 16:44:10 -07:00
Eric Holk
0e5cfd9f33 Move vector addition out of trans and into libcore. 2012-06-21 16:11:11 -07:00
Tim Chevalier
e3c6e5e5b6 Re-fix whitespace 2012-06-16 15:22:22 -07:00
Tim Chevalier
69447e9002 Revert "Reference and whitespace fixes."
This reverts commit 52f1904ddd.
2012-06-16 15:17:10 -07:00
Eric Holk
52f1904ddd Reference and whitespace fixes. 2012-06-15 22:14:02 -04:00
Eric Holk
5c9f414a85 id_visitor should handle expr_index and expr_assign_op as well. 2012-06-15 22:00:04 -04:00
Tim Chevalier
093faaabe1 Handle index expressions' callee IDs correctly
Some code that handles unary and binary exprs' callee IDs was
    forgetting to handle the index expr case (since calls to
    user-defined index operators also have callee IDs). This was
    manifesting as an ICE in trans because when monomorphizing a
    function that had one of these operators in it (an index into a
    dvec, in the test case), the callee ID would be unbound to a type.

    Fixed it. Closes #2631.
2012-06-15 15:21:17 -07:00
Tim Chevalier
6b16325f43 Comments only: annotate FIXMEs 2012-06-14 18:46:33 -07:00
Brian Anderson
ce750a7dbc Box AST idents 2012-06-13 11:30:45 -07:00
Tim Chevalier
aa9d2d88d3 Handle class destructors correctly in metadata
This allows destructors to be inlined, which is necessary since
classes can have both ty params and destructors.
2012-06-12 17:37:04 -07:00
Patrick Walton
847c5e4e98 syntax: Remove a bunch of implicit copies 2012-06-07 20:12:05 -07:00
Niko Matsakis
2adb3a5013 add pure annotations in ast_util 2012-06-06 18:37:18 -07:00
Brian Anderson
75e4b8c8e9 syntax: Make span functions take args by copy. Eliminate some copy warnings 2012-06-04 21:57:47 -07:00
Kevin Cantu
7dcbaedd32 Rename librustsyntax to libsyntax
Per issue #2418.
2012-05-31 11:15:00 -07:00