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:
Georges Dupéron 2017-01-20 00:28:47 +01:00
parent 411c386bb1
commit 2de609c523
4 changed files with 12 additions and 7 deletions

View File

@ -139,7 +139,7 @@ return the corresponding node can be written based on it.
@chunk[<node-info>
(struct+/contract node-info
([predicate? identifier?] ;; (expr/τ (→ Any Boolean : ?))
([predicate? identifier?]
[field-order (listof identifier?)]
[fields (hash/c symbol? field-info? #:immutable #t)]
[promise-type stx-type/c]

View File

@ -25,12 +25,14 @@
{~seq #:invariant a {~and op {~or }} b}
{~seq #:invariant p} ))))
(define-for-syntax compute-graph-info
(syntax-parser
[:signature <graph-info>]))
(define-for-syntax (compute-graph-info stx)
(parameterize ([disable-remember-immediate-error #t])
(syntax-parse stx
[:signature
<graph-info>])))
(define-syntax/parse (define-graph-type . whole:signature)
;; fire off the eventual errors within macro-expansion.
(compute-graph-info #'whole)
;; fire off the eventual delayed errors added by compute-graph-info
(lift-maybe-delayed-errors)
#`(begin
(define-syntax whole.name
(compute-graph-info (quote-syntax whole)))))]
@ -86,6 +88,7 @@
@chunk[<*>
(require racket/require
phc-toolkit
remember
(lib "phc-adt/tagged-structure-low-level.hl.rkt")
(for-syntax "graph-info.hl.rkt"
phc-toolkit/untyped

View File

@ -13,7 +13,8 @@
"backport-template-pr1514"
"typed-map"
"scribble-lib"
"pconvert-lib"))
"pconvert-lib"
"remember"))
(define build-deps '("scribble-lib"
"racket-doc"
"remember"

View File

@ -14,3 +14,4 @@
(remembered! tagged-structure (| Street-incomplete| houses name))
(remembered! tagged-structure (| House-incomplete| owner))
(remembered! tagged-structure (| Person-incomplete| name))
(remembered! tagged-structure (City name))