• R/O
  • SSH

Joypy: コミット

Main interpreter and library.


コミットメタ情報

リビジョン9de273f70952addb44a74c5e81684f318c2a51aa (tree)
日時2019-08-14 03:24:28
作者Simon Forman <sforman@hush...>
コミッターSimon Forman

ログメッセージ

Parse floating point numbers.

変更サマリ

差分

diff -r 6f359630c98a -r 9de273f70952 thun/gnu-prolog/parser.pl
--- a/thun/gnu-prolog/parser.pl Mon Aug 12 22:29:09 2019 -0700
+++ b/thun/gnu-prolog/parser.pl Tue Aug 13 11:24:28 2019 -0700
@@ -34,9 +34,14 @@
3434
3535
3636 symbol(C) --> chars(Chars), !, { Chars \= "==", atom_codes(C, Chars) }.
37-num(N) --> signed_digits(Codes), !, end_num, { number_codes(N, Codes) }.
37+num(N) --> number_digits(Codes), { number_codes(N, Codes) }.
38+
39+number_digits(Codes) --> signed_float_or_integer(Codes), !, end_num.
3840 % TODO: floats, scientific notation.
3941
42+signed_float_or_integer(Codes) --> signed_digits(J), ".", !, digits(I),
43+ { append(J, [0'.|I], Codes) }.
44+
4045 signed_digits([45|Codes]) --> "-", !, digits(Codes).
4146 signed_digits( Codes ) --> digits(Codes).
4247
diff -r 6f359630c98a -r 9de273f70952 thun/gnu-prolog/thun.pl
--- a/thun/gnu-prolog/thun.pl Mon Aug 12 22:29:09 2019 -0700
+++ b/thun/gnu-prolog/thun.pl Tue Aug 13 11:24:28 2019 -0700
@@ -124,7 +124,6 @@
124124 combo(dipd, [P, X, Y|S], S, Ei, Eo) :- append(P, [Y, X|Ei], Eo).
125125
126126 combo(dupdip, [P, X|S], [X|S], Ei, Eo) :- append(P, [X|Ei], Eo).
127-combo(dupdip, [P, X|S], [X|S], Ei, Eo) :- append(P, [X|Ei], Eo).
128127
129128 combo(branch, [T, _, true|S], S, Ei, Eo) :- append(T, Ei, Eo).
130129 combo(branch, [_, F, false|S], S, Ei, Eo) :- append(F, Ei, Eo).
旧リポジトリブラウザで表示