Patrick Walton
e0faf57313
rustc: Factor out expr_ty() into expr_ann() and expr_ty()
2011-04-11 15:05:39 -07:00
Patrick Walton
3efb7f5459
rustc: Push down types for all expressions; add logic for recv and send
2011-04-08 18:14:31 -07:00
Lindsey Kuper
1092bbfff0
Support for self-calls that take arguments.
...
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).
2011-04-07 14:26:34 -07:00
Tim Chevalier
2e90bd94de
Continued sketching out code for checking states against preconditions.
...
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.
2011-04-06 17:58:18 -07:00
Lindsey Kuper
4fc8de1969
Last pieces of self-call support.
...
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!).
2011-04-05 16:26:31 -07:00
Graydon Hoare
70e5457d7c
Make box prefix operator and box type carry mutability flag.
2011-04-04 15:44:15 -07:00
Tim Chevalier
3130348ee1
Started adding support for typestate checking.
...
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.
2011-04-01 11:27:32 -07:00
Patrick Walton
c66edca83d
rustc: Add a type annotation to tag items
2011-03-31 19:12:40 -07:00
Patrick Walton
1eeedbd008
rustc: Make tag_ty_params() and substitute_ty_params() take def ids instead of ty_params, and to check in external crates
2011-03-31 18:45:24 -07:00
Patrick Walton
cc59cea8b0
rustc: Thread an item-to-type mapping throughout the typechecking and translation phases
2011-03-30 17:28:06 -07:00
Lindsey Kuper
55fbed3d8d
Beginnings of support for magical self prefix; nothing profound happening yet.
2011-03-29 15:59:15 -07:00
Brian Anderson
2b27d12ce1
Add expr_spawn, spawn parsing, folding, typechecking, ty_task
2011-03-28 21:13:53 -07:00
Graydon Hoare
b2427509e2
Another go at changing compile-command, this time using RBUILD env var.
2011-03-25 15:07:27 -07:00
Graydon Hoare
91c2b82b09
Revert "Bulk-edit compile commands in emacs chatter to point to assumed build/ dir off src root."
...
This reverts commit 846f2e2ba994268725f38c36fa12f1a09f21615c.
2011-03-25 14:05:38 -07:00
Graydon Hoare
846f2e2ba9
Bulk-edit compile commands in emacs chatter to point to assumed build/ dir off src root.
2011-03-25 13:48:37 -07:00
Patrick Walton
77a3373d53
rustc: Create a crate metadata cache
2011-03-25 10:44:24 -07:00
Lindsey Kuper
0ce0c4c41a
Support for shorter error messages that are aware of objects' cnames.
2011-03-22 14:23:43 -07:00
Brian Anderson
261d1e4c61
Add codegen for ports and chans
2011-03-22 08:04:38 -07:00
Tim Chevalier
1e1ff638a3
Make floating-point operations work (neg, add, sub, mul, div, rem,
...
and comparison ops.)
2011-03-21 18:10:34 -07:00
Tim Chevalier
caa22c9341
Started adding support for floating-point type, floating-point literals, and logging of floats. Other operations on float probably don't work yet.
2011-03-21 18:10:34 -07:00
Graydon Hoare
4b946cea35
Modify native_item_fn to handle trailing linkage names that differ from the item name (used in win32 build of std.dll)
2011-03-20 20:18:19 -07:00
Patrick Walton
2ef9c01ffc
rustc: Implement "mutable?". Add a test case and XFAIL it in rustboot for now.
2011-03-18 11:49:47 -07:00
Patrick Walton
5eca7129e3
rustc: Switch mutability from being a type constructor to a field annotation
2011-03-17 17:39:47 -07:00
Patrick Walton
67bac63aa3
rustc: Correctly report mutability when stringifying types
2011-03-17 11:54:00 -07:00
Patrick Walton
2ca66718ce
rustc: Consider native types to be scalar
2011-03-17 11:46:21 -07:00
Patrick Walton
55587a554c
rustc: Sort object methods when parsing textual types in the AST
2011-03-17 11:40:05 -07:00
Graydon Hoare
54587bdccb
Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. Tweak std lib vec fns in process.
2011-03-16 14:58:02 -07:00
Graydon Hoare
7f5bffc3ea
Merge remote branch 'brson/recursive-elseif'
2011-03-14 16:59:04 -07:00
Brian Anderson
4ce4d8857f
Add ty_port and ty_chan to expr_ty function
2011-03-14 16:41:46 -07:00
Brian Anderson
7464237256
Add folding and type checking for ports and chans
2011-03-14 16:41:46 -07:00
Brian Anderson
bbb6836da0
Merge branch 'master' into recursive-elseif
...
Conflicts:
src/comp/middle/typeck.rs
2011-03-13 19:40:25 -04:00
Graydon Hoare
8e8c336f93
Implement deep structural comparison through boxes and sequences.
2011-03-09 20:14:19 -08:00
Marijn Haverbeke
aed40fbcd8
Have the pretty-printer take a writer stream as argument
...
It now uses a string writer to also fill in for
middle.ty.ast_ty_to_str
2011-03-09 16:15:55 -08:00
Patrick Walton
e9fe47b359
rustc: Make ann_to_type() fail if the node has no type. Miraculously, no test cases fail.
2011-03-08 17:03:00 -08:00
Patrick Walton
4654faa67c
rustc: Add a slot for explicit type parameter instantations to the typechecker's AST annotation
2011-03-08 12:42:56 -08:00
Brian Anderson
9fc4db6b89
Merge branch 'master' into recursive-elseif
...
Conflicts:
src/Makefile
src/comp/front/ast.rs
src/comp/front/parser.rs
src/comp/middle/fold.rs
src/comp/middle/trans.rs
2011-03-07 21:21:01 -05:00
Marijn Haverbeke
0624f9db4a
Add a pretty-printer
...
Adds a -pp option to the compiler which will cause it to simply
pretty-print the given file.
2011-03-07 12:58:08 -08:00
Rafael Ávila de Espíndola
8047957b99
Construct the wrappers to native functions. Hello world now works :-)
2011-03-07 15:37:40 -05:00
Brian Anderson
d39da6f978
Remove typestate workarounds
2011-03-06 15:13:35 -08:00
Graydon Hoare
d97c800e31
Make ret and fail stmts have 0 out-edges, Closes #250 .
2011-03-05 20:05:02 +00:00
Graydon Hoare
652cb48475
Assortment of additional work on vec-append. Not done yet.
2011-03-03 18:18:59 -08:00
Patrick Walton
04a0a6fbef
Revert "rustc: Add support for folding over tag types" as it's unnecessary. Oops.
2011-03-03 17:09:20 -08:00
Patrick Walton
f6682280f3
rustc: Add support for folding over tag types
2011-03-03 16:54:15 -08:00
Rafael Ávila de Espíndola
da8058ff83
Handle native types in calls.
2011-03-03 16:44:15 -05:00
Graydon Hoare
dddeba19d3
Sketch out some more pieces of vec-append.
2011-03-02 16:42:19 -08:00
Brian Anderson
f1500e5872
Add fold, typecheck and trans for expr_ext
2011-03-02 10:28:14 -08:00
Patrick Walton
8d8b3d985a
rustc: Mark tags that have subtypes with dynamic size as dynamic
2011-02-28 19:07:26 -08:00
Patrick Walton
0120571e90
rustc: Make the tag info table keyed by both tag ID and type parameter. Also fix a bug that was causing all tags to compare equal.
2011-02-25 19:42:26 -08:00
Rafael Ávila de Espíndola
081c3aa76d
Pass the abi of native functions all the way to codegen.
2011-02-25 15:58:08 -05:00
Patrick Walton
19b2850388
rustc: Perform type parameter substitutions when emitting glue for generic tags. Un-XFAIL generic-tag.rs.
2011-02-24 19:25:05 -08:00