aboutsummaryrefslogtreecommitdiff
path: root/src/comp/driver
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-08-20 11:41:34 -0700
committerGraydon Hoare <[email protected]>2010-08-20 11:42:44 -0700
commit0f224f977d9edeb7f8ca56c052c1202fab384552 (patch)
tree2e9b93ce5e4eea139f44c747fd10679c1f4a03df /src/comp/driver
parentAdd _uint module to std, move some code around. (diff)
downloadrust-0f224f977d9edeb7f8ca56c052c1202fab384552.tar.xz
rust-0f224f977d9edeb7f8ca56c052c1202fab384552.zip
Expand rustc lexer to do almost-nearly-nontrivial stuff.
Diffstat (limited to 'src/comp/driver')
-rw-r--r--src/comp/driver/rustc.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs
index 67aa5308..42bd91c5 100644
--- a/src/comp/driver/rustc.rs
+++ b/src/comp/driver/rustc.rs
@@ -17,7 +17,7 @@ fn write_module() {
llvm.LLVMDisposeModule(llmod);
}
-fn main(vec[str] args) -> () {
+fn main(vec[str] args) {
log "This is the rust 'self-hosted' compiler.";
log "The one written in rust.";
@@ -30,6 +30,16 @@ fn main(vec[str] args) -> () {
auto p = parser.new_parser(filename);
log "opened file: " + filename;
auto tok = p.peek();
+ while (true) {
+ alt (tok) {
+ case (token.EOF()) { ret; }
+ case (_) {
+ log token.to_str(tok);
+ p.bump();
+ tok = p.peek();
+ }
+ }
+ }
}
i += 1;
}