moved unstable/mutated-vars back to typed-racket
This commit is contained in:
parent
bf21e5b765
commit
e086d237cd
|
@ -11,14 +11,14 @@
|
||||||
[-> t:->]))
|
[-> t:->]))
|
||||||
(except-in (utils tc-utils utils) infer)
|
(except-in (utils tc-utils utils) infer)
|
||||||
typed-racket/infer/infer-dummy typed-racket/infer/infer
|
typed-racket/infer/infer-dummy typed-racket/infer/infer
|
||||||
unstable/mutated-vars
|
(utils mutated-vars)
|
||||||
|
|
||||||
rackunit rackunit/text-ui
|
rackunit rackunit/text-ui
|
||||||
syntax/parse
|
syntax/parse
|
||||||
racket/file racket/port
|
racket/file racket/port
|
||||||
(for-syntax syntax/kerncase syntax/parse racket/syntax
|
(for-syntax syntax/kerncase syntax/parse racket/syntax
|
||||||
(types abbrev convenience utils)
|
(types abbrev convenience utils)
|
||||||
unstable/mutated-vars
|
(utils mutated-vars)
|
||||||
(utils tc-utils) (typecheck typechecker))
|
(utils tc-utils) (typecheck typechecker))
|
||||||
typed-racket/base-env/prims
|
typed-racket/base-env/prims
|
||||||
typed-racket/base-env/base-types
|
typed-racket/base-env/base-types
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
[-> t:->])
|
[-> t:->])
|
||||||
(except-in (utils tc-utils utils) infer)
|
(except-in (utils tc-utils utils) infer)
|
||||||
typed-racket/infer/infer-dummy typed-racket/infer/infer
|
typed-racket/infer/infer-dummy typed-racket/infer/infer
|
||||||
unstable/mutated-vars
|
(utils mutated-vars)
|
||||||
(env type-name-env type-env-structs init-envs)
|
(env type-name-env type-env-structs init-envs)
|
||||||
rackunit rackunit/text-ui
|
rackunit rackunit/text-ui
|
||||||
syntax/parse
|
syntax/parse
|
||||||
|
|
4
collects/typed-racket/env/lexical-env.rkt
vendored
4
collects/typed-racket/env/lexical-env.rkt
vendored
|
@ -9,10 +9,10 @@
|
||||||
(require "../utils/utils.rkt"
|
(require "../utils/utils.rkt"
|
||||||
"type-env-structs.rkt"
|
"type-env-structs.rkt"
|
||||||
"global-env.rkt"
|
"global-env.rkt"
|
||||||
unstable/mutated-vars syntax/id-table
|
syntax/id-table
|
||||||
(for-syntax syntax/parse syntax/parse/experimental/contract racket/base)
|
(for-syntax syntax/parse syntax/parse/experimental/contract racket/base)
|
||||||
(only-in scheme/contract ->* -> or/c any/c listof cons/c)
|
(only-in scheme/contract ->* -> or/c any/c listof cons/c)
|
||||||
(utils tc-utils)
|
(utils tc-utils mutated-vars)
|
||||||
(only-in (rep type-rep) Type/c)
|
(only-in (rep type-rep) Type/c)
|
||||||
(typecheck tc-metafunctions)
|
(typecheck tc-metafunctions)
|
||||||
(except-in (types utils convenience) -> ->*))
|
(except-in (types utils convenience) -> ->*))
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
|
|
||||||
(require (rename-in "utils/utils.rkt" [infer r:infer])
|
(require (rename-in "utils/utils.rkt" [infer r:infer])
|
||||||
(except-in syntax/parse id)
|
(except-in syntax/parse id)
|
||||||
unstable/mutated-vars
|
|
||||||
racket/pretty
|
racket/pretty
|
||||||
(private type-contract)
|
(private type-contract)
|
||||||
(types utils convenience)
|
(types utils convenience)
|
||||||
(typecheck typechecker provide-handling tc-toplevel)
|
(typecheck typechecker provide-handling tc-toplevel)
|
||||||
(env tvar-env type-name-env type-alias-env)
|
(env tvar-env type-name-env type-alias-env)
|
||||||
(r:infer infer)
|
(r:infer infer)
|
||||||
(utils tc-utils disarm)
|
(utils tc-utils disarm mutated-vars)
|
||||||
(rep type-rep)
|
(rep type-rep)
|
||||||
(except-in (utils utils) infer)
|
(except-in (utils utils) infer)
|
||||||
(only-in (r:infer infer-dummy) infer-param)
|
(only-in (r:infer infer-dummy) infer-param)
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
(types utils convenience type-table)
|
(types utils convenience type-table)
|
||||||
(private parse-type type-annotation type-contract)
|
(private parse-type type-annotation type-contract)
|
||||||
(env global-env init-envs type-name-env type-alias-env lexical-env)
|
(env global-env init-envs type-name-env type-alias-env lexical-env)
|
||||||
unstable/mutated-vars syntax/id-table
|
syntax/id-table
|
||||||
(utils tc-utils)
|
(utils tc-utils mutated-vars)
|
||||||
"provide-handling.rkt"
|
"provide-handling.rkt"
|
||||||
"def-binding.rkt"
|
"def-binding.rkt"
|
||||||
(prefix-in c: racket/contract)
|
(prefix-in c: racket/contract)
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
#lang scribble/manual
|
|
||||||
@(require scribble/eval
|
|
||||||
"utils.rkt"
|
|
||||||
(for-label unstable/mutated-vars
|
|
||||||
racket/contract
|
|
||||||
racket/dict
|
|
||||||
syntax/id-table
|
|
||||||
racket/base))
|
|
||||||
|
|
||||||
@(define the-eval (make-base-eval))
|
|
||||||
@(the-eval '(require unstable/mutated-vars syntax/id-table racket/dict))
|
|
||||||
|
|
||||||
@title[#:tag "mutated-vars"]{Finding Mutated Variables}
|
|
||||||
|
|
||||||
@defmodule[unstable/mutated-vars]
|
|
||||||
|
|
||||||
@unstable[@author+email["Sam Tobin-Hochstadt" "samth@ccs.neu.edu"]]
|
|
||||||
|
|
||||||
|
|
||||||
@defproc[(find-mutated-vars [stx syntax?] [dict dict? (make-immutable-free-id-table)]) dict?]{Traverses
|
|
||||||
@racket[stx], which should be @racket[module-level-form] in the sense
|
|
||||||
of the grammar for
|
|
||||||
@tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{fully-expanded} forms,
|
|
||||||
and records all of the variables that are mutated.
|
|
||||||
Each mutated variable is added to @racket[dict], mapped to
|
|
||||||
@racket[#t]. If @racket[dict] is mutable, as determined by
|
|
||||||
@racket[dict-mutable?], then the table is updated destructively.
|
|
||||||
Otherwise, the table is updated functionally.}
|
|
||||||
|
|
||||||
@examples[#:eval the-eval
|
|
||||||
(define t (find-mutated-vars #'(begin (set! var 'foo) 'bar)))
|
|
||||||
(dict-ref t #'var #f)
|
|
||||||
(dict-ref t #'other-var #f)
|
|
||||||
(define tbl (make-free-id-table))
|
|
||||||
(find-mutated-vars #'(begin (set! var 'foo) 'bar) tbl)
|
|
||||||
(dict-ref tbl #'var #f)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
@close-eval[the-eval]
|
|
|
@ -81,7 +81,6 @@ Keep documentation and tests up to date.
|
||||||
@include-section["file.scrbl"]
|
@include-section["file.scrbl"]
|
||||||
@include-section["find.scrbl"]
|
@include-section["find.scrbl"]
|
||||||
@include-section["future.scrbl"]
|
@include-section["future.scrbl"]
|
||||||
@include-section["mutated-vars.scrbl"] ;; Finding Mutable Variables
|
|
||||||
@include-section["function.scrbl"]
|
@include-section["function.scrbl"]
|
||||||
@include-section["generics.scrbl"]
|
@include-section["generics.scrbl"]
|
||||||
@include-section["hash.scrbl"]
|
@include-section["hash.scrbl"]
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
(check-docs (quote unstable/prop-contract))
|
(check-docs (quote unstable/prop-contract))
|
||||||
(check-docs (quote unstable/pretty))
|
(check-docs (quote unstable/pretty))
|
||||||
(check-docs (quote unstable/port))
|
(check-docs (quote unstable/port))
|
||||||
(check-docs (quote unstable/mutated-vars))
|
|
||||||
(check-docs (quote unstable/match))
|
(check-docs (quote unstable/match))
|
||||||
(check-docs (quote unstable/markparam) #:skip #rx"^deserialize-info:")
|
(check-docs (quote unstable/markparam) #:skip #rx"^deserialize-info:")
|
||||||
(check-docs (quote unstable/list))
|
(check-docs (quote unstable/list))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user