Migrate lib/ to jsmaniac/phc-toolkit project: Use phc-toolkit instead of lib/…

This commit is contained in:
Georges Dupéron 2016-04-05 13:04:23 +02:00
parent a46a7c852a
commit f5433ff093
45 changed files with 103 additions and 126 deletions

View File

@ -13,4 +13,12 @@ clean:
.PHONY: build-dep .PHONY: build-dep
build-dep: build-dep:
# datatype is only used as an example in the docs. # datatype is only used as an example in the docs.
raco pkg install --deps search-auto --update-deps --skip-installed alexis-util cover cover-coveralls debug datatype mischief https://github.com/jsmaniac/scribble-enhanced.git#823fdda5a65552ce4fe8d6f8fbe07391ccca73bd raco pkg install --deps search-auto --update-deps --skip-installed \
alexis-util \
cover \
cover-coveralls \
debug \
datatype \
mischief \
https://github.com/jsmaniac/scribble-enhanced.git#d4c8f889b4d68c0acef8f73b15641af095051b8e \
https://github.com/jsmaniac/phc-toolkit.git#31dff12f8c0ca13f2bc97d3ad098dbe5b274ec50

View File

@ -193,46 +193,6 @@ Type-expander
Library functions and utilities Library functions and utilities
------------------------------- -------------------------------
* `lib/eval-get-values.rkt`
Wrapper for the racket `eval` function that allows evaluation of code with
multiple return values in typed/racket.
* `lib/lib.rkt`
Utilities that complement racket and typed/racket's standard libraries.
* `lib/low.rkt` and `lib/low/*.rkt`
Lower-level utilities that complement racket and typed/racket's standard
libraries.
* `lib/untyped/for-star-list-star.rkt`
A utility macro similar to `for*/list` to iterate over collections and return
a list of results, but which can return nested lists instead of just a flat
one.
* `lib/untyped.rkt`
Aggregates `(submod "lib/low.rkt" untyped)`, and
`lib/untyped/for-star-list-star.rkt`.
* `lib/test-framework.rkt`
Some wrappers and utilities that allow easier use of the rackunit test
framework from typed/racket files.
* `lib/syntax/quasitemplate.rkt`
Extension of the `syntax/parse/experimental/template` library, that allows
using `unsyntax` and `unsyntax-splicing` inside a `quasitemplate`, just like
in the normal `quasisyntax`.
* `lib/path.rkt`
Filesystem path manipulation utilities.
* `lib/doc.rkt` * `lib/doc.rkt`
Enhancements and utilities for documentation and literate programming files Enhancements and utilities for documentation and literate programming files

View File

@ -2,4 +2,4 @@
(require syntax/parse (require syntax/parse
syntax/parse/experimental/template) syntax/parse/experimental/template)
(require (for-template "../type-expander/type-expander.lp2.rkt")) (require (for-template "../type-expander/type-expander.lp2.rkt"))
(require (submod "../lib/low.rkt" untyped)) (require (submod phc-toolkit untyped))

View File

@ -41,7 +41,7 @@
|# |#
(require "graph-5-multi-ctors.lp2.rkt" (require "graph-5-multi-ctors.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"graph.lp2.rkt" "graph.lp2.rkt"
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"

View File

@ -2,7 +2,7 @@
(module test-~>-bound typed/racket (module test-~>-bound typed/racket
(require "graph-6-rich-returns.lp2.rkt" (require "graph-6-rich-returns.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
@ -45,9 +45,7 @@
(module test-~>-unbound typed/racket (module test-~>-unbound typed/racket
(require "graph-6-rich-returns.lp2.rkt" (require "graph-6-rich-returns.lp2.rkt"
(only-in "../lib/low.rkt" (only-in phc-toolkit check-equal?: )
check-equal?:
)
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -40,7 +40,7 @@
(module* test typed/racket (module* test typed/racket
(require (submod "..") (require (submod "..")
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
typed/rackunit typed/rackunit
"adt.lp2.rkt") "adt.lp2.rkt")

View File

@ -1,10 +1,10 @@
#lang typed/racket #lang typed/racket
(module test typed/racket (module test typed/racket
(require (submod "graph-test.rkt" test)) (require (submod "graph-test.rkt" test)
(require "adt.lp2.rkt") "adt.lp2.rkt"
(require "../lib/low.rkt") phc-toolkit
(require "../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(define-tagged st2 [b String] [a Number]) (define-tagged st2 [b String] [a Number])

View File

@ -2,7 +2,7 @@
(module test typed/racket (module test typed/racket
(require "constructor.lp2.rkt" (require "constructor.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(check-equal?: (constructor-values (check-equal?: (constructor-values

View File

@ -217,9 +217,9 @@ instance:
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(for-meta 2 racket/base) (for-meta 2 racket/base)
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -4,7 +4,7 @@
(require "define-adt.lp2.rkt" (require "define-adt.lp2.rkt"
"constructor.lp2.rkt" "constructor.lp2.rkt"
"tagged.lp2.rkt" "tagged.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
;; define-tagged ;; define-tagged

View File

@ -126,12 +126,12 @@ used. The macro's expansion will use this to declare
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(for-meta 2 racket/base) (for-meta 2 racket/base)
"constructor.lp2.rkt" "constructor.lp2.rkt"
(submod "constructor.lp2.rkt" main private) (submod "constructor.lp2.rkt" main private)
"tagged.lp2.rkt" "tagged.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -2,7 +2,7 @@
(module test "dotlang.rkt" (module test "dotlang.rkt"
(require typed/rackunit (require typed/rackunit
"../lib/low.rkt" phc-toolkit
"get.lp2.rkt" "get.lp2.rkt"
(submod "graph-test.rkt" test) (submod "graph-test.rkt" test)
"map.rkt") "map.rkt")

View File

@ -13,7 +13,7 @@
(require "get.lp2.rkt" (require "get.lp2.rkt"
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
(for-syntax racket/string (for-syntax racket/string
syntax/parse syntax/parse
racket/syntax racket/syntax
@ -21,7 +21,7 @@
racket/struct racket/struct
racket/function racket/function
syntax/srcloc syntax/srcloc
(submod "../lib/low.rkt" untyped))) (submod phc-toolkit untyped)))
#| #|
(define-syntax/parse (dot x:id) (define-syntax/parse (dot x:id)

View File

@ -247,8 +247,8 @@ position in the vector equal to the index associated to it in the hash table:
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(provide fold-queues) (provide fold-queues)

View File

@ -4,7 +4,7 @@
(require (submod "graph-test.rkt" test)) (require (submod "graph-test.rkt" test))
(require "get.lp2.rkt") (require "get.lp2.rkt")
(require "adt.lp2.rkt") (require "adt.lp2.rkt")
(require "../lib/low.rkt") (require phc-toolkit)
(require "../type-expander/type-expander.lp2.rkt") (require "../type-expander/type-expander.lp2.rkt")
(check-equal?: (get '((1 2) (3)) ) (check-equal?: (get '((1 2) (3)) )

View File

@ -202,8 +202,8 @@ The type for the function generated by @tc[λget] mirrors the cases from
(module main typed/racket (module main typed/racket
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"adt.lp2.rkt" "adt.lp2.rkt"
"graph.lp2.rkt" "graph.lp2.rkt"
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"

View File

@ -147,8 +147,8 @@ name) with the right type, so that the user doesn't see all the types in the
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"graph.lp2.rkt" "graph.lp2.rkt"
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"

View File

@ -741,10 +741,10 @@ encapsulating the result types of mappings.
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
"rewrite-type.lp2.rkt" "rewrite-type.lp2.rkt"
racket/format) racket/format)
"../lib/low.rkt" phc-toolkit
"graph.lp2.rkt" "graph.lp2.rkt"
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"

View File

@ -9,7 +9,7 @@
(replace-context stx tests)) (replace-context stx tests))
(require "graph.lp2.rkt" (require "graph.lp2.rkt"
(only-in "../lib/low.rkt" cars cdrs check-equal?: check-true: % in) (only-in phc-toolkit cars cdrs check-equal?: check-true: % in)
(only-in "adt.lp2.rkt" uniform-get) (only-in "adt.lp2.rkt" uniform-get)
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -829,12 +829,12 @@ We will be able to use this type expander in function types, for example:
racket/sequence racket/sequence
racket/pretty racket/pretty
"rewrite-type.lp2.rkt" "rewrite-type.lp2.rkt"
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
"meta-struct.rkt") "meta-struct.rkt")
racket/splicing racket/splicing
"fold-queues.lp2.rkt" "fold-queues.lp2.rkt"
"rewrite-type.lp2.rkt" "rewrite-type.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"adt.lp2.rkt" "adt.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"

View File

@ -841,11 +841,11 @@ checker, unless it is absorbed by a larger type, like in
racket/syntax racket/syntax
racket/function racket/function
racket/pretty racket/pretty
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
"../lib/untyped.rkt") phc-toolkit/untyped/for-star-list-star)
(prefix-in DEBUG-tr: typed/racket) (prefix-in DEBUG-tr: typed/racket)
syntax/parse syntax/parse
"../lib/low.rkt" phc-toolkit
"adt.lp2.rkt" "adt.lp2.rkt"
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
@ -866,12 +866,12 @@ checker, unless it is absorbed by a larger type, like in
(module* test typed/racket (module* test typed/racket
(require (submod "..") (require (submod "..")
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"../lib/test-framework.rkt") phc-toolkit/test-framework)
;; Debug ;; Debug
<pre-declare-transform/link-request> <pre-declare-transform/link-request>
(require syntax/parse (require syntax/parse
"../lib/low.rkt" phc-toolkit
"adt.lp2.rkt" "adt.lp2.rkt"
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -6,7 +6,7 @@
(require (submod "graph-test.rkt" test) (require (submod "graph-test.rkt" test)
"get.lp2.rkt" "get.lp2.rkt"
"map.rkt" "map.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(begin (begin

View File

@ -3,8 +3,8 @@
(require (for-syntax racket/syntax (require (for-syntax racket/syntax
racket/function racket/function
syntax/parse syntax/parse
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -1,7 +1,7 @@
#lang typed/racket #lang typed/racket
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(provide curry-map) (provide curry-map)

View File

@ -3,8 +3,8 @@
(require (for-syntax racket/syntax (require (for-syntax racket/syntax
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")

View File

@ -3,15 +3,15 @@
(require (for-syntax racket/syntax (require (for-syntax racket/syntax
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(for-meta 2 (for-meta 2
racket/base racket/base
racket/syntax) racket/syntax)
"../lib/low.rkt" phc-toolkit
"get.lp2.rkt" "get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(provide map: apply-compose) ;; TODO: move apply-compose to lib/low.rkt (provide map: apply-compose) ;; TODO: move apply-compose to phc-toolkit
(begin-for-syntax (begin-for-syntax
(define-syntax-class lam (define-syntax-class lam
@ -198,7 +198,7 @@
(module* test typed/racket (module* test typed/racket
(require (submod "..") (require (submod "..")
"../lib/low.rkt") phc-toolkit)
(check-equal?: (map: add1 '(1 2 3)) (check-equal?: (map: add1 '(1 2 3))
: (Listof Number) : (Listof Number)

View File

@ -375,8 +375,8 @@ was a tag requested.
(module main typed/racket (module main typed/racket
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
racket/set racket/set
racket/format) racket/format)

View File

@ -115,9 +115,9 @@ declared using @tc[define-syntax].
@chunk[<for-syntax-declarations> @chunk[<for-syntax-declarations>
(require mzlib/etc (require mzlib/etc
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
(for-syntax mzlib/etc (for-syntax mzlib/etc
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
racket/string racket/string
racket/format racket/format
mischief/transform)) mischief/transform))

View File

@ -549,11 +549,11 @@ These metafunctions just extract the arguments for @tc[replace-in-type] and
racket/format racket/format
syntax/parse/experimental/template syntax/parse/experimental/template
racket/sequence racket/sequence
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
(only-in "../type-expander/type-expander.lp2.rkt" (only-in "../type-expander/type-expander.lp2.rkt"
expand-type) expand-type)
"meta-struct.rkt" "meta-struct.rkt"
"../lib/low/backtrace.rkt" phc-toolkit/backtrace
racket/require racket/require
debug ;; DEBUG debug ;; DEBUG
(for-template (subtract-in (for-template (subtract-in
@ -561,7 +561,7 @@ These metafunctions just extract the arguments for @tc[replace-in-type] and
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"../lib/low.rkt")) phc-toolkit))
(provide replace-in-type (provide replace-in-type
;replace-in-instance ;replace-in-instance
fold-instance fold-instance

View File

@ -8,7 +8,7 @@
(replace-context stx tests)) (replace-context stx tests))
(require "structure.lp2.rkt" (require "structure.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
typed/rackunit) typed/rackunit)

View File

@ -420,11 +420,11 @@ its arguments across compilations, and adds them to the file
racket/sequence racket/sequence
;; in-syntax on older versions: ;; in-syntax on older versions:
;;;unstable/sequence ;;;unstable/sequence
(submod "../lib/low.rkt" untyped) (submod phc-toolkit untyped)
"meta-struct.rkt" "meta-struct.rkt"
"remember-lib.rkt" "remember-lib.rkt"
mischief/transform) mischief/transform)
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"../type-expander/multi-id.lp2.rkt") "../type-expander/multi-id.lp2.rkt")
(provide define-structure (provide define-structure

View File

@ -2,7 +2,7 @@
(module test typed/racket (module test typed/racket
(require "tagged.lp2.rkt" (require "tagged.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(check-equal?: (match (ann (tagged t1 [x 1] [y "b"]) (check-equal?: (match (ann (tagged t1 [x 1] [y "b"])

View File

@ -123,8 +123,8 @@ for a structure.
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"constructor.lp2.rkt" "constructor.lp2.rkt"

View File

@ -52,8 +52,8 @@ retrieves the desired field from the structure.
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"constructor.lp2.rkt" "constructor.lp2.rkt"

View File

@ -3,7 +3,7 @@
(module test typed/racket (module test typed/racket
(require "variant2.lp2.rkt" (require "variant2.lp2.rkt"
"constructor.lp2.rkt" "constructor.lp2.rkt"
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
(define-variant v1 [x Number String] [y String Number] [z Number String]) (define-variant v1 [x Number String] [y String Number] [z Number String])

View File

@ -13,8 +13,8 @@
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"structure.lp2.rkt") "structure.lp2.rkt")
@ -50,7 +50,7 @@
(require (submod "..") (require (submod "..")
(submod ".." main test-helpers) (submod ".." main test-helpers)
typed/rackunit typed/rackunit
"../lib/low.rkt" phc-toolkit
"../type-expander/type-expander.lp2.rkt") "../type-expander/type-expander.lp2.rkt")
<test-constructor> <test-constructor>

View File

@ -110,8 +110,8 @@ function.
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
racket/syntax racket/syntax
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt" phc-toolkit
"../type-expander/multi-id.lp2.rkt" "../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt" "../type-expander/type-expander.lp2.rkt"
"constructor.lp2.rkt" "constructor.lp2.rkt"

View File

@ -7,7 +7,7 @@
(require . mods) (require . mods)
(provide (all-from-out . mods)))) (provide (all-from-out . mods))))
(r/p "lib/low.rkt" (r/p phc-toolkit
"type-expander/multi-id.lp2.rkt" "type-expander/multi-id.lp2.rkt"
"type-expander/type-expander.lp2.rkt" "type-expander/type-expander.lp2.rkt"
"graph/adt.lp2.rkt" "graph/adt.lp2.rkt"

View File

@ -50,8 +50,8 @@ scribble, see
(module main typed/racket (module main typed/racket
(require (for-syntax syntax/parse (require (for-syntax syntax/parse
racket/syntax racket/syntax
(submod "../../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(submod "../../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(provide foo) (provide foo)
<foo> <foo>

View File

@ -9,7 +9,7 @@
(require-typed/untyped "aliases.rkt" (require-typed/untyped "aliases.rkt"
"stx.rkt") "stx.rkt")
;; TODO: cdr-stx-assoc is already defined in lib/low.rkt ;; TODO: cdr-stx-assoc is already defined in phc-toolkit
(define-type (Stx-AList A) (define-type (Stx-AList A)
(Syntaxof (Listof (Syntaxof (Pairof Identifier A))))) (Syntaxof (Listof (Syntaxof (Pairof Identifier A)))))

View File

@ -7,11 +7,16 @@
(define (categorize x) (define (categorize x)
(match x (match x
[(? symbol?
(? (λ (x) (regexp-match #px"^phc-toolkit(/|$)" (symbol->string x)))))
'phc-toolkit]
#;[(? (λ (x) (regexp-match #px"phc-toolkit" (format "~a" x))))
'phc-toolkit]
[(? symbol?) 'lib] [(? symbol?) 'lib]
[(list 'quote (? symbol? [(list 'quote (? symbol?
(? (λ (x) (regexp-match #rx"^#%" (symbol->string x)))))) (? (λ (x) (regexp-match #rx"^#%" (symbol->string x))))))
'lib] 'lib]
[(list 'submod (? symbol?) _ ...) 'lib] [(list 'submod sub _ ...) (categorize sub)]
[(list (? symbol? s) _ ...) s] [(list (? symbol? s) _ ...) s]
[_ #f])) [_ #f]))
@ -119,10 +124,16 @@
[_ #f])) [_ #f]))
(define (tag-pair dep) (define (tag-pair dep)
(append (if (equal? (cdr dep) "lib/low.rkt") '(lib/low) '()) (append (if (eq? (categorize (cdr dep)) 'phc-toolkit)
'(phc-toolkit)
'())
(if (equal? (categorize-main-module (car dep)) (if (equal? (categorize-main-module (car dep))
(categorize-main-module (cdr dep))) '(submodule) '()) (categorize-main-module (cdr dep)))
(if (lib? (cdr dep)) '(lib) '()))) '(submodule)
'())
(if (lib? (cdr dep))
'(lib)
'())))
(define tagged-dep-pairs (define tagged-dep-pairs
(map (λ (dep) (map (λ (dep)
@ -190,7 +201,7 @@
(define (dep-tag->style t) (define (dep-tag->style t)
(case t (case t
[(lib/low) "color=grey,style=dotted"] [(phc-toolkit) "color=grey,style=dotted"]
[(submodule) "color=grey"] [(submodule) "color=grey"]
[(lib) "style=dashed"] [(lib) "style=dashed"]
[else #f])) [else #f]))

View File

@ -1,6 +1,6 @@
#lang typed/racket #lang typed/racket
(require "../../lib/low.rkt" (require phc-toolkit
"../../graph/graph.lp2.rkt" "../../graph/graph.lp2.rkt"
"../../graph/get.lp2.rkt" "../../graph/get.lp2.rkt"
"../../type-expander/type-expander.lp2.rkt") "../../type-expander/type-expander.lp2.rkt")

View File

@ -192,7 +192,7 @@ Test with @tc[#:else]:
(begin (begin
(module main typed/racket (module main typed/racket
(require "type-expander.lp2.rkt" (require "type-expander.lp2.rkt"
"../lib/low.rkt") phc-toolkit)
(require (for-syntax (require (for-syntax
racket/syntax racket/syntax
syntax/parse syntax/parse

View File

@ -4,10 +4,10 @@
(require "type-expander.lp2.rkt" (require "type-expander.lp2.rkt"
;(submod "type-expander.lp2.rkt" test) ;(submod "type-expander.lp2.rkt" test)
typed/rackunit typed/rackunit
"../lib/low.rkt" phc-toolkit
(for-syntax (submod "type-expander.lp2.rkt" expander) (for-syntax (submod "type-expander.lp2.rkt" expander)
racket/list racket/list
(submod "../lib/low.rkt" untyped))) (submod phc-toolkit untyped)))
; Tests for expand-type ; Tests for expand-type
(begin (begin

View File

@ -677,7 +677,7 @@ To get around that problem, we define @tc[:] in a separate module, and
(module colon typed/racket (module colon typed/racket
(require (for-syntax racket (require (for-syntax racket
syntax/parse) syntax/parse)
"../lib/low.rkt") phc-toolkit)
(require (for-syntax (submod ".." expander))) (require (for-syntax (submod ".." expander)))
(provide new-:) (provide new-:)
@ -698,7 +698,7 @@ in a separate module (that will be used only by macros, so it will be written in
syntax/parse syntax/parse
racket/format racket/format
syntax/id-table syntax/id-table
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
(require (for-template typed/racket)) (require (for-template typed/racket))
@ -727,8 +727,8 @@ We can finally define the overloaded forms, as well as the extra
racket/syntax racket/syntax
syntax/parse syntax/parse
syntax/parse/experimental/template syntax/parse/experimental/template
(submod "../lib/low.rkt" untyped)) (submod phc-toolkit untyped))
"../lib/low.rkt") phc-toolkit)
(require (submod ".." expander)) (require (submod ".." expander))
(require (for-syntax (submod ".." expander))) (require (for-syntax (submod ".." expander)))