about summary refs log tree commit diff
path: root/src/comp/pretty
AgeCommit message (Collapse)AuthorLines
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-2198/+0
src/comp/syntax is currently just a sub-module of rustc, but it will, in the near future, be its own crate. This includes: - The AST data structure - The parser - The pretty-printer - Visit, walk, and fold - The syntax extension system - Some utility stuff that should be in the stdlib* *) Stdlib extensions currently require a snapshot before they can be used, and the win build is very broken right now. This is temporary and will be cleaned up when one of those problems goes away. A lot of code was moved by this patch, mostly towards a more organized layout. Some package paths did get longer, and I guess the new layout will take some getting used to. Sorry about that! Please try not to re-introduce any dependencies in syntax/ on any of the other src/comp/ subdirs.
2011-07-05Move pretty-printing 'modes' into a callback hookMarijn Haverbeke-66/+32
This way, the pretty-printer does not have to know about middle::ty. (This is a preparation for separating the AST functionality into a separate crate.)
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-5/+5
Just like it was done with items and exprs. Simplifies some code.
2011-07-02Allow any string expression to be used with fail.Josh Matthews-3/+3
2011-07-01rustc: Move path_to_str to front::astPatrick Walton-2/+2
2011-07-01Revert "rustc: Change methods in ty::t to use interior vectors"Patrick Walton-3/+3
This reverts commit 6720ea760df41df82af880b593e5b6023608d6cd.
2011-07-01rustc: Change methods in ty::t to use interior vectorsPatrick Walton-3/+3
2011-07-01Track def_ids of native types so that they can be distinguishedMarijn Haverbeke-1/+1
Closes #526
2011-07-01Allow 'newtype' syntax for tagsMarijn Haverbeke-15/+31
Doing this: tag foo = mytype; is now equivalent to doing this: tag foo { foo(mytype); }
2011-07-01Make sure the pretty-printer understand resourcesMarijn Haverbeke-1/+4
2011-06-30Minor pp cleanups.Graydon Hoare-4/+4
2011-06-30Preserve hard \n\n pairs from source when pretty-printing, as explicit ↵Graydon Hoare-9/+12
formatting control from users.
2011-06-30rustc: Change function argument types to interior vectorsPatrick Walton-6/+6
2011-06-30Pretty-print view items in mod itemsBrian Anderson-5/+4
For mods that aren't defined at the file level we were forgetting to print the view items so, e.g. 'mod { use std; }' would not print correctly.
2011-06-30rustc: Use interior vectors for record typesPatrick Walton-2/+2
2011-06-30rustc: Use interior vectors for tuple typesPatrick Walton-2/+2
2011-06-28Implement "claim"Tim Chevalier-2/+9
Implement "claim" (issue #14), which is a version of "check" that doesn't really do the check at runtime. It's an unsafe feature. The new flag --check-claims turns claims into checks automatically -- but it's off by default, so by default, the assertion in a claim doesn't execute at runtime.
2011-06-28Teach the parser and typechecker to understand port[int](). Closes #588Eric Holk-1/+12
2011-06-28Write metadata for more meta_item types. Issue #487Brian Anderson-6/+10
2011-06-28Write metadata for crate attributes. Issue #487Brian Anderson-0/+4
2011-06-28List crate attributes when running rustc with '--ls'Brian Anderson-0/+4
2011-06-27Move metadata::cwriter::encode to metadata::tyencodeBrian Anderson-2/+2
2011-06-27Rename middle::metadata to metadata::cwriter. Move creader to metadataBrian Anderson-2/+2
Preparation for a lot more metadata refactoring
2011-06-25Partial implementation of resourcesMarijn Haverbeke-0/+12
Non-copyability is not enforced yet, and something is still flaky with dropping of the internal value, so don't actually use them yet. I'm merging this in so that I don't have to keep merging against new patches.
2011-06-24Modify the fn vistors in walk so that they can handle functions without ↵Michael Sullivan-0/+7
names. Update the typestate code to understand this.
2011-06-23rustc: Pretty-print ternary operatorBrian Anderson-0/+12
2011-06-23Flesh out type pp code.Graydon Hoare-4/+19
2011-06-23Correct error message for argument mode mismatchTim Chevalier-6/+17
If you use a function expecting an alias argument in a context that expects a function expecting a value argument, or vice versa, the previous error message complained that the number of arguments was wrong. Fixed the error message to be accurate.
2011-06-22rustc: Downcase metadata::EncodeBrian Anderson-1/+1
2011-06-22Fix bug: globbed imports were importing everything visible from the otherPaul Stansifer-2/+11
module, not just everything exported.
2011-06-22rustc: Introduce and parse additional meta_item formsBrian Anderson-3/+12
Examples: #[test], #[link(name = "vers")] Issue #487
2011-06-21Move names and ids of native items into their recs, rather than their tagsMarijn Haverbeke-5/+5
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-51/+49
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-10/+11
This reduces some redundancy in the AST data structures and cruft in the code that works with them. To get a def_id from a node_id, apply ast::local_def, which adds the local crate_num to the given node_id. Most code only deals with crate-local node_ids, and won't have to create def_ids at all.
2011-06-20Tighten up the hardbreak rules a bit.Graydon Hoare-5/+7
2011-06-20Suppress hardbreaks when following hardbreaks.Graydon Hoare-6/+7
2011-06-20Fix interference between if-check and if printing.Graydon Hoare-4/+6
2011-06-20Fix pp blank-lines insertion at beginning of file and before 'let' decls.Graydon Hoare-7/+13
2011-06-19Fix pp blank-line insertion after isolated comments in cboxes.Graydon Hoare-8/+21
2011-06-18rustc: Store the lhs and rhs of receive exprs in left to right orderBrian Anderson-2/+2
With the changing of receive semantics the parser has been putting the rhs expression in the first argument of expr_recv and the lhs in the second, and all subsequent passes have been referring to them backwords (but still doing the right thing because they were assuming that lhs was the port and rhs was the receiver). This makes all code agree on what lhs and rhs mean for receive expressions.
2011-06-16Consistify ast::local.Paul Stansifer-4/+4
2011-06-16rustc: Change print_file to print_crateBrian Anderson-3/+4
The pretty-printer needs access to the crate attributes in order to reproduce inner crate attributes in standalone .rs files Issue #487
2011-06-16Reformat a bunch of recent churn.Graydon Hoare-28/+15
2011-06-16rustc: Pretty print module inner attributesBrian Anderson-7/+17
Issue #487
2011-06-16Pretty-print if-checkTim Chevalier-37/+46
2011-06-16rustc: Pretty print interior vector typesPatrick Walton-0/+6
2011-06-16Bring swap through typechecking and typestate.Michael Sullivan-0/+6
2011-06-16Refactor ast::item representationMarijn Haverbeke-22/+22
Most of the fields in an AST item were present in all variants. Things could be simplified considerably by putting them in the rec rather than in the variant tags.
2011-06-15Refactor data structures representing constraints (again...)Tim Chevalier-37/+47
I added a "resolved" version of the ast::constr type -- ty::constr_def -- that has a def_id field instead of an ann_field. This is more consistent with other types and eliminates some checking. Incidentally, I removed the def_map argument to the top-level function in middle::alias, since the ty::ctxt already has a def_map field.
2011-06-15Added issue # to FIXME.Lindsey Kuper-1/+1