diff --git a/analyzer-structs.rkt b/compiler/analyzer-structs.rkt similarity index 100% rename from analyzer-structs.rkt rename to compiler/analyzer-structs.rkt diff --git a/analyzer.rkt b/compiler/analyzer.rkt similarity index 100% rename from analyzer.rkt rename to compiler/analyzer.rkt diff --git a/bootstrapped-primitives.rkt b/compiler/bootstrapped-primitives.rkt similarity index 98% rename from bootstrapped-primitives.rkt rename to compiler/bootstrapped-primitives.rkt index a1b1020..6e555ea 100644 --- a/bootstrapped-primitives.rkt +++ b/compiler/bootstrapped-primitives.rkt @@ -6,12 +6,12 @@ "compiler-structs.rkt") -(require/typed "parameters.rkt" +(require/typed "../parameters.rkt" (current-defined-name (Parameterof (U Symbol LamPositionalName)))) -(require/typed "parser/parse-bytecode.rkt" +(require/typed "../parser/parse-bytecode.rkt" (parse-bytecode (Path -> Expression))) -(require/typed "parser/baby-parser.rkt" +(require/typed "../parser/baby-parser.rkt" [parse (Any -> Expression)]) diff --git a/compiler-structs.rkt b/compiler/compiler-structs.rkt similarity index 100% rename from compiler-structs.rkt rename to compiler/compiler-structs.rkt diff --git a/compiler.rkt b/compiler/compiler.rkt similarity index 99% rename from compiler.rkt rename to compiler/compiler.rkt index 42eaf26..022fed4 100644 --- a/compiler.rkt +++ b/compiler/compiler.rkt @@ -6,10 +6,10 @@ "compiler-structs.rkt" "kernel-primitives.rkt" "optimize-il.rkt" - "parameters.rkt" - "sets.rkt" "analyzer-structs.rkt" "analyzer.rkt" + "../parameters.rkt" + "../sets.rkt" racket/match racket/bool racket/list) diff --git a/expression-structs.rkt b/compiler/expression-structs.rkt similarity index 100% rename from expression-structs.rkt rename to compiler/expression-structs.rkt diff --git a/il-structs.rkt b/compiler/il-structs.rkt similarity index 100% rename from il-structs.rkt rename to compiler/il-structs.rkt diff --git a/kernel-primitives.rkt b/compiler/kernel-primitives.rkt similarity index 100% rename from kernel-primitives.rkt rename to compiler/kernel-primitives.rkt diff --git a/lexical-env.rkt b/compiler/lexical-env.rkt similarity index 99% rename from lexical-env.rkt rename to compiler/lexical-env.rkt index 452ee8b..8a8c587 100644 --- a/lexical-env.rkt +++ b/compiler/lexical-env.rkt @@ -2,7 +2,7 @@ (require racket/list "lexical-structs.rkt" - "sets.rkt") + "../sets.rkt") (provide find-variable extend-lexical-environment extend-lexical-environment/names diff --git a/lexical-structs.rkt b/compiler/lexical-structs.rkt similarity index 100% rename from lexical-structs.rkt rename to compiler/lexical-structs.rkt diff --git a/optimize-il.rkt b/compiler/optimize-il.rkt similarity index 100% rename from optimize-il.rkt rename to compiler/optimize-il.rkt diff --git a/racket-expander.rkt b/experiments/racket-expander.rkt similarity index 100% rename from racket-expander.rkt rename to experiments/racket-expander.rkt diff --git a/get-dependencies.rkt b/get-dependencies.rkt index 2f736b7..ec0b39b 100644 --- a/get-dependencies.rkt +++ b/get-dependencies.rkt @@ -1,6 +1,6 @@ #lang typed/racket/base -(require "expression-structs.rkt" - "lexical-structs.rkt" +(require "compiler/expression-structs.rkt" + "compiler/lexical-structs.rkt" "sets.rkt" racket/match) diff --git a/js-assembler/assemble-expression.rkt b/js-assembler/assemble-expression.rkt index 3e8ab57..2fc3391 100644 --- a/js-assembler/assemble-expression.rkt +++ b/js-assembler/assemble-expression.rkt @@ -3,8 +3,8 @@ (require "assemble-structs.rkt" "assemble-helpers.rkt" "assemble-open-coded.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" racket/string racket/list) diff --git a/js-assembler/assemble-helpers.rkt b/js-assembler/assemble-helpers.rkt index a121b90..3648eff 100644 --- a/js-assembler/assemble-helpers.rkt +++ b/js-assembler/assemble-helpers.rkt @@ -1,8 +1,8 @@ #lang typed/racket/base -(require "../il-structs.rkt" - "../expression-structs.rkt" - "../lexical-structs.rkt" +(require "../compiler/il-structs.rkt" + "../compiler/expression-structs.rkt" + "../compiler/lexical-structs.rkt" racket/list) (provide assemble-oparg diff --git a/js-assembler/assemble-open-coded.rkt b/js-assembler/assemble-open-coded.rkt index 19c7a73..620fc25 100644 --- a/js-assembler/assemble-open-coded.rkt +++ b/js-assembler/assemble-open-coded.rkt @@ -1,9 +1,9 @@ #lang typed/racket/base (require "assemble-helpers.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" - "../kernel-primitives.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/kernel-primitives.rkt" racket/string racket/list) diff --git a/js-assembler/assemble-perform-statement.rkt b/js-assembler/assemble-perform-statement.rkt index 4e2e826..b8f07e4 100644 --- a/js-assembler/assemble-perform-statement.rkt +++ b/js-assembler/assemble-perform-statement.rkt @@ -1,7 +1,7 @@ #lang typed/racket/base (require "assemble-helpers.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" "../parameters.rkt" racket/string) diff --git a/js-assembler/assemble-structs.rkt b/js-assembler/assemble-structs.rkt index e026e64..5704cfc 100644 --- a/js-assembler/assemble-structs.rkt +++ b/js-assembler/assemble-structs.rkt @@ -3,7 +3,7 @@ (provide (all-defined-out)) -(require "../il-structs.rkt") +(require "../compiler/il-structs.rkt") diff --git a/js-assembler/assemble.rkt b/js-assembler/assemble.rkt index 639779f..5c61cc0 100644 --- a/js-assembler/assemble.rkt +++ b/js-assembler/assemble.rkt @@ -5,10 +5,10 @@ "assemble-expression.rkt" "assemble-perform-statement.rkt" "collect-jump-targets.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/expression-structs.rkt" "../helpers.rkt" - "../expression-structs.rkt" racket/string racket/list) diff --git a/js-assembler/collect-jump-targets.rkt b/js-assembler/collect-jump-targets.rkt index 06f3090..17c5e4c 100644 --- a/js-assembler/collect-jump-targets.rkt +++ b/js-assembler/collect-jump-targets.rkt @@ -1,7 +1,7 @@ #lang typed/racket/base -(require "../expression-structs.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" +(require "../compiler/expression-structs.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" "../helpers.rkt" racket/list) diff --git a/make-structs.rkt b/make-structs.rkt index c81ece7..90ec2d5 100644 --- a/make-structs.rkt +++ b/make-structs.rkt @@ -1,12 +1,13 @@ #lang typed/racket/base -(require "compiler.rkt" - "il-structs.rkt" +(require "compiler/compiler.rkt" + "compiler/il-structs.rkt" + "compiler/lexical-structs.rkt" + "compiler/bootstrapped-primitives.rkt" + "compiler/compiler-structs.rkt" + "compiler/expression-structs.rkt" + "get-dependencies.rkt" - "lexical-structs.rkt" - "bootstrapped-primitives.rkt" - "compiler-structs.rkt" - "expression-structs.rkt" "parameters.rkt" "sets.rkt" racket/list diff --git a/make.rkt b/make.rkt index ce35cba..858f71b 100644 --- a/make.rkt +++ b/make.rkt @@ -1,12 +1,12 @@ #lang typed/racket/base -(require "compiler.rkt" - "il-structs.rkt" +(require "compiler/compiler.rkt" + "compiler/il-structs.rkt" + "compiler/lexical-structs.rkt" + "compiler/bootstrapped-primitives.rkt" + "compiler/compiler-structs.rkt" + "compiler/expression-structs.rkt" "get-dependencies.rkt" - "lexical-structs.rkt" - "bootstrapped-primitives.rkt" - "compiler-structs.rkt" - "expression-structs.rkt" "parameters.rkt" "sets.rkt" "make-structs.rkt" diff --git a/parameters.rkt b/parameters.rkt index f3be938..0ca9997 100644 --- a/parameters.rkt +++ b/parameters.rkt @@ -1,7 +1,7 @@ #lang typed/racket/base -(require "expression-structs.rkt" - "lexical-structs.rkt" +(require "compiler/expression-structs.rkt" + "compiler/lexical-structs.rkt" "sets.rkt" racket/path) diff --git a/parser/baby-parser.rkt b/parser/baby-parser.rkt index 2c7b36f..85cdd56 100644 --- a/parser/baby-parser.rkt +++ b/parser/baby-parser.rkt @@ -1,8 +1,8 @@ #lang racket/base -(require "../expression-structs.rkt" - "../lexical-env.rkt" - "../lexical-structs.rkt" +(require "../compiler/expression-structs.rkt" + "../compiler/lexical-env.rkt" + "../compiler/lexical-structs.rkt" "../helpers.rkt" "../parameters.rkt" "lam-entry-gensym.rkt" diff --git a/parser/parse-bytecode-5.1.1.rkt b/parser/parse-bytecode-5.1.1.rkt index 83fc82b..c115d65 100644 --- a/parser/parse-bytecode-5.1.1.rkt +++ b/parser/parse-bytecode-5.1.1.rkt @@ -4,8 +4,8 @@ (require "typed-module-path.rkt" "lam-entry-gensym.rkt" "path-rewriter.rkt" - "../expression-structs.rkt" - "../lexical-structs.rkt" + "../compiler/expression-structs.rkt" + "../compiler/lexical-structs.rkt" "../parameters.rkt" "../get-module-bytecode.rkt" syntax/modresolve diff --git a/simulator/simulator-primitives.rkt b/simulator/simulator-primitives.rkt index e69d5ac..a674e86 100644 --- a/simulator/simulator-primitives.rkt +++ b/simulator/simulator-primitives.rkt @@ -1,7 +1,7 @@ #lang racket/base (require "simulator-structs.rkt" - "../il-structs.rkt" "simulator-helpers.rkt" + "../compiler/il-structs.rkt" racket/math racket/list (for-syntax racket/base)) diff --git a/simulator/simulator-structs.rkt b/simulator/simulator-structs.rkt index bd32cf7..bd615c0 100644 --- a/simulator/simulator-structs.rkt +++ b/simulator/simulator-structs.rkt @@ -2,9 +2,9 @@ (provide (all-defined-out)) -(require "../il-structs.rkt" - "../expression-structs.rkt" - "../lexical-structs.rkt") +(require "../compiler/il-structs.rkt" + "../compiler/expression-structs.rkt" + "../compiler/lexical-structs.rkt") diff --git a/simulator/simulator.rkt b/simulator/simulator.rkt index 6ccff9e..bcca03e 100644 --- a/simulator/simulator.rkt +++ b/simulator/simulator.rkt @@ -6,12 +6,11 @@ ;; I also need to do things like count pushes and pops. Basically, low-level benchmarking. (require "simulator-structs.rkt" - "../expression-structs.rkt" - "../il-structs.rkt" - "../lexical-structs.rkt" - "../bootstrapped-primitives.rkt" - "../kernel-primitives.rkt" - "../expression-structs.rkt" + "../compiler/expression-structs.rkt" + "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/bootstrapped-primitives.rkt" + "../compiler/kernel-primitives.rkt" racket/list racket/match (for-syntax racket/base)) diff --git a/tests/test-assemble.rkt b/tests/test-assemble.rkt index 1d051df..69afaf7 100644 --- a/tests/test-assemble.rkt +++ b/tests/test-assemble.rkt @@ -3,9 +3,8 @@ (require "browser-evaluate.rkt" "../js-assembler/assemble.rkt" "../js-assembler/get-runtime.rkt" - - "../lexical-structs.rkt" - "../il-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/il-structs.rkt" racket/port racket/promise racket/runtime-path) diff --git a/tests/test-get-dependencies.rkt b/tests/test-get-dependencies.rkt index e2a328e..5e1e8c9 100644 --- a/tests/test-get-dependencies.rkt +++ b/tests/test-get-dependencies.rkt @@ -2,19 +2,18 @@ (require "../get-dependencies.rkt" "../get-module-bytecode.rkt" "../parser/parse-bytecode.rkt" - "../lexical-structs.rkt" + "../compiler/lexical-structs.rkt" racket/path racket/runtime-path rackunit) (printf "test-get-dependencies.rkt\n") -(define-runtime-path compiler-path "..") - -;(printf "This is the path: ~s\n" -; (path->string (normalize-path compiler-path))) -;(flush-output) +(define-runtime-path get-dependencies-path + (build-path ".." "get-dependencies.rkt")) +(define-runtime-path get-module-bytecode-path + (build-path ".." "get-module-bytecode.rkt")) @@ -22,11 +21,11 @@ (normalize-path (let ([p (find-system-path 'collects-dir)]) (cond - [(relative-path? p) - (find-executable-path (find-system-path 'exec-file) - (find-system-path 'collects-dir))] - [else - p])))) + [(relative-path? p) + (find-executable-path (find-system-path 'exec-file) + (find-system-path 'collects-dir))] + [else + p])))) @@ -37,7 +36,7 @@ (define e - (parse-bytecode (build-path compiler-path "get-dependencies.rkt"))) + (parse-bytecode get-dependencies-path)) (void (get-dependencies e)) @@ -52,19 +51,19 @@ ;; This should have three dependencies: racket/base, racket/match, and get-module-bytecode. (let ([ip (open-input-string (format (string-append "(module foo racket/base (require racket/math " - "(file \"~a/get-module-bytecode.rkt\")) (exp 1))") - (path->string (normalize-path compiler-path))))]) + "(file ~s)) (exp 1))") + (path->string (normalize-path get-module-bytecode-path))))]) (check-equal? (sort (get-dependencies (parse-bytecode (open-input-bytes - (get-module-bytecode ip)))) + (get-module-bytecode ip)))) module-name<) (sort (list (make-ModuleLocator 'collects/racket/base.rkt - (normalize-path (build-path collects-dir "racket" "base.rkt"))) + (normalize-path (build-path collects-dir "racket" "base.rkt"))) (make-ModuleLocator 'collects/racket/math.rkt - (normalize-path (build-path collects-dir "racket" "math.rkt"))) + (normalize-path (build-path collects-dir "racket" "math.rkt"))) (make-ModuleLocator 'whalesong/get-module-bytecode.rkt - (normalize-path (build-path compiler-path "get-module-bytecode.rkt")))) + (normalize-path get-module-bytecode-path))) module-name<))) \ No newline at end of file diff --git a/tests/test-helpers.rkt b/tests/test-helpers.rkt index 2bd83e2..78d6b60 100644 --- a/tests/test-helpers.rkt +++ b/tests/test-helpers.rkt @@ -2,8 +2,8 @@ (require (prefix-in racket: racket/base) racket/runtime-path - "../compiler-structs.rkt" - "../compiler.rkt" + "../compiler/compiler-structs.rkt" + "../compiler/compiler.rkt" "../parser/parse-bytecode.rkt" "../get-module-bytecode.rkt" "../language-namespace.rkt") diff --git a/tests/test-parse-bytecode.rkt b/tests/test-parse-bytecode.rkt index 0f06c2b..7f6ea55 100644 --- a/tests/test-parse-bytecode.rkt +++ b/tests/test-parse-bytecode.rkt @@ -6,8 +6,8 @@ racket/path "../parameters.rkt" "../parser/parse-bytecode.rkt" - "../lexical-structs.rkt" - "../expression-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/expression-structs.rkt" racket/runtime-path (for-syntax racket/base)) diff --git a/tests/test-parse.rkt b/tests/test-parse.rkt index 6c5e843..d80f463 100644 --- a/tests/test-parse.rkt +++ b/tests/test-parse.rkt @@ -2,8 +2,8 @@ (require "../parser/baby-parser.rkt" "../parser/lam-entry-gensym.rkt" - "../lexical-structs.rkt" - "../expression-structs.rkt" + "../compiler/lexical-structs.rkt" + "../compiler/expression-structs.rkt" (for-syntax racket/base)) (printf "test-parse.rkt\n"); diff --git a/tests/test-simulator.rkt b/tests/test-simulator.rkt index a770cdc..f06343c 100644 --- a/tests/test-simulator.rkt +++ b/tests/test-simulator.rkt @@ -1,7 +1,7 @@ #lang racket -(require "../il-structs.rkt" - "../lexical-structs.rkt" +(require "../compiler/il-structs.rkt" + "../compiler/lexical-structs.rkt" "../simulator/simulator-structs.rkt" "../simulator/simulator-primitives.rkt" "../simulator/simulator.rkt")