Michael Sullivan
f2f8943a85
Add a "fake" def_upvar and mechanisms to create it.
2011-07-22 17:46:52 -07:00
Paul Stansifer
e18d70fe12
Implement Macro By Example.
2011-07-22 16:53:43 -07:00
Marijn Haverbeke
b9b674abe7
Start adding support for multiple variable declarations per stmt
...
This adds parser support and most of the machinery for
auto x = 10, y = 20;
However, the above still goes wrong somewhere in typestate, causing
the state checker to believe only the last variable in the list is
initialized after the statement.
Tim, if you have a moment, could you go over the changes to the tstate
code in this patch and see where I'm going wrong?
Multi-var-decls without the typestate extension
Add a loop
2011-07-22 17:51:26 +02:00
Lindsey Kuper
8ebd292253
Consolidate obj_field_from_anon_obj_field().
2011-07-21 15:12:27 -07:00
Lindsey Kuper
55acc737a8
Remove vestiges of typarams from anon objs.
2011-07-21 15:12:27 -07:00
Marijn Haverbeke
c32f525f73
Make the pretty-printer output paren-free and case-free code
...
We should probably do another pretty-printing pass soon.
2011-07-21 15:37:14 +02:00
Tim Chevalier
8a7f2e0fe5
Parse nil literals (including in patterns)
...
Closes #622 .
2011-07-20 16:02:53 -07:00
Tim Chevalier
bd4aeef78b
Beginnings of support for constrained types
...
Programs with constrained types now parse and typecheck, but
typestate doesn't check them specially, so the one relevant test
case so far is XFAILed.
Also rewrote all of the constraint-related data structures in the
process (again), for some reason. I got rid of a superfluous
data structure in the context that was mapping front-end constraints
to resolved constraints, instead handling constraints in the same
way in which everything else gets resolved.
2011-07-19 18:57:28 -07:00
Michael Sullivan
da2a7e5bd2
Simple refactoring in the pretty printer.
...
Introduce a proto_to_str function to find the string representation of a given
proto instead of casing on the proto in multiple places.
2011-07-19 18:30:08 -07:00
Brian Anderson
c40d6265ce
Support x86 stdcall convention
...
This allows rust to call the Win32 API
2011-07-18 13:56:15 -07:00
Josh Matthews
a411c865b2
Make clear the differentiation between char pos and byte pos in filemaps. Fix up error printing for files with multi-byte characters.
2011-07-16 15:57:24 -07:00
Josh Matthews
3ce43f37d2
Fix pre-existing problem with filemap line positions always starting at 0. Fix error line output to only retrieve up to the nearest newline.
2011-07-16 15:56:31 -07:00
Josh Matthews
a5ac8f16db
Use the actual start position of the file in the codemap rather than the position of the first newline.
2011-07-16 15:56:31 -07:00
Josh Matthews
63598248e4
Reenable error line printing.
2011-07-16 15:56:31 -07:00
Josh Matthews
df74f2cde9
Fix error line display slicing.
2011-07-16 15:56:28 -07:00
Patrick Walton
917afa4cc9
rustc: Remove a bunch of exterior vectors
2011-07-15 11:38:46 -07:00
Patrick Walton
be489ee9e2
rustc: Move much of metadata reading over to interior vectors
2011-07-14 12:00:48 -07:00
Graydon Hoare
39151f2ad8
Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.
2011-07-13 15:44:09 -07:00
Tim Chevalier
5e1a6dac44
Parse nullary ret correctly
...
ret is similar to fail: if not followed by an expression, it
should be parsed as a ret without an argument. The old version would
fail if ret was followed by a close paren (for example). Fixed it.
Closes #676 .
2011-07-13 15:00:59 -07:00
Tim Chevalier
0c913e63d9
Add some missing cases to token::can_begin_expr
2011-07-13 15:00:23 -07:00
Marijn Haverbeke
6cb5c0980a
box patterns, expect for the trans part
2011-07-13 10:50:16 +02:00
Graydon Hoare
e53cfb979b
Fix fast-check target by disabling code snippet printing on warnings (broken on .rc files) and adding an xfail-fast flag for global-scope.rs.
2011-07-12 17:36:57 -07:00
Brian Anderson
73e6a4f9e5
Elide existing main function when building a test runner. Issue #428
...
This prevents any defined main function from colliding with the one
synthesized for the test runner. This is not the best solution since it
doesn't compile a function the user defined, but I don't think it's likely to
be a problem in the near term.
2011-07-12 16:54:46 -07:00
Patrick Walton
a3add84909
rustc: Remove some interior vectors from typestate and some useless vec-related imports
2011-07-12 16:44:57 -07:00
Patrick Walton
e038e8e52b
rustc: Move ppaux away from exterior vectors
2011-07-12 16:35:02 -07:00
Patrick Walton
60cffd7116
rustc: Complete the transition of pprust to interior vectors
2011-07-12 16:13:30 -07:00
Marijn Haverbeke
bde52808f0
Update pretty-printing of '...' in record patterns to be ', _' instead
2011-07-12 17:58:40 +02:00
Brian Anderson
a5ec51d6a1
Fix pretty-printing of literals again. Issue #672
...
The pos variable is one character beyond where I thought it was.
2011-07-11 21:31:14 -07:00
Tim Chevalier
a8b1ea159c
Make the parser add correct spans to view_items
...
Closes #650 .
2011-07-11 19:12:02 -07:00
Paul Stansifer
2e46438507
So... I can't spell 'ellipsis'.
2011-07-11 18:52:50 -07:00
Paul Stansifer
9a0e85a920
Change "etc" syntax for record patterns from {a:b ...}
to {a:b, _}
.
2011-07-11 18:52:50 -07:00
Paul Stansifer
48dbee6b47
Add elipses, reorganize the macro components into their own AST node.
2011-07-11 18:52:50 -07:00
Paul Stansifer
425732311a
Move macro expansion to a separate phase, change macro syntax, and add parse_sess to session.
2011-07-11 18:52:50 -07:00
Paul Stansifer
80cf4ecd3b
Add nodes for embedding types and blocks in expressions for macros.
2011-07-11 18:52:10 -07:00
Josh Matthews
fd24fd5e31
Only print up to six lines on error. Print ^~~~~ to highlight error span.
2011-07-11 18:44:27 -07:00
Josh Matthews
b62fcdcc36
Hack to print lines when error spans are available.
2011-07-11 18:44:27 -07:00
Tim Chevalier
1870e97559
Visit the type argument in a port expression
...
This closes #664 .
2011-07-11 18:12:00 -07:00
Brian Anderson
e45819ad70
Add parser::parse_crate_from_source_str
...
The fuzzer wants to be able to do stuff like this
2011-07-11 17:46:24 -07:00
Brian Anderson
9fe03b3c55
Pull lexer creation out of new_parser
...
This will allow custom lexers to be injected into the parser (for fuzzing)
2011-07-11 16:56:02 -07:00
Brian Anderson
08f8753d80
Pull file reading out of the lexer
2011-07-11 16:56:02 -07:00
Patrick Walton
05390b4b38
rustc: Implement explicit global scope resolution via leading "::"; add a test case
2011-07-11 16:02:16 -07:00
Brian Anderson
7fc7ebd520
The lexer's get_mark_str should slice by byte position, not char. Closes #654
2011-07-11 14:41:55 -07:00
Marijn Haverbeke
55e348280e
Fix pretty-printing of record patterns
2011-07-11 21:23:49 +02:00
Marijn Haverbeke
7595fe5153
Implement record patterns
...
Closes #469 .
2011-07-11 15:32:41 +02:00
Marijn Haverbeke
12cb128a0a
Move visit to newtype-style nominal type
...
This makes getting the function fields out of the visitor less
cumbersome and more efficient (no take/drop).
2011-07-11 13:53:50 +02:00
Marijn Haverbeke
86ee3454a1
Implement or-patterns in case clauses
...
You can now say
expr_move(?dst, ?src) | expr_assign(?dst, ?src) { ... }
to match both expr_move and expr_assign. The names, types, and number
of bound names have to match in all the patterns.
Closes #449 .
2011-07-11 11:01:54 +02:00
Jesse Ruderman
ea69f48eac
Add a missing case so nbody.rs can pp
2011-07-10 17:05:25 -07:00
Jesse Ruderman
ab50da9445
Export noop_fold_expr so the fuzzer can use it
2011-07-10 17:05:25 -07:00
Brian Anderson
6d3513eaee
Make #fmt work from inside std. Issue #175
...
At long last, this patch makes #fmt usable from inside the standard library.
The way it does it us very hackish, but at least it works now.
2011-07-10 17:00:28 -07:00
Brian Anderson
5543404abe
Track the path as we fold over the AST looking for unit tests. Issue #428
2011-07-09 12:35:30 -07:00