• R/O
  • SSH

Joypy: コミット

Main interpreter and library.


コミットメタ情報

リビジョン4a55a817f3f096fa3cda43c1740386f1f11dc9db (tree)
日時2019-08-14 03:29:49
作者Simon Forman <sforman@hush...>
コミッターSimon Forman

ログメッセージ

Parse ints; move line/{1,2} to main.pl.

変更サマリ

差分

diff -r 9de273f70952 -r 4a55a817f3f0 thun/gnu-prolog/main.pl
--- a/thun/gnu-prolog/main.pl Tue Aug 13 11:24:28 2019 -0700
+++ b/thun/gnu-prolog/main.pl Tue Aug 13 11:29:49 2019 -0700
@@ -41,3 +41,13 @@
4141 prompt :- write(`joy? `).
4242 show_stack(S) :- nl, print_stack(S), write(` <-top`), nl, nl.
4343
44+
45+% Line is the next new-line delimited line from standard input stream as
46+% a list of character codes.
47+
48+line(Line) :- get_code(X), line(X, Line).
49+
50+line(10, []) :- !. % break on new-lines.
51+line(-1, [eof]) :- !. % break on EOF
52+line(X, [X|Line]) :- get_code(Y), !, line(Y, Line).
53+
diff -r 9de273f70952 -r 4a55a817f3f0 thun/gnu-prolog/parser.pl
--- a/thun/gnu-prolog/parser.pl Tue Aug 13 11:24:28 2019 -0700
+++ b/thun/gnu-prolog/parser.pl Tue Aug 13 11:29:49 2019 -0700
@@ -41,6 +41,7 @@
4141
4242 signed_float_or_integer(Codes) --> signed_digits(J), ".", !, digits(I),
4343 { append(J, [0'.|I], Codes) }.
44+signed_float_or_integer(Codes) --> signed_digits(Codes).
4445
4546 signed_digits([45|Codes]) --> "-", !, digits(Codes).
4647 signed_digits( Codes ) --> digits(Codes).
@@ -69,16 +70,6 @@
6970 one_or_more_([Ch], P) --> call(P, Ch).
7071
7172
72-% Line is the next new-line delimited line from standard input stream as
73-% a list of character codes.
74-
75-line(Line) :- get_code(X), line(X, Line).
76-
77-line(10, []) :- !. % break on new-lines.
78-line(-1, [eof]) :- !. % break on EOF
79-line(X, [X|Line]) :- get_code(Y), !, line(Y, Line).
80-
81-
8273 /*
8374
8475 Print state.
旧リポジトリブラウザで表示