Closes FB case 167 Catch the errors when first calling compute-graph-info. If there are any, parameterize check-remembered-node! to not lift errors
This commit is contained in:
parent
411c386bb1
commit
2de609c523
|
@ -139,7 +139,7 @@ return the corresponding node can be written based on it.
|
||||||
|
|
||||||
@chunk[<node-info>
|
@chunk[<node-info>
|
||||||
(struct+/contract node-info
|
(struct+/contract node-info
|
||||||
([predicate? identifier?] ;; (expr/τ (→ Any Boolean : ?))
|
([predicate? identifier?]
|
||||||
[field-order (listof identifier?)]
|
[field-order (listof identifier?)]
|
||||||
[fields (hash/c symbol? field-info? #:immutable #t)]
|
[fields (hash/c symbol? field-info? #:immutable #t)]
|
||||||
[promise-type stx-type/c]
|
[promise-type stx-type/c]
|
||||||
|
|
|
@ -25,12 +25,14 @@
|
||||||
{~seq #:invariant a {~and op {~or ∈ ∋ ≡ ≢ ∉}} b} …
|
{~seq #:invariant a {~and op {~or ∈ ∋ ≡ ≢ ∉}} b} …
|
||||||
{~seq #:invariant p} …))))
|
{~seq #:invariant p} …))))
|
||||||
|
|
||||||
(define-for-syntax compute-graph-info
|
(define-for-syntax (compute-graph-info stx)
|
||||||
(syntax-parser
|
(parameterize ([disable-remember-immediate-error #t])
|
||||||
[:signature <graph-info>]))
|
(syntax-parse stx
|
||||||
|
[:signature
|
||||||
|
<graph-info>])))
|
||||||
(define-syntax/parse (define-graph-type . whole:signature)
|
(define-syntax/parse (define-graph-type . whole:signature)
|
||||||
;; fire off the eventual errors within macro-expansion.
|
;; fire off the eventual delayed errors added by compute-graph-info
|
||||||
(compute-graph-info #'whole)
|
(lift-maybe-delayed-errors)
|
||||||
#`(begin
|
#`(begin
|
||||||
(define-syntax whole.name
|
(define-syntax whole.name
|
||||||
(compute-graph-info (quote-syntax whole)))))]
|
(compute-graph-info (quote-syntax whole)))))]
|
||||||
|
@ -86,6 +88,7 @@
|
||||||
@chunk[<*>
|
@chunk[<*>
|
||||||
(require racket/require
|
(require racket/require
|
||||||
phc-toolkit
|
phc-toolkit
|
||||||
|
remember
|
||||||
(lib "phc-adt/tagged-structure-low-level.hl.rkt")
|
(lib "phc-adt/tagged-structure-low-level.hl.rkt")
|
||||||
(for-syntax "graph-info.hl.rkt"
|
(for-syntax "graph-info.hl.rkt"
|
||||||
phc-toolkit/untyped
|
phc-toolkit/untyped
|
||||||
|
|
3
info.rkt
3
info.rkt
|
@ -13,7 +13,8 @@
|
||||||
"backport-template-pr1514"
|
"backport-template-pr1514"
|
||||||
"typed-map"
|
"typed-map"
|
||||||
"scribble-lib"
|
"scribble-lib"
|
||||||
"pconvert-lib"))
|
"pconvert-lib"
|
||||||
|
"remember"))
|
||||||
(define build-deps '("scribble-lib"
|
(define build-deps '("scribble-lib"
|
||||||
"racket-doc"
|
"racket-doc"
|
||||||
"remember"
|
"remember"
|
||||||
|
|
|
@ -14,3 +14,4 @@
|
||||||
(remembered! tagged-structure (| Street-incomplete| houses name))
|
(remembered! tagged-structure (| Street-incomplete| houses name))
|
||||||
(remembered! tagged-structure (| House-incomplete| owner))
|
(remembered! tagged-structure (| House-incomplete| owner))
|
||||||
(remembered! tagged-structure (| Person-incomplete| name))
|
(remembered! tagged-structure (| Person-incomplete| name))
|
||||||
|
(remembered! tagged-structure (City name))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user