json testing
authorken <ken@mihrtec.com>
Sat, 17 Mar 2018 05:27:08 +0000 (22:27 -0700)
committerken <ken@mihrtec.com>
Sat, 17 Mar 2018 05:27:08 +0000 (22:27 -0700)
forth.forth

index 5c9834f..8f609d7 100644 (file)
@@ -155,6 +155,24 @@ here define-does then compiling ;
 : '> word find-does ;
 :> '> word find-does , ;
 
+\ CHAR 
+: CHAR: word drop @8_u ;
+:> CHAR: lit lit , ' char: execute , ;
+
+\ JSON Compiler
+: JSON-CTRL-CHAR? char: { =? if 1 ;; then
+                  char: } =? if 1 ;; then
+                  char: [ =? if 1 ;; then
+                  char: ] =? if 1 ;; then
+                  0 ;
+: JSON-PARSE-V ;
+: JSON-PARSE-" ;
+: JSON-PARSE-[ ;
+: JSON-PARSE-{ ;
+: JSON-WORD word-start key JSON-CTRL-CHAR? if word-end ;; then ws?   ;
+
+: JSON{ key ; 
+
 \ Include a remote file
 : REQUIRE" ' quit channel-open dup \' " \, fetch channel-await ;