Implemented read-level portion of quasiquote forms.
authorTim Vaughan <tgvaughan@gmail.com>
Tue, 1 Nov 2016 08:56:22 +0000 (21:56 +1300)
committerTim Vaughan <tgvaughan@gmail.com>
Tue, 1 Nov 2016 08:56:48 +0000 (21:56 +1300)
scheme.4th

index 24937a2..fc307d7 100644 (file)
@@ -262,15 +262,18 @@ objvar symbol-table
     does> dup @ swap 1+ @
 ;
 
-create-symbol quote         quote-symbol
-create-symbol define        define-symbol
-create-symbol define-macro  define-macro-symbol
-create-symbol set!          set!-symbol
-create-symbol ok            ok-symbol
-create-symbol if            if-symbol
-create-symbol lambda        lambda-symbol
-create-symbol λ             λ-symbol
-create-symbol begin         begin-symbol
+create-symbol quote             quote-symbol
+create-symbol quasiquote        quasiquote-symbol
+create-symbol unquote           unquote-symbol
+create-symbol unquote-splicing  unquote-splicing-symbol
+create-symbol define            define-symbol
+create-symbol define-macro      define-macro-symbol
+create-symbol set!              set!-symbol
+create-symbol ok                ok-symbol
+create-symbol if                if-symbol
+create-symbol lambda            lambda-symbol
+create-symbol λ                 λ-symbol
+create-symbol begin             begin-symbol
 
 \ }}}
 
@@ -966,6 +969,21 @@ parse-idx-stack parse-idx-sp !
         quote-symbol recurse nil cons cons exit
     then
 
+    nextchar [char] ` = if
+        inc-parse-idx
+        quasiquote-symbol recurse nil cons cons exit
+    then
+
+    nextchar [char] , = if
+        inc-parse-idx
+        nextchar [char] @ = if
+            inc-parse-idx
+            unquote-splicing-symbol recurse nil cons cons exit
+        else
+            unquote-symbol recurse nil cons cons exit
+        then
+    then
+
     eof? if
         EOF character-type
         inc-parse-idx