about summary refs log tree commit diff
path: root/src/comp/pretty/pprust.rs
AgeCommit message (Collapse)AuthorLines
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-1233/+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-62/+14
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-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/+1
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/+7
formatting control from users.
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-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-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-23rustc: Pretty-print ternary operatorBrian Anderson-0/+12
2011-06-23Flesh out type pp code.Graydon Hoare-4/+19
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-2/+2
2011-06-20Suppress hardbreaks when following hardbreaks.Graydon Hoare-5/+6
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-6/+12
2011-06-19Fix pp blank-line insertion after isolated comments in cboxes.Graydon Hoare-6/+11
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-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-1/+1
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
2011-06-15Attempt to put out windows tinderbox.Graydon Hoare-1/+5
2011-06-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-287/+213
2011-06-15Print mutability of obj fields.Graydon Hoare-2/+7
2011-06-15Fix pp bug on native modules.Graydon Hoare-1/+3
2011-06-15rustc: Pretty-print outer attributes of itemsBrian Anderson-15/+47
Issue #487
2011-06-15rustc: Make room in remaining AST item nodes for attributesBrian Anderson-6/+6
Issue #487
2011-06-15rustc: Make room in item_mod for metadataBrian Anderson-1/+1
Issue #487
2011-06-14Print parens on unops when necessary. 'make reformat' output now builds to ↵Graydon Hoare-1/+1
stage3.
2011-06-14Remove a bunch of primitive-compiler-workarounds from pprust.rsMarijn Haverbeke-41/+23
2011-06-14Implement function expressions/anonymous functionsMarijn Haverbeke-2/+11
Looks like 'fn(..arg..) -> ret {body;}. They don't support type parameters or upvars yet.
2011-06-13Change decl to local in expr_for and expr_for_eachTim Chevalier-8/+4
Since the decl in a for or for-each loop must always be a local decl, I changed the AST to express this. Fewer potential match failures and "the impossible happened" error messages = yay!
2011-06-10Encode meta tags in the crate and start sketching enhanced logic for ↵Graydon Hoare-1/+1
resolving crate "use" directives. Now with extra "works on OSX" kludging.
2011-06-10Fix a non-exhaustive match failure.Lindsey Kuper-0/+1
2011-06-10Implement mutable/immutable alias distinction.Marijn Haverbeke-2/+10
Before, all aliases were implicitly mutable, and writing &mutable was the same as writing &. Now, the two are distinguished, and assignments to regular aliases are no longer allowed.