about summary refs log tree commit diff
path: root/src/comp
AgeCommit message (Collapse)AuthorLines
2011-07-05Parse attributes for native items. Closes #609Brian Anderson-10/+36
2011-07-05Warn when compiling shared crates that don't have name/vers link attributesBrian Anderson-5/+19
Closes #614
2011-07-05Error if the link attribute has duplicate items. Issue #614Brian Anderson-6/+22
2011-07-05Don't thread the local crate number through the sessionMarijn Haverbeke-13/+7
It's a constant, anyway.
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-1200/+1213
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-73/+85
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-04rustc: Remove obsolete "The second has to be authed pure" commentPatrick Walton-4/+3
2011-07-04Switch the alias checking pass to use span_err instead of span_fatalMarijn Haverbeke-12/+13
It'll now spit out all problems it finds, and only abort after the whole pass has run.
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-79/+68
Just like it was done with items and exprs. Simplifies some code.
2011-07-04Use metadata to avoid always passing -Lrustllvm to the linker.Rafael Ávila de Espíndola-11/+37
2011-07-04Simplify.Rafael Ávila de Espíndola-11/+3
2011-07-04Simplify the code a bit.Rafael Ávila de Espíndola-8/+3
2011-07-03Make use of demand::simple instead of manually checking fail expr type.Josh Matthews-11/+1
2011-07-03Make non-str fail expression a type checking failure instead of a ↵Josh Matthews-4/+19
translation one.
2011-07-03Handle fail as an argument; parse fail expressions unambiguouslyTim Chevalier-9/+13
An expression like: foo(1, fail, 2) was failing to parse, because the parser was interpreting the comma as the start of an expression that was an argument to fail, rather than recognizing that the fail here has no arguments Fixed this by using can_begin_expr to determine whether the next token after a fail token suggests that this is a nullary fail or a unary fail. In addition, when translating calls, check before translating each argument that the block still isn't terminated. This has the effect that if an argument list includes fail, the back-end won't keep trying to generate code for successive arguments and trip the !*terminated assertion.
2011-07-03Add a predicate that determines whether a token can begin an expressionTim Chevalier-0/+21
2011-07-03Eliminate all direct calls to option::get() from typeckTim Chevalier-21/+55
This means fewer mysterious error messages.
2011-07-03Manipulate contexts correctly in trans_fail_exprTim Chevalier-7/+11
This fixes Issue #617
2011-07-02Generate code properly for calls with _|_ - typed argumentsTim Chevalier-19/+25
The code for translating a fail (for example) would call Unreachable(), which terminates the block; if a fail appeared as an argument, this would cause an LLVM assertion failure. Changed trans_call to handle this situation correctly.
2011-07-02Add a function that determines whether the block is terminatedTim Chevalier-0/+4
2011-07-02Fix assertion failure when syntax extension name is missing.Josh Matthews-0/+3
2011-07-02Allow any string expression to be used with fail.Josh Matthews-23/+72
2011-07-01rustc: Fix memory corruption with ivectors-inside-ivectors by duplicating ↵Patrick Walton-2/+2
*first*, and *then* copying subtypes.
2011-07-01rustc: Move path_to_str to front::astPatrick Walton-19/+19
2011-07-01Introduce --cfg argument for providing additional configuration. Issue #489Brian Anderson-4/+27
2011-07-01Add some FIXMEs for issue #607Brian Anderson-1/+5
2011-07-01Add some logging to attr when reading crate link attributesBrian Anderson-2/+1
Only link attributes of the meta_list type are considered when matching crate attributes. Instead of doing nothing we can at least log that link attributes of other types were ignored.
2011-07-01Revert "rustc: Change methods in ty::t to use interior vectors"Patrick Walton-48/+43
This reverts commit 6720ea760df41df82af880b593e5b6023608d6cd.
2011-07-01rustc: Change methods in ty::t to use interior vectorsPatrick Walton-43/+48
2011-07-01Export only what's in use from front::eval. Issue #604Brian Anderson-0/+2
2011-07-01Remove unused imports from front::evalBrian Anderson-7/+0
2011-07-01Remove remaining unused eval methods. Issue #604Brian Anderson-46/+0
2011-07-01Remove the concept of crate directive let statements. Issue #604Brian Anderson-123/+0
2011-07-01Remove the concept of crate directive expressions. Issue #604Brian Anderson-66/+1
2011-07-01Remove the environment concept from front::evalBrian Anderson-75/+51
This is the old method of conditional compilation. It is going away. Issue #489
2011-07-01Cleanup attribute code. Issue #487Brian Anderson-28/+23
2011-07-01Add some helper functions to front::attrBrian Anderson-0/+20
2011-07-01Track def_ids of native types so that they can be distinguishedMarijn Haverbeke-30/+49
Closes #526
2011-07-01Allow dereferencing of single-variant, single-argument tag valuesMarijn Haverbeke-81/+141
(Using the * operator.) This makes tags more useful as nominal 'newtype' types, since you no longer have to copy out their contents (or construct a cumbersome boilerplate alt) to access them. I could have gone with a scheme where you could dereference individual arguments of an n-ary variant with ._0, ._1, etc, but opted not to, since we plan to move to a system where all variants are unary (or, I guess, nullary).
2011-07-01Allow 'newtype' syntax for tagsMarijn Haverbeke-16/+47
Doing this: tag foo = mytype; is now equivalent to doing this: tag foo { foo(mytype); }
2011-07-01Do not store a tag num for single-variant tagsMarijn Haverbeke-119/+142
This is a preparation for tags-as-nominal-types. A tag that has only a single variant is now represented, at run-time, as simply a tuple of the variant's parameters, with the variant id left off.
2011-07-01Make sure the pretty-printer understand resourcesMarijn Haverbeke-1/+4
2011-07-01Implement autoderef for function calls.Michael Sullivan-23/+51
This is important since we are going to be making functions noncopyable soon, which means we'll be seeing a lot of boxed functions. (*f)(...) is really just too heavyweight. Doing the autodereferencing was a very little bit tricky since trans_call works with an *lval* of the function whereas existing autoderef code was not for lvals.
2011-07-01Move autoderefed_ty to ty.rs and rename it type_autoderef.Michael Sullivan-14/+15
2011-06-30rustc: Duplicate heap data of interior vectors when passing them by valuePatrick Walton-1/+15
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-13/+32
formatting control from users.
2011-06-30rustc: Remove unused variables from last commitPatrick Walton-2/+0
2011-06-30rustc: Change function argument types to interior vectorsPatrick Walton-75/+97
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.