Graydon Hoare
088ab03fdb
Add spans to fields, args, methods. Improve pp of same.
2011-06-03 15:42:42 -07:00
Graydon Hoare
8235e76a47
Tidy up printing of ty_fn.
2011-06-03 15:42:42 -07:00
Graydon Hoare
cb61d7b38e
Pretty-print literals exactly as we saw them in the source.
2011-06-02 17:18:49 -07:00
Patrick Walton
12f86e6f2f
rustc: Print node IDs for more types of nodes
2011-06-02 11:29:17 -07:00
Patrick Walton
7c6a0f189e
rustc: Tiny style fix in pprust::rust_printer
2011-06-02 11:29:17 -07:00
Patrick Walton
78374d11ce
rustc: Add a new mode to the pretty printer that prints out node IDs, for debugging
2011-06-01 18:53:52 -07:00
Tim Chevalier
af4554aadf
Add a few more to_str functions
2011-06-01 17:47:59 -07:00
Graydon Hoare
1f915ef7ce
Permit breaking before fn args block.
2011-06-01 16:39:31 -07:00
Graydon Hoare
1b67fbdfd3
More tweaks to comment preservation rules.
2011-06-01 15:29:38 -07:00
Graydon Hoare
198f6a247e
Print iters as iters not fns.
2011-06-01 13:18:16 -07:00
Graydon Hoare
19f85cc9c4
Print ty_bot properly.
2011-06-01 13:08:08 -07:00
Graydon Hoare
4eef7b613c
Bug fixes to pprust.
2011-06-01 12:26:42 -07:00
Graydon Hoare
681f0c7a2b
Support printing globs.
2011-06-01 11:39:20 -07:00
Graydon Hoare
ae16639dfa
Slightly more aggressive about inserting whitespace. Getting frustrated with comments.
2011-06-01 11:39:20 -07:00
Graydon Hoare
0235e742f6
Give up on use of huge_word for comments. Still not formatting quite right, but closer.
2011-05-31 17:39:15 -07:00
Michael Sullivan
f4df2e4974
Fix pretty printer for move.
2011-05-31 17:39:14 -07:00
Michael Sullivan
fd1029e6dd
Support move as an initializer.
2011-05-31 17:39:14 -07:00
Michael Sullivan
5e7bba3d23
Insert plumbing for move that behaves just like assign.
2011-05-31 17:39:14 -07:00
Graydon Hoare
2de1a4bb1b
Handle pretty-printing else-if properly.
2011-05-31 12:58:02 -07:00
Graydon Hoare
b6971d94df
Consolidate formatting functions a bit more.
2011-05-31 11:00:47 -07:00
Graydon Hoare
1811513552
Fix long lines
2011-05-31 11:00:47 -07:00
Graydon Hoare
371c25683c
Break methods in obj types.
2011-05-31 11:00:47 -07:00
Graydon Hoare
1676c67446
Tighten up comment rules a little more.
2011-05-31 11:00:47 -07:00
Graydon Hoare
cf57553679
Improve handling of trailing comments.
2011-05-31 11:00:47 -07:00
Graydon Hoare
b48cab962a
Add span to field to catch per-field comments in rec exprs.
2011-05-31 11:00:47 -07:00
Graydon Hoare
d12ea39896
Improve comment handling in pp.
2011-05-31 11:00:47 -07:00
Graydon Hoare
30f8348473
Differentiate consistency of commasep boxes
2011-05-31 11:00:47 -07:00
Graydon Hoare
21313d623a
new pretty printer
2011-05-31 11:00:47 -07:00
Michael Sullivan
a7a42c24be
Change the syntax for RECV from "var <- port" to "port |> var".
2011-05-27 12:01:20 -07:00
Tim Chevalier
610c81af19
Fix typo
2011-05-26 19:13:56 -07:00
Graydon Hoare
dc1b34288c
Pretty print view items with :: rather than :.
2011-05-25 22:09:36 -07:00
Marijn Haverbeke
86d51ec24b
Get test-pass/utf8.rs to run
...
This involved a small fix to the unicode-escape character lexing and
to the pretty-printer.
2011-05-23 23:25:55 +02:00
Lindsey Kuper
c3410bf927
More work on anonymous objects.
2011-05-20 17:59:56 -07:00
Tim Chevalier
a08a376d6e
Make controlflow part of a function type
...
Change ty_fn to have a controlflow field. A 'controlflow' is
essentially a bit of data that says whether or not this function
never returns to the caller (if it never returns, that means it calls
"fail" or another "never-returns" function on every control path).
Also add syntax for annotating functions that never return:
fn foo() -> ! {
fail;
}
for example. Functions marked with ! implicitly have a result type of
ty_bot, which is a new type that this commit also adds.
2011-05-20 16:57:37 -07:00
Graydon Hoare
a4dd57705c
Move type cache and node type table into type context.
2011-05-19 15:47:15 -07:00
Patrick Walton
3ffe390570
rustc: Print the types of declarations in --typed-pretty mode
2011-05-17 19:00:16 -07:00
Patrick Walton
7a3812afc3
rustc: Add a typed pretty-printing mode for debugging
2011-05-17 17:43:06 -07:00
Marijn Haverbeke
09d8ef8d51
Finally rename std::_xxx to std::xxx
...
Except for _task, which is still a keyword.
2011-05-17 20:41:41 +02:00
Marijn Haverbeke
f7df3696de
Switch pretty printer to new vec syntax
2011-05-17 07:19:34 +02:00
Graydon Hoare
fbbc1a77d2
Rewrite everything to use [] instead of vec() in value position.
2011-05-16 18:21:22 -07:00
Lindsey Kuper
b6f35c6a4b
More work toward anonymous objects.
2011-05-13 17:35:13 -07:00
Marijn Haverbeke
57ffa2a487
Make the parser more careful about keywords
...
Keywords are now only recognized in contexts where they are valid. The
lexer no longer recognizes them, all words are lexed as IDENT tokens,
that get interpreted by the parser.
2011-05-13 22:00:13 +02:00
Marijn Haverbeke
3816e57fd2
Downcase std modules again, move to :: for module dereferencing
...
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00
Marijn Haverbeke
6510f1ce7c
Change module dereference syntax from . to ::
...
This will need to be a snapshot.
2011-05-12 21:30:35 +02:00
Marijn Haverbeke
358a1aeec9
Keep resolve data in external hash table, rather than embedded defs
...
One step closer to removing fold and having a single, immutable AST.
Resolve still uses fold, because it has to detect and transform
expr_field expressions. If we go through on our plan of moving to a
different syntax for module dereferencing, the parser can spit out
expr_field expressions, and resolve can move to walk.
(I am truly sorry for the things I did in typestate_check.rs. I expect
we'll want to change that to walk as well in the near future, at which
point it should probably pass around a context record, which could
hold the def_map.)
2011-05-12 15:40:21 +02:00
Brian Anderson
a459bcd127
Give the lexer a session so that it can fail more informatively
2011-05-11 23:04:16 -04:00
Marijn Haverbeke
e9c12ab1d0
Rewrite comp/middle/resolve.rs
...
* Cleans up the algorithm
* Move first pass to walk (second still folds)
* Support part of a type/value namespace split
(crate metadata and module indices still need to be taught about this)
* Remove a few blatant inefficiencies (import tables being recreated for
every lookup, most importantly)
2011-05-11 12:32:37 +02:00
Patrick Walton
662e949540
rustc: Alias fix part 1 -- Separate out AST modes from typechecker modes, and introduce an "either value or alias" mode
2011-05-09 12:27:03 -07:00
Marijn Haverbeke
a3ec0b1f64
Rename std modules to be camelcased
...
(Have fun mergining your stuff with this.)
2011-05-06 22:51:19 +02:00
Lindsey Kuper
9d7fc21967
Consolidating expr_to_str functions.
2011-05-05 16:53:25 -07:00