about summary refs log tree commit diff
path: root/src/comp/front
AgeCommit message (Collapse)AuthorLines
2011-05-25rustc: Fail when #fmt is given too many argumentsBrian Anderson-1/+9
2011-05-23Get test-pass/utf8.rs to runMarijn Haverbeke-43/+23
This involved a small fix to the unicode-escape character lexing and to the pretty-printer.
2011-05-20Merge remote-tracking branch 'graydon/master' into typestate_4Tim Chevalier-3/+3
2011-05-20Annotate erroring functions in session and parserTim Chevalier-3/+3
2011-05-20More work on anonymous objects.Lindsey Kuper-3/+3
2011-05-20Make controlflow part of a function typeTim Chevalier-25/+58
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-20rustc: Move the interner to a new module intended to be used for general ↵Patrick Walton-5/+5
data structures
2011-05-19Move the ty_item_table into ty::ctxt.items, move variant_info to ty, and ↵Graydon Hoare-7/+6
start sketching the contains_pointer property on types.
2011-05-19Finish name collision testing.Marijn Haverbeke-1/+0
And fix a the single screw-up in the source code it caught.
2011-05-19remove now-unused ts field from annTim Chevalier-5/+3
2011-05-17rustc: Flatten annotationsPatrick Walton-15/+9
2011-05-17Alias-ify the parser and lexerMarijn Haverbeke-123/+121
This only shaves a measly 19k off the rustc binary... but hey, every little thing helps.
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-130/+130
Except for _task, which is still a keyword.
2011-05-17Parser fix: 'fail' was eating the next token that came after it.Paul Stansifer-1/+0
2011-05-16Merge remote branch 'origin/master' into HEADGraydon Hoare-12/+48
Conflicts: src/comp/middle/trans.rs
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-81/+81
2011-05-16Begin vec() -> [] transition.Graydon Hoare-3/+3
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-12/+48
annotations * Reorganized typestate into several modules. * Made typestate check that any function with a non-nil return type returns a value. For now, the check is a warning and not an error (see next item). * Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and fail that don't locally return a value that can be inspected. "bot" is distinct from "nil". There is no concrete syntax for _|_, while the concrete syntax for the nil type is (). * Added support to the parser for a ! annotation on functions whose result type is _|_. Such a function is required to have either a fail or a call to another ! function that is reached in all control flow paths. The point of this annotation is to mark functions like unimpl() and span_err(), so that an alt with a call to err() in one case isn't a false positive for the return-value checker. I haven't actually annotated anything with it yet. * Random bugfixes: * * Fixed bug in trans::trans_binary that was throwing away the cleanups for nested subexpressions of an and or or (tests: box-inside-if and box-inside-if2). ** In typeck, unify the expected type arguments of a tag with the actual specified arguments.
2011-05-16rustc: Make the parser use the internerPatrick Walton-29/+31
2011-05-14fix a long line that i forgot to commitMarijn Haverbeke-1/+1
2011-05-14Mark IDENT tokens that are followed by ::Marijn Haverbeke-18/+19
So that the type parser won't go off and try to parse a vec type when it sees vec::init_op.
2011-05-13Remove rustboot from the repository.Graydon Hoare-3/+1
2011-05-13'with' no longer a token; whitespace police.Lindsey Kuper-9/+5
Plus renaming the anonymous objects test to a more descriptive name, and XFAILing it because it doesn't work yet.
2011-05-13Use new module namespace syntax.Lindsey Kuper-53/+45
2011-05-13Bug fixes.Lindsey Kuper-20/+22
Fixed infinite loop on anonymous objects in parser; added expr_anon_obj to walk.rs; fixed syntax of test case.
2011-05-13More progress on anonymous objects.Lindsey Kuper-8/+9
Still segfaulting on the method-overriding.rs test, though.
2011-05-13Correct capitalization of "Option".Lindsey Kuper-10/+9
2011-05-13Starting on support for anonymous objects. Just syntax so far.Lindsey Kuper-0/+70
2011-05-13Safeguard against using statement or item keywords as value idsMarijn Haverbeke-12/+78
This prevents insane things like 'auto while = 2', which would parse in the previous revision, but then break when you tried to mutate it with 'while = 10'.
2011-05-13Make the parser more careful about keywordsMarijn Haverbeke-1147/+608
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-13Extend crate format to allow multiple definitions for a single nameMarijn Haverbeke-82/+51
The type/value namespace distinction pretty much works now. Module namespace is up next.
2011-05-13Move capture checking into resolve.rsMarijn Haverbeke-2/+0
Drops capture.rs. The new algorithm also checks for captures function arguments and obj fields.
2011-05-12Rename std.extfmt.CT to std.extfmt.RT to ct and rtBrian Anderson-32/+32
Temporarily duplicate the entire RT module, leaving it with the old name to accomodate the stage0 compiler. Will be removed after the next snapshot.
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-1497/+1500
This should be a snapshot transition.
2011-05-12Transitional change to make extfmt output lowercase module nameMarijn Haverbeke-1/+1
2011-05-12Change module dereference syntax from . to ::Marijn Haverbeke-58/+30
This will need to be a snapshot.
2011-05-12Remove some truly wrong logic in parse_constrsMarijn Haverbeke-13/+8
2011-05-12Keep resolve data in external hash table, rather than embedded defsMarijn Haverbeke-20/+33
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-12Ensure ann tags are actually kept around during typecheckingMarijn Haverbeke-1/+9
This way, the tag assigned by the parser stays with the node. I realize ann replacing is probably going away real soon, but I needed this now for moving the resolve defs out of the AST.
2011-05-12Properly lex block comments followed by EOFMarijn Haverbeke-4/+4
2011-05-11Remove unused filename parameter from lexer.new_readerBrian Anderson-3/+3
2011-05-11Give the lexer a session so that it can fail more informativelyBrian Anderson-19/+30
2011-05-11Remove mod indices from the ASTMarijn Haverbeke-148/+27
They are now created by the resolve pass, which is the only pass that needs them, and kept internal to that pass.
2011-05-11Get rid of arm indicesMarijn Haverbeke-24/+3
2011-05-11Get rid of block indicesMarijn Haverbeke-55/+13
2011-05-11Use a const for crate-num-zero (ast.local_crate)Marijn Haverbeke-0/+1
2011-05-11Rewrite comp/middle/resolve.rsMarijn Haverbeke-13/+6
* 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-10rustc: Number everything with an annotationPatrick Walton-148/+166
2011-05-09Alias-ify fold and its users, remove another 85kb.Graydon Hoare-3/+4
2011-05-09Remove boxes from token.t.Graydon Hoare-42/+79