endef
define EVAL
-$(if $(READLINE_EOF),,\
- $(if $(findstring =,$(1)),$(eval $(1))$($(word 1,$(1))),$(eval __return := $(1))$(__return)))
+$(if $(READLINE_EOF),,$(1))
endef
define PRINT
hello world abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 (;:() []{}"'* ;:() []{}"'* ;:() []{}"'*)
;=>hello world abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 (;:() []{}"'* ;:() []{}"'* ;:() []{}"'*)
+;; Non alphanumeric characters
+!
+;=>!
+&
+;=>&
++
+;=>+
+,
+;=>,
+-
+;=>-
+/
+;=>/
+<
+;=><
+=
+;=>=
+>
+;=>>
+?
+;=>?
+@
+;=>@
+;;; Behaviour of backslash is not specified enough to test anything in step0.
+^
+;=>^
+_
+;=>_
+`
+;=>`
+~
+;=>~
+
+;>>> soft=True
+;>>> optional=True
+;; ------- Optional Functionality --------------
+;; ------- (Not needed for self-hosting) -------
+
+;; Non alphanumeric characters
+#
+;=>#
+$
+;=>$
+%
+;=>%
+.
+;=>.
+|
+;=>|
;=>"abc (with parens)"
"abc\"def"
;=>"abc\"def"
-;;;"abc\ndef"
-;;;;=>"abc\ndef"
""
;=>""
+"&"
+;=>"&"
+"'"
+;=>"'"
+"("
+;=>"("
+")"
+;=>")"
+"*"
+;=>"*"
+"+"
+;=>"+"
+","
+;=>","
+"-"
+;=>"-"
+":"
+;=>":"
+";"
+;=>";"
+"<"
+;=>"<"
+"="
+;=>"="
+">"
+;=>">"
+"?"
+;=>"?"
+"@"
+;=>"@"
+"["
+;=>"["
+"]"
+;=>"]"
+"^"
+;=>"^"
+"_"
+;=>"_"
+"`"
+;=>"`"
+"{"
+;=>"{"
+"}"
+;=>"}"
+"~"
+;=>"~"
;; Testing reader errors
(1 2
;; Testing read of @/deref
@a
;=>(deref a)
+
+;>>> soft=True
+
+;; Non alphanumerice characters in strings
+;;; \t is not specified enough to be tested
+"\n"
+;=>"\n"
+"#"
+;=>"#"
+"$"
+;=>"$"
+"%"
+;=>"%"
+"."
+;=>"."
+"\\"
+;=>"\\"
+"|"
+;=>"|"
+
+;; Non alphanumeric characters in comments
+1;!
+;=>1
+1;"
+;=>1
+1;#
+;=>1
+1;$
+;=>1
+1;%
+;=>1
+1;'
+;=>1
+1;\
+;=>1
+1;\\
+;=>1
+1;\\\
+;=>1
+1;`
+;=>1
+;;; Hopefully less problematic characters
+1; &()*+,-./:;<=>?@[]^_{|}~
+
+;; FIXME: These tests have no reasons to be optional, but...
+;; fantom fails this one
+"!"
+;=>"!"
+;; io fails this one
+"/"
+;=>"/"
;=>true
*ARGV*
;=>()
+
+;>>> soft=True
+
+;; Non alphanumeric characters in comments in read-string
+(read-string "1;!")
+;=>1
+(read-string "1;\"")
+;=>1
+(read-string "1;#")
+;=>1
+(read-string "1;$")
+;=>1
+(read-string "1;%")
+;=>1
+(read-string "1;'")
+;=>1
+(read-string "1;\\")
+;=>1
+(read-string "1;\\\\")
+;=>1
+(read-string "1;\\\\\\")
+;=>1
+(read-string "1;`")
+;=>1
+;;; Hopefully less problematic characters can be checked together
+(read-string "1; &()*+,-./:;<=>?@[]^_{|}~")
+;=>1