From: Tim Vaughan Date: Tue, 1 Nov 2016 08:56:22 +0000 (+1300) Subject: Implemented read-level portion of quasiquote forms. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=7ea88126cc603f83d9bfd54816bc47e88a12e7cf;p=scheme.forth.jl.git Implemented read-level portion of quasiquote forms. --- diff --git a/scheme.4th b/scheme.4th index 24937a2..fc307d7 100644 --- a/scheme.4th +++ b/scheme.4th @@ -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