better names in jsonic

pull/10/head
Matthew Butterick 8 years ago
parent 2eb46aaa81
commit afa9af72d8

@ -8,15 +8,15 @@
(display result-string)))
(provide (rename-out [js-module-begin #%module-begin]))
(define-macro (jsonic-char CHAR-TOK-VALUE)
#'CHAR-TOK-VALUE)
(provide jsonic-char)
(define-macro (jsonic-program SEXP-OR-JSON-STR ...)
#'(string-trim (string-append SEXP-OR-JSON-STR ...)))
(provide jsonic-program)
(define-macro (json-char CHAR-STR)
#'CHAR-STR)
(provide json-char)
(define-macro (s-exp SEXP-STR)
(define-macro (jsonic-sexp SEXP-STR)
(with-pattern ([SEXP-DATUM (format-datum '~a #'SEXP-STR)])
#'(jsexpr->string SEXP-DATUM)))
(provide s-exp)
(provide jsonic-sexp)

@ -8,19 +8,19 @@
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer "@$ 42 $@"))
'(jsonic-program (s-exp " 42 ")))
'(jsonic-program (jsonic-sexp " 42 ")))
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer "hi"))
'(jsonic-program
(json-char "h")
(json-char "i")))
(jsonic-char "h")
(jsonic-char "i")))
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer
"hi\n// comment\n@$ 42 $@"))
'(jsonic-program
(json-char "h")
(json-char "i")
(json-char "\n")
(s-exp " 42 ")))
(jsonic-char "h")
(jsonic-char "i")
(jsonic-char "\n")
(jsonic-sexp " 42 ")))

@ -1,4 +1,4 @@
#lang brag
jsonic-program: (json-char | s-exp)*
json-char: CHAR-TOK
s-exp: SEXP-TOK
jsonic-program : (jsonic-char | jsonic-sexp)*
jsonic-char : CHAR-TOK
jsonic-sexp : SEXP-TOK

@ -8,15 +8,15 @@
(display result-string)))
(provide (rename-out [js-module-begin #%module-begin]))
(define-macro (jsonic-char CHAR-TOK-VALUE)
#'CHAR-TOK-VALUE)
(provide jsonic-char)
(define-macro (jsonic-program SEXP-OR-JSON-STR ...)
#'(string-trim (string-append SEXP-OR-JSON-STR ...)))
(provide jsonic-program)
(define-macro (json-char CHAR-STR)
#'CHAR-STR)
(provide json-char)
(define-macro (s-exp SEXP-STR)
(define-macro (jsonic-sexp SEXP-STR)
(with-pattern ([SEXP-DATUM (format-datum '~a #'SEXP-STR)])
#'(jsexpr->string SEXP-DATUM)))
(provide s-exp)
(provide jsonic-sexp)

@ -8,19 +8,19 @@
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer "@$ 42 $@"))
'(jsonic-program (s-exp " 42 ")))
'(jsonic-program (jsonic-sexp " 42 ")))
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer "hi"))
'(jsonic-program
(json-char "h")
(json-char "i")))
(jsonic-char "h")
(jsonic-char "i")))
(check-equal?
(parse-tree
(apply-tokenizer-maker make-tokenizer
"hi\n// comment\n@$ 42 $@"))
'(jsonic-program
(json-char "h")
(json-char "i")
(json-char "\n")
(s-exp " 42 ")))
(jsonic-char "h")
(jsonic-char "i")
(jsonic-char "\n")
(jsonic-sexp " 42 ")))

@ -1,4 +1,4 @@
#lang brag
jsonic-program: (json-char | s-exp)*
json-char: CHAR-TOK
s-exp: SEXP-TOK
jsonic-program : (jsonic-char | jsonic-sexp)*
jsonic-char : CHAR-TOK
jsonic-sexp : SEXP-TOK

@ -8,15 +8,15 @@
(display result-string)))
(provide (rename-out [js-module-begin #%module-begin]))
(define-macro (jsonic-char CHAR-TOK-VALUE)
#'CHAR-TOK-VALUE)
(provide jsonic-char)
(define-macro (jsonic-program SEXP-OR-JSON-STR ...)
#'(string-trim (string-append SEXP-OR-JSON-STR ...)))
(provide jsonic-program)
(define-macro (json-char CHAR-STR)
#'CHAR-STR)
(provide json-char)
(define-macro (s-exp SEXP-STR)
(define-macro (jsonic-sexp SEXP-STR)
(with-pattern ([SEXP-DATUM (format-datum '~a #'SEXP-STR)])
#'(jsexpr->string SEXP-DATUM)))
(provide s-exp)
(provide jsonic-sexp)

@ -1,4 +1,4 @@
#lang brag
jsonic-program: (json-char | s-exp)*
json-char: CHAR-TOK
s-exp: SEXP-TOK
jsonic-program : (jsonic-char | jsonic-sexp)*
jsonic-char : CHAR-TOK
jsonic-sexp : SEXP-TOK

Loading…
Cancel
Save