diff --git a/beautiful-racket-demo/jsonic-demo-2/expander.rkt b/beautiful-racket-demo/jsonic-demo-2/expander.rkt index 2744e5a..b2f58d3 100644 --- a/beautiful-racket-demo/jsonic-demo-2/expander.rkt +++ b/beautiful-racket-demo/jsonic-demo-2/expander.rkt @@ -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) \ No newline at end of file +(provide jsonic-sexp) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo-2/parser-test.rkt b/beautiful-racket-demo/jsonic-demo-2/parser-test.rkt index 2cea79c..794d965 100644 --- a/beautiful-racket-demo/jsonic-demo-2/parser-test.rkt +++ b/beautiful-racket-demo/jsonic-demo-2/parser-test.rkt @@ -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 "))) \ No newline at end of file + (jsonic-char "h") + (jsonic-char "i") + (jsonic-char "\n") + (jsonic-sexp " 42 "))) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo-2/parser.rkt b/beautiful-racket-demo/jsonic-demo-2/parser.rkt index 69a706d..7b35992 100644 --- a/beautiful-racket-demo/jsonic-demo-2/parser.rkt +++ b/beautiful-racket-demo/jsonic-demo-2/parser.rkt @@ -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 diff --git a/beautiful-racket-demo/jsonic-demo-3/expander.rkt b/beautiful-racket-demo/jsonic-demo-3/expander.rkt index 2744e5a..b2f58d3 100644 --- a/beautiful-racket-demo/jsonic-demo-3/expander.rkt +++ b/beautiful-racket-demo/jsonic-demo-3/expander.rkt @@ -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) \ No newline at end of file +(provide jsonic-sexp) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo-3/parser-test.rkt b/beautiful-racket-demo/jsonic-demo-3/parser-test.rkt index 2cea79c..794d965 100644 --- a/beautiful-racket-demo/jsonic-demo-3/parser-test.rkt +++ b/beautiful-racket-demo/jsonic-demo-3/parser-test.rkt @@ -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 "))) \ No newline at end of file + (jsonic-char "h") + (jsonic-char "i") + (jsonic-char "\n") + (jsonic-sexp " 42 "))) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo-3/parser.rkt b/beautiful-racket-demo/jsonic-demo-3/parser.rkt index 69a706d..7b35992 100644 --- a/beautiful-racket-demo/jsonic-demo-3/parser.rkt +++ b/beautiful-racket-demo/jsonic-demo-3/parser.rkt @@ -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 diff --git a/beautiful-racket-demo/jsonic-demo/expander.rkt b/beautiful-racket-demo/jsonic-demo/expander.rkt index 2744e5a..b2f58d3 100644 --- a/beautiful-racket-demo/jsonic-demo/expander.rkt +++ b/beautiful-racket-demo/jsonic-demo/expander.rkt @@ -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) \ No newline at end of file +(provide jsonic-sexp) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo/parser.rkt b/beautiful-racket-demo/jsonic-demo/parser.rkt index 69a706d..7b35992 100644 --- a/beautiful-racket-demo/jsonic-demo/parser.rkt +++ b/beautiful-racket-demo/jsonic-demo/parser.rkt @@ -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