You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-demo/jsonic-demo/expander.rkt

22 lines
650 B
Racket

8 years ago
#lang br/quicklang
8 years ago
(require json)
8 years ago
6 years ago
(define-macro (jsonic-mb PARSE-TREE)
8 years ago
#'(#%module-begin
8 years ago
(define result-string PARSE-TREE)
8 years ago
(define validated-jsexpr (string->jsexpr result-string))
8 years ago
(display result-string)))
6 years ago
(provide (rename-out [jsonic-mb #%module-begin]))
8 years ago
(define-macro (jsonic-char CHAR-TOK-VALUE)
#'CHAR-TOK-VALUE)
(provide jsonic-char)
8 years ago
(define-macro (jsonic-program SEXP-OR-JSON-STR ...)
#'(string-trim (string-append SEXP-OR-JSON-STR ...)))
8 years ago
(provide jsonic-program)
8 years ago
(define-macro (jsonic-sexp SEXP-STR)
8 years ago
(with-pattern ([SEXP-DATUM (format-datum '~a #'SEXP-STR)])
#'(jsexpr->string SEXP-DATUM)))
(provide jsonic-sexp)