aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
Commit message (Collapse)AuthorAgeFilesLines
* 'with' no longer a token; whitespace police.Lindsey Kuper2011-05-131-9/+5
| | | | | Plus renaming the anonymous objects test to a more descriptive name, and XFAILing it because it doesn't work yet.
* Use new module namespace syntax.Lindsey Kuper2011-05-131-51/+43
|
* Bug fixes.Lindsey Kuper2011-05-131-8/+22
| | | | | Fixed infinite loop on anonymous objects in parser; added expr_anon_obj to walk.rs; fixed syntax of test case.
* More progress on anonymous objects.Lindsey Kuper2011-05-131-8/+9
| | | | Still segfaulting on the method-overriding.rs test, though.
* Correct capitalization of "Option".Lindsey Kuper2011-05-131-4/+3
|
* Starting on support for anonymous objects. Just syntax so far.Lindsey Kuper2011-05-131-0/+50
|
* Safeguard against using statement or item keywords as value idsMarijn Haverbeke2011-05-131-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'.
* Make the parser more careful about keywordsMarijn Haverbeke2011-05-131-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.
* Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke2011-05-121-807/+808
| | | | This should be a snapshot transition.
* Change module dereference syntax from . to ::Marijn Haverbeke2011-05-121-55/+17
| | | | This will need to be a snapshot.
* Remove some truly wrong logic in parse_constrsMarijn Haverbeke2011-05-121-13/+8
|
* Keep resolve data in external hash table, rather than embedded defsMarijn Haverbeke2011-05-121-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.)
* Remove unused filename parameter from lexer.new_readerBrian Anderson2011-05-111-1/+1
|
* Give the lexer a session so that it can fail more informativelyBrian Anderson2011-05-111-1/+1
|
* Remove mod indices from the ASTMarijn Haverbeke2011-05-111-28/+10
| | | | | They are now created by the resolve pass, which is the only pass that needs them, and kept internal to that pass.
* Get rid of arm indicesMarijn Haverbeke2011-05-111-23/+2
|
* Get rid of block indicesMarijn Haverbeke2011-05-111-10/+1
|
* Rewrite comp/middle/resolve.rsMarijn Haverbeke2011-05-111-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)
* rustc: Number everything with an annotationPatrick Walton2011-05-101-76/+85
|
* Remove boxes from token.t.Graydon Hoare2011-05-091-25/+40
|
* Rename std modules to be camelcasedMarijn Haverbeke2011-05-061-37/+37
| | | | (Have fun mergining your stuff with this.)
* Bring back "pred" syntax for writing predicates for checkTim Chevalier2011-05-051-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.
* Remove 'deprecated mutable...' from our codeMarijn Haverbeke2011-05-051-1/+1
| | | | This should make compilation a bit less noisy.
* Add #env syntax extension for plucking strings out of the compilation ↵Graydon Hoare2011-05-041-0/+7
| | | | environment.
* rustc: Stub support for Rust intrinsicsPatrick Walton2011-05-031-0/+2
|
* Revert "Rename the "llvm" API to "llvm-intrinsic"" due to tinderbox bustagePatrick Walton2011-05-031-1/+1
| | | | This reverts commit 6871c245a67fab222eccc2a21dcb620d11d3b0d0.
* Start sketching --depend support in rustc.Graydon Hoare2011-05-031-1/+6
|
* Rename the "llvm" API to "llvm-intrinsic"Patrick Walton2011-05-031-1/+1
|
* Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton2011-05-021-19/+23
| | | | | | the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
* Revert "Use different syntax for checks that matter to typestate"Graydon Hoare2011-05-021-23/+19
| | | | This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.
* Use different syntax for checks that matter to typestateTim Chevalier2011-05-021-19/+23
| | | | | | | | | | This giant commit changes the syntax of Rust to use "assert" for "check" expressions that didn't mean anything to the typestate system, and continue using "check" for checks that are used as part of typestate checking. Most of the changes are just replacing "check" with "assert" in test cases and rustc.
* Fix the signature of expr_extBrian Anderson2011-04-211-2/+2
| | | | The extension body is just a string, not an expression.
* rustc: Make the parser never assign any types, not even ty_nilPatrick Walton2011-04-211-5/+4
|
* Remove half-baked 'opacity' layer qualifier.Graydon Hoare2011-04-191-14/+0
|
* Remove effect system from src.Graydon Hoare2011-04-191-147/+128
|
* add log_err to rustcMarijn Haverbeke2011-04-191-2/+9
|
* Work on destructors, not entirely functional yet (no tydesc integration).Graydon Hoare2011-04-141-3/+21
|
* typestate_check can now handle expr_block, expr_if, and expr_binaryTim Chevalier2011-04-121-1/+1
| | | | | | | | | | | | | | | | (caveat for the latter: it assumes that binary operations are strict; a TODO is to detect or and and and correctly reflect that they're lazy in the second argument). I had to add an ann field to ast.block, resulting in the usual boilerplate changes. Test cases that currently work (if you uncomment the typestate pass in the driver) (all these are under test/compile-fail): fru-typestate ret-uninit use-uninit use-uninit-2 use-uninit-3
* rustc: Switch to indices for type parametersPatrick Walton2011-04-121-2/+1
|
* Further work on typestate. Handles expr_rec and expr_assign now.Tim Chevalier2011-04-121-7/+9
| | | | | | | | | | | | Also changed the ts_ann field on statements to be an ann instead, which explains most of the changes. As well, got rid of the "warning: no type for expression" error by filling in annotations for local decls in typeck (not sure whether this was my fault or not). Finally, in bitv, added a clone() function to copy a bit vector, and fixed is_true, is_false, and to_str to not be nonsense.
* Move to single-uint file-position representation.Marijn Haverbeke2011-04-091-209/+204
| | | | | | | | This makes passing them around cheaper. There is now a table (see front/codemap.rs) that is needed to transform such an uint into an actual filename/line/col location. Also cleans up the span building in the parser a bit.
* Support for self-calls that take arguments.Lindsey Kuper2011-04-071-3/+10
| | | | | | | Nicer parsing of self-calls (expr_self_method nodes inside expr_call nodes, rather than a separate expr_call_self) makes typechecking tractable. We can now write self-calls that take arguments and return values (see: test/run-pass/obj-self-*.rs).
* Continued sketching out code for checking states against preconditions.Tim Chevalier2011-04-061-7/+8
| | | | | | | | | It's still sketchy. I added a typestate annotation field to statements tagged stmt_decl or stmt_expr, because a stmt_decl statement has a typestate that's different from that of its child node. This necessitated trivial changes to a bunch of other files all over to the compiler. I also added a few small standard library functions, some of which I didn't actually end up using but which I thought might be useful anyway.
* Last pieces of self-call support.Lindsey Kuper2011-04-051-1/+1
| | | | | | | | The last few pieces of the hack that lets us use trans.trans_call() to translate self-calls, plus a fix for the parser buy that was preventing self-call expressions from getting past parsing. test/run-pass/obj-self.rs works now (as in it actually prints "hi!" twice!).
* Further on the path toward self-awareness.Lindsey Kuper2011-04-051-1/+3
| | | | | | | | | | | | | Mostly: * Merciless refactoring of trans.rs so that trans_call can work for self-calls as well as other kinds of calls Also: * Various changes to go with having idents, rather than exprs, in expr_call_self AST nodes * Added missing case for SELF token to token.to_str()
* Make box prefix operator and box type carry mutability flag.Graydon Hoare2011-04-041-1/+2
|
* Started adding support for typestate checking.Tim Chevalier2011-04-011-18/+18
| | | | | | | | | | | | | | | I added a new field to the ast "ann" type for typestate information. Currently, the field contains a record of a precondition bit vector and postcondition vector, but I tried to structure things so as to make it easy to change the representation of the typestate annotation type. I also had to add annotations to some syntactic forms that didn't have them before (fail, ret, be...), with all the boilerplate changes that that would imply. The main call to the typestate_check entry point is commented out and the actual pre-postcondition algorithm only has a few cases implemented, though the overall AST traversal is there. The rest of the typestate algorithm isn't implemented yet.
* rustc: Add a type annotation to tag itemsPatrick Walton2011-03-311-1/+2
|
* Remove redundant parser logic.Brian Anderson2011-03-311-33/+0
| | | | These cases are all dealt with in parse_expr_inner.
* Improve line comment positioningMarijn Haverbeke2011-03-311-3/+7
| | | | This involved making ast.variant spanned.