• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revision8272a9b5e54c8474e769cee7557127c7ed247c40 (tree)
Time2019-08-13 11:09:49
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

swoncat and fiddling with parser.

Change Summary

Incremental Difference

diff -r 482351329728 -r 8272a9b5e54c thun/gnu-prolog/defs.pl
--- a/thun/gnu-prolog/defs.pl Sun Aug 11 21:30:02 2019 -0700
+++ b/thun/gnu-prolog/defs.pl Mon Aug 12 19:09:49 2019 -0700
@@ -58,6 +58,7 @@
5858 def(sqr,[dup,*]).
5959 def(step_zero,[0,rollup,step]).
6060 def(sum,[0,swap,[+],step]).
61+def(swoncat,[swap,concat]).
6162 def(swons,[swap,cons]).
6263 def(take,[[],rolldown,[shift],times,pop]).
6364 def(ternary,[binary,popd]).
diff -r 482351329728 -r 8272a9b5e54c thun/gnu-prolog/defs.txt
--- a/thun/gnu-prolog/defs.txt Sun Aug 11 21:30:02 2019 -0700
+++ b/thun/gnu-prolog/defs.txt Mon Aug 12 19:09:49 2019 -0700
@@ -61,6 +61,7 @@
6161 sqr == dup *
6262 step_zero == 0 rollup step
6363 sum == 0 swap [+] step
64+swoncat == swap concat
6465 swons == swap cons
6566 take == [] rolldown [shift] times pop
6667 ternary == binary popd
diff -r 482351329728 -r 8272a9b5e54c thun/gnu-prolog/parser.pl
--- a/thun/gnu-prolog/parser.pl Sun Aug 11 21:30:02 2019 -0700
+++ b/thun/gnu-prolog/parser.pl Mon Aug 12 19:09:49 2019 -0700
@@ -46,13 +46,13 @@
4646 chars([Ch|Rest]) --> char(Ch), chars(Rest).
4747 chars([Ch]) --> char(Ch).
4848
49-char(Ch) --> [Ch], { Ch \== 0'[, Ch \== 0'], Ch >= 33, Ch =< 126 }.
49+char(Ch) --> [Ch], { Ch \== 0'[, Ch \== 0'], between(33, 126, Ch) }.
5050
5151
5252 blanks --> blank, !, blanks.
5353 blanks --> [].
5454
55-blank --> [32] | [13] | [10].
55+blank --> [Ch], { Ch =:= 32 ; between(9, 13, Ch) }.
5656
5757
5858 % TODO: negative numbers, floats, scientific notation.
Show on old repository browser