コミットメタ情報

リビジョンd02940e3c2cb96a3e0299dd701f114a55431be2c (tree)
日時2019-01-31 21:59:48
作者Agustina Arzille <avarzille@rise...>
コミッターAgustina Arzille

ログメッセージ

Fix multiple let bindings

変更サマリ

差分

diff -r 6f845cc3d3f3 -r d02940e3c2cb compiler.cpp
--- a/compiler.cpp Wed Jan 30 17:35:11 2019 -0300
+++ b/compiler.cpp Thu Jan 31 09:59:48 2019 -0300
@@ -2074,7 +2074,7 @@
20742074
20752075 for (int i = 0; i < ap->len; ++i)
20762076 {
2077- if (nksymbol_p (ap->data[i]))
2077+ if (symbol_p (ap->data[i]))
20782078 ++ret;
20792079 else if (array_p (ap->data[i]))
20802080 ret += array_nbindings (interp, ap->data[i]);
@@ -2133,7 +2133,7 @@
21332133 else
21342134 for (object tmp = bindings; tmp != NIL; )
21352135 {
2136- if (!nksymbol_p (xcar (tmp)) && !array_p (tmp))
2136+ if (!nksymbol_p (xcar (tmp)) && !array_p (xcar (tmp)))
21372137 bc.interp->raise2 ("arg-error", io_sprintf (bc.interp,
21382138 "let: invalid binding: %Q", xcar (tmp)));
21392139
@@ -2162,13 +2162,20 @@
21622162 ret += flatten_array_args (bc, syms + ret, ap->data[i]);
21632163 else
21642164 {
2165- if (special_symbol_p (ap->data[i]))
2165+ object tmp = ap->data[i];
2166+
2167+ if (special_symbol_p (tmp))
21662168 {
21672169 bc.emit (OPX_(LOADNIL));
2168- bc.emit (OPX_(BIND), ap->data[i]);
2170+ bc.emit (OPX_(BIND), tmp);
21692171 }
2170-
2171- syms[ret].car = ap->data[i];
2172+ else if (keyword_p (tmp))
2173+ {
2174+ tmp = intern (bc.interp, as_str (symname (tmp)));
2175+ bc.interp->push (tmp);
2176+ }
2177+
2178+ syms[ret].car = tmp;
21722179 syms[ret].cdr = syms[ret + 1].as_obj ();
21732180 ++ret;
21742181 }
旧リポジトリブラウザで表示