aboutsummaryrefslogtreecommitdiff
path: root/src/comp/pretty
Commit message (Collapse)AuthorAgeFilesLines
* Handle nested items correctly in typestate_checkTim Chevalier2011-04-191-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Summary says it all. Actually, only nested objects and functions are handled, but that's better than before. The fold that I was using before to traverse a crate wasn't working correctly, because annotations have to reflect the number of local variables of the nearest enclosing function (in turn, because annotations are represented as bit vectors). The fold was traversing the AST in the wrong order, first filling in the annotations correctly, but then re-traversing them with the bit vector length for any outer nested functions, and so on. Remedying this required writing a lot of tedious boilerplate code because I scrapped the idea of using a fold altogether. I also made typestate_check handle unary, field, alt, and fail. Also, some miscellaneous changes: * added annotations to blocks in typeck * fix pprust so it can handle spawn * added more logging functions in util.common * fixed _vec.or * added maybe and from_maybe in option * removed fold_block field from ast_fold, since it was never used
* Remove effect system from src.Graydon Hoare2011-04-192-80/+70
|
* add log_err to rustcMarijn Haverbeke2011-04-191-2/+5
|
* Work on destructors, not entirely functional yet (no tydesc integration).Graydon Hoare2011-04-141-2/+2
|
* rustc: Remove generalize_ty. Instead, maintain an explicit type parameter ↵Patrick Walton2011-04-141-0/+9
| | | | substitution list.
* rustc: Switch to indices for type parametersPatrick Walton2011-04-121-1/+1
|
* rustc: Add "float" as a type to the pretty printerPatrick Walton2011-04-121-0/+1
|
* Move to single-uint file-position representation.Marijn Haverbeke2011-04-091-15/+4
| | | | | | | | 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-4/+1
| | | | | | | 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-2/+2
| | | | | | | | | 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.
* Further on the path toward self-awareness.Lindsey Kuper2011-04-051-2/+6
| | | | | | | | | | | | | 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()
* Oops -- if we're going to use the pretty-printer, we need it to work.Lindsey Kuper2011-04-051-0/+5
|
* Started adding support for typestate checking.Tim Chevalier2011-04-011-8/+8
| | | | | | | | | | | | | | | 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.
* Add block_to_str and expr_to_str methods to the pprust module.Brian Anderson2011-03-311-0/+18
| | | | Since pprust is authed impure these can be used for debug logging.
* rustc: Add a type annotation to tag itemsPatrick Walton2011-03-311-1/+1
|
* More stuff to go with the new expr_call_self AST nodeLindsey Kuper2011-03-311-0/+7
|
* Improve line comment positioningMarijn Haverbeke2011-03-311-27/+64
| | | | This involved making ast.variant spanned.
* Support break and cont in pretty-printerMarijn Haverbeke2011-03-311-0/+6
|
* Add effect field to ast.ty_fn.Marijn Haverbeke2011-03-311-4/+9
| | | | Still not used, except by the pretty-printer.
* Preserve comments when pretty-printing.Marijn Haverbeke2011-03-312-786/+976
| | | | | The patch also includes a number of smaller fixes to the pretty-printer that were encountered on the way.
* Update pretty printer for ports, channels, send and receiveBrian Anderson2011-03-251-1/+33
|
* Refactor ast.local to make room for initialization via recvBrian Anderson2011-03-251-2/+2
|
* make lexer unicode-aware for strings and char literalsMarijn Haverbeke2011-03-251-1/+0
|
* fix pretty-printerMarijn Haverbeke2011-03-251-6/+10
| | | | | | A change in 54587bdccb7b6771cfc704a30fc0ef2c65824a15 (the vec appending overhaul) had broken it. (Apparently modifying a vec while iterating over it can corrupt memory.)
* Started adding support for floating-point type, floating-point literals, and ↵Tim Chevalier2011-03-211-0/+3
| | | | logging of floats. Other operations on float probably don't work yet.
* Modify native_item_fn to handle trailing linkage names that differ from the ↵Graydon Hoare2011-03-201-1/+5
| | | | item name (used in win32 build of std.dll)
* rustc: Implement "mutable?". Add a test case and XFAIL it in rustboot for now.Patrick Walton2011-03-181-2/+4
|
* rustc: Switch mutability from being a type constructor to a field annotationPatrick Walton2011-03-171-25/+30
|
* Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. ↵Graydon Hoare2011-03-162-7/+9
| | | | Tweak std lib vec fns in process.
* rustc: Add an annotation for the crate definition to view_item_usePatrick Walton2011-03-151-1/+1
|
* Merge remote branch 'brson/recursive-elseif'Graydon Hoare2011-03-141-18/+10
|\
| * Merge branch 'master' into recursive-elseifBrian Anderson2011-03-132-34/+84
| |\ | | | | | | | | | | | | | | | Conflicts: src/comp/middle/typeck.rs
| * | Merge branch 'master' into recursive-elseifBrian Anderson2011-03-071-18/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/Makefile src/comp/front/ast.rs src/comp/front/parser.rs src/comp/middle/fold.rs src/comp/middle/trans.rs
* | | Make pretty-printer print 'with' clause in rec literalsMarijn Haverbeke2011-03-141-1/+11
| |/ |/|
* | Add ty_obj case to pretty printerMarijn Haverbeke2011-03-091-16/+37
| |
* | Have the pretty-printer take a writer stream as argumentMarijn Haverbeke2011-03-092-17/+36
| | | | | | | | | | It now uses a string writer to also fill in for middle.ty.ast_ty_to_str
* | Add partial pretty-printing for syntax extensionsBrian Anderson2011-03-071-1/+10
| |
* | Add missing alt arm to expr_if pretty-printerBrian Anderson2011-03-071-0/+1
|/
* Add a pretty-printerMarijn Haverbeke2011-03-072-0/+923
Adds a -pp option to the compiler which will cause it to simply pretty-print the given file.