From 2bd13a69e5f54b4c8b95ec25766b1d846f77a19e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 7 Mar 2021 08:41:45 +0100 Subject: spec: compile-shape-stubs: Record encountered shape specs. We use this when compiling structures to determine if a structure member is a wrapper around a primitive type. --- language/aws/spec.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/language/aws/spec.scm b/language/aws/spec.scm index 2b63606..3a6614b 100644 --- a/language/aws/spec.scm +++ b/language/aws/spec.scm @@ -24,6 +24,8 @@ #:use-module (system base language) #:export (aws)) +(define %shape-specs (list)) + (define (primitive? exp) (member (assoc-ref exp "type") '("string" @@ -109,7 +111,12 @@ if this is not a primitive data type." (define (compile-shape-stubs exp) "Compile an AWS shape expression EXP to a stub." (match exp - ((name . _) + ((name . spec) + ;; Record shape spec for later type checking + (set! %shape-specs + (acons (string->symbol name) + (alist-delete "documentation" spec) + %shape-specs)) `(define ,(string->symbol name) #f)))) (define (compile-shape exp) -- cgit v1.2.3