Commit Graph

2558 Commits

Author SHA1 Message Date
Patrick Walton
8a8f68aa75 rustc: Make typeck::instantiate_path() not return an annotation 2011-05-13 10:53:55 -07:00
Marijn Haverbeke
ae26b775b4 Implement module namespaces
Module names no longer clash with type and value names. The
tokenizer/parser still needs to be taught to be more careful in
identifying keywords, so that we can use 'str' and 'vec' and so as
module names.
2011-05-13 17:20:46 +02:00
Marijn Haverbeke
eb419fd8c7 Extend crate format to allow multiple definitions for a single name
The type/value namespace distinction pretty much works now. Module
namespace is up next.
2011-05-13 17:20:39 +02:00
Marijn Haverbeke
1a12a7b04b Make module indices hold a list of items
This way, they can support having both a type and a value
of the same name.
2011-05-13 13:34:59 +02:00
Marijn Haverbeke
58ec5d1654 Move capture checking into resolve.rs
Drops capture.rs. The new algorithm also checks for captures function
arguments and obj fields.
2011-05-13 12:44:05 +02:00
Marijn Haverbeke
89490e416b Change resolve to use walk instead of fold
Possibly, at some point, we should add a state-passing variant of
walk, or a wrapper that makes it easier to thread state. (See the
repetetive pop_state_for_* functions in this commit.)
2011-05-13 11:35:25 +02:00
Marijn Haverbeke
7082bf4478 Ensure visit_ty is called on type parameters during walk 2011-05-13 11:35:25 +02:00
Marijn Haverbeke
39a000714a Add visit_arm and visit_method to walk.rs
The resolver needs to update its state for individual arms and
methods.
2011-05-13 11:34:51 +02:00
Brian Anderson
2896a866d6 Change fuzzer to match new module standards 2011-05-12 22:45:55 -04:00
Brian Anderson
02fdd2d2d9 Rename std.extfmt.CT to std.extfmt.RT to ct and rt
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-12 22:22:28 -04:00
Patrick Walton
5295a4dabd rustc: Flatten recursive vectors in trans::simplify_type(). Prevents an infinite loop. 2011-05-12 18:37:28 -07:00
Patrick Walton
b163247d4e rustc: Beginnings of a "shape" module to convert types to shapes 2011-05-12 18:30:21 -07:00
Patrick Walton
033b38b636 rustc: Make ty::expr_ann() terser 2011-05-12 16:57:08 -07:00
Patrick Walton
0b7dd0d918 rustc: Pass a node type table around, unused as of yet 2011-05-12 16:41:55 -07:00
Graydon Hoare
5ceaf345ed Add stats option and lazily emit glue. 2011-05-12 15:42:51 -07:00
Patrick Walton
295c037aac etc: Update rust.vim with new keywords; color types differently from keywords 2011-05-12 14:32:54 -07:00
Graydon Hoare
1fdddede22 Add snap-stageN targets. 2011-05-12 13:08:57 -07:00
Graydon Hoare
b64098e58c Register new snapshots for incompatible-syntax transition. 2011-05-12 13:03:05 -07:00
Marijn Haverbeke
9419c5df77 Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
Marijn Haverbeke
3816e57fd2 Downcase std modules again, move to :: for module dereferencing
This should be a snapshot transition.
2011-05-12 21:30:44 +02:00
Marijn Haverbeke
b1d3364487 Transitional change to make extfmt output lowercase module name 2011-05-12 21:30:43 +02:00
Marijn Haverbeke
6510f1ce7c Change module dereference syntax from . to ::
This will need to be a snapshot.
2011-05-12 21:30:35 +02:00
Marijn Haverbeke
dd9b6dccb4 Remove some truly wrong logic in parse_constrs 2011-05-12 15:52:12 +02:00
Marijn Haverbeke
358a1aeec9 Keep resolve data in external hash table, rather than embedded defs
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-12 15:40:21 +02:00
Marijn Haverbeke
2b36e40c58 Ensure ann tags are actually kept around during typechecking
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-12 10:51:13 +02:00
Marijn Haverbeke
079512494f Properly lex block comments followed by EOF 2011-05-12 09:31:06 +02:00
Marijn Haverbeke
d719b5cae7 Provide a more useful message when failing to translate a const 2011-05-12 09:17:59 +02:00
Brian Anderson
353ed4bdff Remove unused filename parameter from lexer.new_reader 2011-05-11 23:38:20 -04:00
Brian Anderson
a459bcd127 Give the lexer a session so that it can fail more informatively 2011-05-11 23:04:16 -04:00
Patrick Walton
531515d7ae rustc: Represent types as uints. Cuts typechecking down from 14s to 12s. 2011-05-11 17:05:39 -07:00
Patrick Walton
da09a0320e rustc: Remove a few kludges intended to work around rustboot's lack of structural comparison from equal_type_structures() 2011-05-11 16:18:02 -07:00
Patrick Walton
6953841e25 rustc: Remove magic numbers; they aren't a win 2011-05-11 16:10:17 -07:00
Patrick Walton
df914e8904 rustc: Intern all types. 4s regression. 2011-05-11 15:56:23 -07:00
Patrick Walton
26ab36afb1 rustc: Hoist derived type descriptors to the top of the function 2011-05-11 12:05:02 -07:00
Graydon Hoare
c787d6d4f3 Change 'check' make target to just stage2 tests; add full-check for all of them. 2011-05-11 09:37:23 -07:00
Graydon Hoare
927138016a Register new snapshots. 2011-05-11 09:35:58 -07:00
Marijn Haverbeke
14f1fe0e29 Remove mod indices from the AST
They are now created by the resolve pass, which is the only pass that
needs them, and kept internal to that pass.
2011-05-11 17:11:44 +02:00
Marijn Haverbeke
5bea22d75c Add a missed xfail-stage0 2011-05-11 16:44:42 +02:00
Marijn Haverbeke
88621bc53c Remove a few more 'mutable' words
Didn't see these before because they live in non-Linux code.
2011-05-11 15:39:39 +02:00
Marijn Haverbeke
fe29d24b6e Get rid of arm indices 2011-05-11 15:26:36 +02:00
Marijn Haverbeke
5405f45274 Get rid of block indices 2011-05-11 15:10:24 +02:00
Marijn Haverbeke
7d086df095 Stop depending on block indices in capture.rs 2011-05-11 13:49:48 +02:00
Marijn Haverbeke
9cb20153a8 Hash only on def_num when storing def_ids that are local 2011-05-11 13:06:43 +02:00
Marijn Haverbeke
7f222423b7 Use a const for crate-num-zero (ast.local_crate) 2011-05-11 12:59:34 +02:00
Marijn Haverbeke
6b46113afc Cache external crate lookups in resolve.rs
According to --time-passes, resolution went from 2 to 0 seconds. Not
really the bottleneck... but if we want to be crazy fast, just
consider this a future bottleneck that was fixed very timely.
2011-05-11 12:32:37 +02:00
Marijn Haverbeke
e9c12ab1d0 Rewrite comp/middle/resolve.rs
* 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-11 12:32:37 +02:00
Brian Anderson
e4c3287367 Reuse a single work buffer every time the SHA1 message block is processed.
This finally allows the full lib-sha1 test to run in a reasonable amount of
time. Was 30s, now 3s. Trims a second or two from stage2/rustc. XFAIL lib-sha1
in stage0 since it will be very slow until the next snapshot.
2011-05-11 01:38:17 -04:00
Brian Anderson
7e7d134e3c Remove unnecessary array access from SHA1
Provides a very small speedup.
2011-05-11 01:38:17 -04:00
Brian Anderson
e35984b6c6 Introduce str_slice runtime function
This reduces the time to execute the new lib-str tests from 1:40ish to a few
seconds and will eventually allow the full lib-sha1 test to run in a
reasonable amount of time. XFAIL lib-str in stage0 - it will run very slowly
until the next snapshot.
2011-05-11 01:38:16 -04:00
Graydon Hoare
dc0aab47a7 More alias-ification of trans. 2011-05-11 05:11:59 +00:00