about summary refs log tree commit diff
path: root/src/comp/front/parser.rs
AgeCommit message (Collapse)AuthorLines
2011-05-27Change the syntax for RECV from "var <- port" to "port |> var".Michael Sullivan-2/+2
2011-05-27Remove parser support for recv as an initializer in preparation for changing ↵Michael Sullivan-5/+7
the recv syntax.
2011-05-27Parsing and folding changes for globbed imports.Paul Stansifer-12/+41
2011-05-26Remove redisue of unused fields from 'ann'.Graydon Hoare-4/+1
2011-05-26Remove residual uses of fold, and fold itself.Graydon Hoare-1/+1
2011-05-20Merge remote-tracking branch 'graydon/master' into typestate_4Tim Chevalier-2/+2
2011-05-20Annotate erroring functions in session and parserTim Chevalier-3/+3
2011-05-20More work on anonymous objects.Lindsey Kuper-2/+2
2011-05-20Make controlflow part of a function typeTim Chevalier-15/+25
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-2/+2
data structures
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-3/+2
2011-05-17rustc: Flatten annotationsPatrick Walton-1/+5
2011-05-17Alias-ify the parser and lexerMarijn Haverbeke-111/+109
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-31/+31
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-9/+33
Conflicts: src/comp/middle/trans.rs
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-39/+39
2011-05-16Begin vec() -> [] transition.Graydon Hoare-3/+3
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-9/+33
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-2/+4
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-15/+15
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-51/+43
2011-05-13Bug fixes.Lindsey Kuper-8/+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-4/+3
2011-05-13Starting on support for anonymous objects. Just syntax so far.Lindsey Kuper-0/+50
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-800/+606
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-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-807/+808
This should be a snapshot transition.
2011-05-12Change module dereference syntax from . to ::Marijn Haverbeke-55/+17
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-10/+14
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-11Remove unused filename parameter from lexer.new_readerBrian Anderson-1/+1
2011-05-11Give the lexer a session so that it can fail more informativelyBrian Anderson-1/+1
2011-05-11Remove mod indices from the ASTMarijn Haverbeke-28/+10
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-23/+2
2011-05-11Get rid of block indicesMarijn Haverbeke-10/+1
2011-05-11Rewrite comp/middle/resolve.rsMarijn Haverbeke-2/+1
* 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-76/+85
2011-05-09Remove boxes from token.t.Graydon Hoare-25/+40
2011-05-06Rename std modules to be camelcasedMarijn Haverbeke-37/+37
(Have fun mergining your stuff with this.)
2011-05-05Bring back "pred" syntax for writing predicates for checkTim Chevalier-11/+21
This commit reinstates the requirement that the predicate in a "check" must be a manifest call to a special kind of function declared with the new "pred" keyword instead of "fn". Preds must have a boolean return type and can only call other preds; they can't have any effects (as enforced by the typechecker). The arguments to a predicate in a check expression must be slot variables or literals.
2011-05-05Remove 'deprecated mutable...' from our codeMarijn Haverbeke-1/+1
This should make compilation a bit less noisy.
2011-05-04Add #env syntax extension for plucking strings out of the compilation ↵Graydon Hoare-0/+7
environment.
2011-05-03rustc: Stub support for Rust intrinsicsPatrick Walton-0/+2
2011-05-03Revert "Rename the "llvm" API to "llvm-intrinsic"" due to tinderbox bustagePatrick Walton-1/+1
This reverts commit 6871c245a67fab222eccc2a21dcb620d11d3b0d0.