summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-03-07 08:41:45 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-03-07 08:41:45 +0100
commit2bd13a69e5f54b4c8b95ec25766b1d846f77a19e (patch)
tree2fb42c0c77539d62ebb95f923b49a47f6f8638c0
parent04332e70eb9a497014002b4c668768638c8c2865 (diff)
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.
-rw-r--r--language/aws/spec.scm9
1 files changed, 8 insertions, 1 deletions
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)