From 1ef003c65df8b536b59bf4cb3ee39c2cf8753b51 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 26 May 2011 19:04:52 -0400 Subject: [PATCH] turning off debug prints; more directory reorganization. --- compiler.rkt | 14 ++++++------ parser/parse-bytecode-5.1.1.rkt | 2 +- path-rewriter.rkt => parser/path-rewriter.rkt | 22 +++++++++---------- .../browser-evaluate.rkt | 0 test-analyzer.rkt => tests/test-analyzer.rkt | 4 ++-- tests/test-assemble.rkt | 5 +++-- tests/test-browser-evaluate.rkt | 4 ++-- tests/test-conform-browser.rkt | 2 +- tests/test-earley-browser.rkt | 2 +- tests/test-parse.rkt | 2 +- 10 files changed, 29 insertions(+), 28 deletions(-) rename path-rewriter.rkt => parser/path-rewriter.rkt (84%) rename browser-evaluate.rkt => tests/browser-evaluate.rkt (100%) rename test-analyzer.rkt => tests/test-analyzer.rkt (59%) diff --git a/compiler.rkt b/compiler.rkt index 67532dd..42eaf26 100644 --- a/compiler.rkt +++ b/compiler.rkt @@ -338,12 +338,12 @@ (make-PerformStatement (make-MarkModuleInvoked! path)) ;; Module body definition: ;; 1. First invoke all the modules that this requires. - (make-DebugPrint (make-Const "handling internal requires")) + #;(make-DebugPrint (make-Const "handling internal requires")) (apply append-instruction-sequences (map compile-module-invoke (Module-requires mod))) ;; 2. Next, evaluate the module body. - (make-DebugPrint (make-Const (format "evaluating module body of ~s" path))) + #;(make-DebugPrint (make-Const (format "evaluating module body of ~s" path))) (make-PerformStatement (make-ExtendEnvironment/Prefix! names)) (make-AssignImmediateStatement (make-ModulePrefixTarget path) @@ -354,14 +354,14 @@ 'val next-linkage/drop-multiple) - (make-DebugPrint (make-Const (format "About to clean up ~s" path))) + #;(make-DebugPrint (make-Const (format "About to clean up ~s" path))) ;; 3. Finally, cleanup and return. (make-PopEnvironment (make-Const 1) (make-Const 0)) (make-AssignImmediateStatement 'proc (make-ControlStackLabel)) (make-PopControlFrame) - (make-DebugPrint (make-Const "Returning from module invokation.")) - (make-DebugPrint (make-Reg 'proc)) + #;(make-DebugPrint (make-Const "Returning from module invokation.")) + #;(make-DebugPrint (make-Reg 'proc)) (make-GotoStatement (make-Reg 'proc)) after-module-body)))])) @@ -403,7 +403,7 @@ ,(make-TestAndBranchStatement (make-TestTrue (make-IsModuleInvoked a-module-name)) already-loaded) - ,(make-DebugPrint (make-Const (format "entering module ~s" a-module-name))) + #;,(make-DebugPrint (make-Const (format "entering module ~s" a-module-name))) ,(make-PushControlFrame/Call on-return) ,(make-GotoStatement (ModuleEntry a-module-name)) ,on-return-multiple @@ -411,7 +411,7 @@ (make-Const 1)) (make-Const 0)) ,on-return - ,(make-DebugPrint (make-Const (format "coming back from module ~s" a-module-name))) + #;,(make-DebugPrint (make-Const (format "coming back from module ~s" a-module-name))) ,already-loaded)))])) diff --git a/parser/parse-bytecode-5.1.1.rkt b/parser/parse-bytecode-5.1.1.rkt index ffb173d..83fc82b 100644 --- a/parser/parse-bytecode-5.1.1.rkt +++ b/parser/parse-bytecode-5.1.1.rkt @@ -3,9 +3,9 @@ ;; Parsing Racket 5.1.1 bytecode structures into our own structures. (require "typed-module-path.rkt" "lam-entry-gensym.rkt" + "path-rewriter.rkt" "../expression-structs.rkt" "../lexical-structs.rkt" - "../path-rewriter.rkt" "../parameters.rkt" "../get-module-bytecode.rkt" syntax/modresolve diff --git a/path-rewriter.rkt b/parser/path-rewriter.rkt similarity index 84% rename from path-rewriter.rkt rename to parser/path-rewriter.rkt index cf3cdf5..7578547 100644 --- a/path-rewriter.rkt +++ b/parser/path-rewriter.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require "parameters.rkt" - "where-is-collects.rkt" +(require "../parameters.rkt" + "../where-is-collects.rkt" racket/path racket/contract racket/list @@ -13,10 +13,10 @@ -(define-runtime-path this-path ".") -(define this-normal-path +(define-runtime-path whalesong-path "..") +(define normal-whalesong-path (let () - (normalize-path this-path))) + (normalize-path whalesong-path))) @@ -31,16 +31,16 @@ (define (rewrite-path a-path) (let ([a-path (normalize-path a-path)]) (cond + [(within-this-project-path? a-path) + (string->symbol + (string-append "whalesong/" + (path->string + (find-relative-path normal-whalesong-path a-path))))] [(within-collects? a-path) (string->symbol (string-append "collects/" (path->string (find-relative-path collects-path a-path))))] - [(within-this-project-path? a-path) - (string->symbol - (string-append "whalesong/" - (path->string - (find-relative-path this-normal-path a-path))))] [(within-root? a-path) (string->symbol (string-append "root/" @@ -61,7 +61,7 @@ (define (within-this-project-path? a-path) - (within? this-normal-path a-path)) + (within? normal-whalesong-path a-path)) ;; within?: normalized-path normalized-path -> boolean diff --git a/browser-evaluate.rkt b/tests/browser-evaluate.rkt similarity index 100% rename from browser-evaluate.rkt rename to tests/browser-evaluate.rkt diff --git a/test-analyzer.rkt b/tests/test-analyzer.rkt similarity index 59% rename from test-analyzer.rkt rename to tests/test-analyzer.rkt index 77496dd..c54a03e 100644 --- a/test-analyzer.rkt +++ b/tests/test-analyzer.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require "make.rkt" - "make-structs.rkt") +(require "../make.rkt" + "../make-structs.rkt") ;; For some reason, this is breaking. Why? diff --git a/tests/test-assemble.rkt b/tests/test-assemble.rkt index 92f2356..1d051df 100644 --- a/tests/test-assemble.rkt +++ b/tests/test-assemble.rkt @@ -1,8 +1,9 @@ #lang racket -(require "../js-assembler/assemble.rkt" +(require "browser-evaluate.rkt" + "../js-assembler/assemble.rkt" "../js-assembler/get-runtime.rkt" - "../browser-evaluate.rkt" + "../lexical-structs.rkt" "../il-structs.rkt" racket/port diff --git a/tests/test-browser-evaluate.rkt b/tests/test-browser-evaluate.rkt index 9af66e5..fc7be50 100644 --- a/tests/test-browser-evaluate.rkt +++ b/tests/test-browser-evaluate.rkt @@ -1,6 +1,6 @@ #lang racket -(require "../js-assembler/get-runtime.rkt" - "../browser-evaluate.rkt" +(require "browser-evaluate.rkt" + "../js-assembler/get-runtime.rkt" "../js-assembler/package.rkt" "../make-structs.rkt") diff --git a/tests/test-conform-browser.rkt b/tests/test-conform-browser.rkt index aeb976b..ffe1fa1 100644 --- a/tests/test-conform-browser.rkt +++ b/tests/test-conform-browser.rkt @@ -1,5 +1,5 @@ #lang racket -(require "../browser-evaluate.rkt" +(require "browser-evaluate.rkt" "../js-assembler/package.rkt" "../js-assembler/get-runtime.rkt" "../make-structs.rkt" diff --git a/tests/test-earley-browser.rkt b/tests/test-earley-browser.rkt index 6ff42d5..6c554dc 100644 --- a/tests/test-earley-browser.rkt +++ b/tests/test-earley-browser.rkt @@ -1,5 +1,5 @@ #lang racket -(require "../browser-evaluate.rkt" +(require "browser-evaluate.rkt" "../js-assembler/package.rkt" "../js-assembler/get-runtime.rkt" "../make-structs.rkt" diff --git a/tests/test-parse.rkt b/tests/test-parse.rkt index de996f3..6c5e843 100644 --- a/tests/test-parse.rkt +++ b/tests/test-parse.rkt @@ -1,9 +1,9 @@ #lang racket/base (require "../parser/baby-parser.rkt" + "../parser/lam-entry-gensym.rkt" "../lexical-structs.rkt" "../expression-structs.rkt" - "../lam-entry-gensym.rkt" (for-syntax racket/base)) (printf "test-parse.rkt\n");