Add missing reference-data and special-forms-data helpers
These were lost during an earlier sx_replace_node edit. Both use case expressions to route slugs to the correct data tables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,17 @@
|
|||||||
|
|
||||||
(define primitives-data (fn () primitives-by-category))
|
(define primitives-data (fn () primitives-by-category))
|
||||||
|
|
||||||
|
(define
|
||||||
|
special-forms-data
|
||||||
|
(fn
|
||||||
|
()
|
||||||
|
(let
|
||||||
|
((source (read-spec-file "special-forms.sx")))
|
||||||
|
(if
|
||||||
|
(starts-with? source ";;")
|
||||||
|
{:categories (list)}
|
||||||
|
(categorize-special-forms (parse source))))))
|
||||||
|
|
||||||
(define
|
(define
|
||||||
_spec-search-dirs
|
_spec-search-dirs
|
||||||
(fn
|
(fn
|
||||||
@@ -74,6 +85,26 @@
|
|||||||
(_spec-search-dirs))
|
(_spec-search-dirs))
|
||||||
(or result (str ";; spec file not found: " filename)))))
|
(or result (str ";; spec file not found: " filename)))))
|
||||||
|
|
||||||
|
(define
|
||||||
|
reference-data
|
||||||
|
(fn
|
||||||
|
(slug)
|
||||||
|
(let
|
||||||
|
((raw-data (case slug "attributes" {:req-attrs request-attrs :beh-attrs behavior-attrs :uniq-attrs sx-unique-attrs} "headers" {:req-headers request-headers :resp-headers response-headers} "events" {:events-list events-list} "js-api" {:js-api-list js-api-list} :else {:req-attrs request-attrs :beh-attrs behavior-attrs :uniq-attrs sx-unique-attrs}))
|
||||||
|
(detail-keys
|
||||||
|
(case
|
||||||
|
slug
|
||||||
|
"attributes"
|
||||||
|
(keys attr-details)
|
||||||
|
"headers"
|
||||||
|
(keys header-details)
|
||||||
|
"events"
|
||||||
|
(keys event-details)
|
||||||
|
"js-api"
|
||||||
|
(list)
|
||||||
|
:else (keys attr-details))))
|
||||||
|
(build-reference-data slug raw-data detail-keys))))
|
||||||
|
|
||||||
(define
|
(define
|
||||||
attr-detail-data
|
attr-detail-data
|
||||||
(fn (slug) (build-attr-detail slug (get attr-details slug))))
|
(fn (slug) (build-attr-detail slug (get attr-details slug))))
|
||||||
|
|||||||
Reference in New Issue
Block a user