Graydon Hoare
63f74f3771
Remove vestiges of "layers", insert skeletal do-nothing "kind" pass plus cached calculation of kind for each type.
2011-07-27 17:49:00 -07:00
Marijn Haverbeke
19394a50e7
Make printing of comments inside bindings slightly less broken
2011-07-27 16:24:41 +02:00
Marijn Haverbeke
e3552da0e6
No longer allow 'case' keyword before patterns
2011-07-27 16:01:31 +02:00
Marijn Haverbeke
6e2a7bff7f
Fix damage done by the pretty-printer
2011-07-27 15:54:33 +02:00
Marijn Haverbeke
df7f21db09
Reformat for new syntax
2011-07-27 15:54:33 +02:00
Marijn Haverbeke
66c1ca857b
Update the parser to accept the new syntax
2011-07-27 15:19:31 +02:00
Graydon Hoare
0a69196ef3
Handle column-zero \n explicitly rather than looking for \n\n.
2011-07-26 15:41:42 -07:00
Graydon Hoare
63aa869405
Consume EOL after line comment.
2011-07-26 15:41:42 -07:00
Michael Sullivan
8c8fa79312
Add block and closure protos and parse/pp block and lambda exprs.
2011-07-26 12:30:14 -07:00
Marijn Haverbeke
2c1250780d
Remove tuple support from the compiler
2011-07-26 15:19:56 +02:00
Marijn Haverbeke
c0976ad70b
Properly parse 'auto' for loop variable types
2011-07-26 14:53:01 +02:00
Marijn Haverbeke
aea537779e
Remove all uses of tuples from the compiler and stdlib
2011-07-26 14:06:02 +02:00
Marijn Haverbeke
ce808bbc6f
Make the pretty-printer output new-style syntax for local decls
2011-07-26 10:40:28 +02:00
Marijn Haverbeke
252b8ffe42
Add support for new-style local decls
...
let x = 5;
let y: int = 10;
// as soon as a typestate bug is fixed:
let x: str = foo, y <- 20u;
'auto' and 'type-first let' will soon be dropped.
2011-07-26 10:27:26 +02:00
Graydon Hoare
5ab213a464
Correct input coordinate tracking on block-opening brace.
2011-07-25 17:35:40 -07:00
Graydon Hoare
1243ce271e
Recognize and preserve first blank line if first line of file.
2011-07-25 17:10:08 -07:00
Michael Sullivan
25a89e068d
Rename the block type to be blk also. Sorry.
2011-07-25 14:18:07 -07:00
Graydon Hoare
552bff8a21
Adjust pp interface to that printing a crate (an reproducing literals/comments) takes a reader, not just a filename. Fixes first big pp-fuzzer bug.
2011-07-25 14:04:49 -07:00
Michael Sullivan
6bcdb48e35
Disallow block as a variable name in preparation for it becoming a keyword.
2011-07-25 13:42:38 -07:00
Marijn Haverbeke
19507787a9
Add support for bracey record types and literals
...
type foo = {mutable x: int, y: int};
auto myfoo = {mutable x: 10, y: 20u};
The old syntax is also still supported.
2011-07-25 17:41:00 +02:00
Marijn Haverbeke
cce1b4667b
Add look-ahead to parser object
2011-07-25 17:16:41 +02:00
Marijn Haverbeke
dca67f95cb
Make the lexer slightly less stateful
2011-07-25 16:46:08 +02:00
Marijn Haverbeke
e949aab10a
Remove some rustboot-isms
...
Closes #464
2011-07-25 15:07:48 +02:00
Marijn Haverbeke
f0be65cb50
Fix span information returned by parser::parse_seq
...
Its hi pos used to be the end of the token after the sequence. It now
properly reports the end of the closing token.
2011-07-25 14:04:37 +02: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
55acc737a8
Remove vestiges of typarams from anon objs.
2011-07-21 15:12:27 -07: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
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
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
Patrick Walton
60cffd7116
rustc: Complete the transition of pprust to interior vectors
2011-07-12 16:13:30 -07: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
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