macro-stepper: clarified "from" in hiding rules, added todo list
original commit: a91e9e7bf630a9a6ee35adaf61f58f56d268b200
This commit is contained in:
parent
ddc9d3e953
commit
3bcff8e3d1
|
@ -1,9 +1,12 @@
|
|||
#lang scheme/base
|
||||
(require scheme/match)
|
||||
(require scheme/match
|
||||
scheme/string)
|
||||
|
||||
(provide mpi->list
|
||||
mpi->string)
|
||||
mpi->string
|
||||
self-mpi?)
|
||||
|
||||
;; mpi->list : module-path-index -> list
|
||||
(define (mpi->list mpi)
|
||||
(cond [(module-path-index? mpi)
|
||||
(let-values ([(path relto) (module-path-index-split mpi)])
|
||||
|
@ -18,12 +21,16 @@
|
|||
(if (module-path-index? mpi)
|
||||
(let ([mps (mpi->list mpi)])
|
||||
(cond [(pair? mps)
|
||||
(apply string-append
|
||||
(format "~s" (car mps))
|
||||
(map (lambda (x) (format " <= ~s" x)) (cdr mps)))]
|
||||
(string-join (map (lambda (x) (format "~s" x)) mps)
|
||||
" <= ")]
|
||||
[(null? mps) "this module"]))
|
||||
(format "~s" mpi)))
|
||||
|
||||
;; self-mpi? : module-path-index -> bool
|
||||
(define (self-mpi? mpi)
|
||||
(let-values ([(path relto) (module-path-index-split mpi)])
|
||||
(eq? path #f)))
|
||||
|
||||
;; --
|
||||
|
||||
(provide mpi->mpi-sexpr
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
(define mode:standard "Standard")
|
||||
(define mode:custom "Custom ...")
|
||||
|
||||
#|
|
||||
|
||||
TODO
|
||||
|
||||
- allow entry of more policies
|
||||
- visual feedback on rules applying to selected identifier
|
||||
(need to switch from list to editor)
|
||||
|
||||
|#
|
||||
|
||||
;; macro-hiding-prefs-widget%
|
||||
(define macro-hiding-prefs-widget%
|
||||
|
@ -255,11 +264,13 @@
|
|||
(match condition
|
||||
[`(free=? ,id)
|
||||
(let ([b (identifier-binding id)])
|
||||
(or #;(identifier->string id)
|
||||
(or #| (identifier->string id) |#
|
||||
(cond [(list? b)
|
||||
(let ([mod (caddr b)]
|
||||
[name (cadddr b)])
|
||||
(format "'~s' from ~a" name (mpi->string mod)))]
|
||||
(if (self-mpi? mod)
|
||||
(format "'~a' defined in this module" name)
|
||||
(format "'~s' imported from ~a" name (mpi->string mod))))]
|
||||
[else
|
||||
(symbol->string (syntax-e id))])))]
|
||||
[_
|
||||
|
|
Loading…
Reference in New Issue
Block a user