summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-09 09:21:37 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-09 09:21:37 +0000
commitc1241cd2ed230573bb81b52173d6cd2bd91176f2 (patch)
treecaa3babd9a35b930814fffa9c8ebb3366d46dae8
parent17ae11ca25d210da8c7deeeee0f03fd1a09ee0b2 (diff)
thread bugs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog75
-rw-r--r--MANIFEST5
-rw-r--r--README6
-rw-r--r--README.jp16
-rw-r--r--config.guess2
-rw-r--r--configure373
-rw-r--r--configure.in55
-rw-r--r--dln.c59
-rw-r--r--eval.c107
-rw-r--r--ext/extmk.rb.in31
-rw-r--r--ext/md5/md5init.c24
-rw-r--r--ext/pty/pty.c4
-rw-r--r--ext/readline/extconf.rb1
-rw-r--r--ext/socket/addrinfo.h3
-rw-r--r--ext/socket/depend4
-rw-r--r--ext/socket/extconf.rb9
-rw-r--r--ext/socket/getnameinfo.c28
-rw-r--r--ext/socket/socket.c46
-rw-r--r--ext/socket/sockport.h6
-rw-r--r--ext/tcltklib/tcltklib.c131
-rw-r--r--ext/tk/lib/tktext.rb165
-rw-r--r--hash.c7
-rw-r--r--intern.h3
-rw-r--r--io.c21
-rw-r--r--lib/telnet.rb363
-rw-r--r--lib/tempfile.rb6
-rw-r--r--marshal.c2
-rw-r--r--misc/ruby-mode.el22
-rw-r--r--mkconfig.rb2
-rw-r--r--object.c2
-rw-r--r--pack.c377
-rw-r--r--parse.c7571
-rw-r--r--parse.y46
-rw-r--r--regex.c7
-rw-r--r--regex.h1
-rw-r--r--ruby.h14
-rw-r--r--rubyio.h1
-rw-r--r--sample/README10
-rw-r--r--string.c14
-rw-r--r--variable.c5
-rw-r--r--version.c19
-rw-r--r--version.h5
42 files changed, 1372 insertions, 8276 deletions
diff --git a/ChangeLog b/ChangeLog
index ad65e87597..db88aafac7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,80 @@
+Wed Jun 9 13:26:38 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * eval.c (rb_thread_loading): modified to avoid nested race
+ condition of require().
+
+ * ext/tcltklib/tcltklib.c (ip_invoke): queue invocation on non
+ main threads.
+
+ * ext/tcltklib/tcltklib.c (lib_mainloop): flush invoke queues.
+
+ * version.c (ruby_show_version): now print the message to stdout.
+
+ * version.c (ruby_show_copyright): ditto.
+
+Tue Jun 8 00:00:34 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * pack.c (pack_unpack): append sentinel (NUL) to the string.
+
+ * ext/md5/md5init.c (md5_hexdigest): new method to obtain
+ printable hash string.
+
+ * ext/md5/md5init.c (md5_update): should return self.
+
+ * pack.c (pack_pack): undocumented template 'U' for UTF8.
+
+ * pack.c (pack_unpack): ditto.
+
+ * marshal.c (r_byte): should replace getc() with rb_getc().
+
+ * io.c (rb_getc): getc() replacement uses READ_DATA_PENDING() and
+ rb_thread_wait_fd().
+
+Mon Jun 7 23:23:38 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * object.c (rb_mod_clone): should call CLOSESETUP().
+
+ * eval.c (bind_clone): should call CLONESETUP() for new clone.
+
+Sat Jun 5 10:32:40 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * string.c (rb_str_oct): binary (e.g. 0b10111) support.
+
+ * variable.c (rb_const_set): raise warning, not exception.
+
+ * parse.y (yycompile): initialize parser internal variables.
+
+ * parse.y (close_paren): set lex_state to EXPR_PAREN after closing
+ parenthesis.
+
+ * parse.y (yylex): returns kDO for `do' right after method_call.
+
+Thu Jun 3 11:05:30 1999 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * regex.c (read_backslash): should decode \b within class.
+
+Thu Jun 3 01:06:18 1999 Katsuyuki Komatsu <komatsu@sarion.co.jp>
+
+ * dln.c (dln_load): AIX improvement (aix_findmain removed).
+
+Wed Jun 2 00:41:31 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * pack.c (pack_unpack): new undocumented template Z which strips
+ stuff after first null.
+
+ * pack.c (pack_pack): should preserve specified length of the
+ resulting string.
+
Tue Jun 1 15:29:33 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+ * ext/socket/socket.c (ruby_socket): retry after GC, if socket(2)
+ failed on EMFILE or ENFILE.
+
+ * ext/socket/socket.c (sock_s_socketpair): ditto.
+
+ * eval.c (module_setup): need to add PUSH_VAR/POP_VAR to clear
+ dyna vars link list.
+
* version.h (RUBY_RELEASE_CODE): integer macro contant for source
version detection.
diff --git a/MANIFEST b/MANIFEST
index 941f22f4b2..e9a2bfca0f 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -76,6 +76,7 @@ variable.c
version.c
version.h
beos/ruby.def.in
+cygwin/GNUmakefile.in
ext/Setup
ext/Setup.dj
ext/Setup.emx
@@ -85,6 +86,7 @@ ext/aix_mksym.rb
ext/cygwin32_ld.rb
ext/extmk.rb.in
ext/extmk.rb.nt
+lib/CGI.rb
lib/English.rb
lib/Env.rb
lib/README
@@ -171,6 +173,8 @@ sample/cbreak.rb
sample/clnt.rb
sample/dbmtest.rb
sample/dir.rb
+sample/dualstack-fetch.rb
+sample/dualstack-httpd.rb
sample/eval.rb
sample/export.rb
sample/exyacc.rb
@@ -204,6 +208,7 @@ sample/rbc.rb
sample/rcs.awk
sample/rcs.dat
sample/rcs.rb
+sample/rd2html.rb
sample/regx.rb
sample/sieve.rb
sample/svr.rb
diff --git a/README b/README
index b4b429f45d..44e0844a8f 100644
--- a/README
+++ b/README
@@ -98,9 +98,9 @@ You can redistribute it and/or modify it under either the terms of the GPL
4. You may modify and include the part of the software into any other
software (possibly commercial). But some files in the distribution
are not written by the author, so that they are not under this terms.
- They are gc.c(partly), utils.c(partly), regex.[ch], glob.c, st.[ch]
- and some files under the ./missing directory. See each file for the
- copying condition.
+ They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
+ files under the ./missing directory. See each file for the copying
+ condition.
5. The scripts and library files supplied as input to or produced as
output from the software do not automatically fall under the
diff --git a/README.jp b/README.jp
index 5e3b2301b0..4e2be09b26 100644
--- a/README.jp
+++ b/README.jp
@@ -35,21 +35,21 @@ Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい強力
* ホームページ
- RubyのホームページのURLは
+RubyのホームページのURLは
http://www.netlab.co.jp/ruby/jp/
- です.
+です.
* メーリングリスト
- Rubyに関わる話題のためのメーリングリストを開設しました.ア
- ドレスは
+Rubyに関わる話題のためのメーリングリストを開設しました.ア
+ドレスは
ruby-list@netlab.co.jp
- です.このアドレスにメールを送れば,自動的に登録されます.
+です.このアドレスにメールを送れば,自動的に登録されます.
* コンパイル・インストール
@@ -150,9 +150,9 @@ Licence)または以下に示す条件でRubyを再配布できます.GPLにつ
4. 他のプログラムへの引用はいかなる目的であれ自由です.た
だし,Rubyに含まれる他の作者によるコードは,それぞれの
作者の意向による制限が加えられます.具体的にはgc.c(一部),
- util.c(一部),st.[ch],regex.[ch], glob.c および.
- /missingディレクトリ下のファイル群が該当します.それぞ
- れの配布条件などに付いては各ファイルを参照してください.
+ util.c(一部),st.[ch],regex.[ch] および. /missingディ
+ レクトリ下のファイル群が該当します.それぞれの配布条件
+ などに付いては各ファイルを参照してください.
5. Rubyへの入力となるスクリプトおよび,Rubyからの出力の権
利はRubyの作者ではなく,それぞれの入出力を生成した人に
diff --git a/config.guess b/config.guess
index e29d6abdd1..058230d7d4 100644
--- a/config.guess
+++ b/config.guess
@@ -382,7 +382,7 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
+ 9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[13679] | 9000/892 )
sed 's/^ //' << EOF >dummy.c
#include <stdlib.h>
#include <unistd.h>
diff --git a/configure b/configure
index 91f45e37ed..bbd57cdf5a 100644
--- a/configure
+++ b/configure
@@ -1684,10 +1684,11 @@ openstep*) ;;
rhapsody*) ;;
human*) ;;
beos*) ;;
+cygwin*) ;;
*) LIBS="-lm $LIBS";;
esac
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1691: checking for crypt in -lcrypt" >&5
+echo "configure:1692: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1695,7 +1696,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1699 "configure"
+#line 1700 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1706,7 +1707,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1734,7 +1735,7 @@ else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1738: checking for dlopen in -ldl" >&5
+echo "configure:1739: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1742,7 +1743,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1746 "configure"
+#line 1747 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1753,7 +1754,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1781,7 +1782,7 @@ else
fi
# Dynamic linking for SunOS/Solaris and SYSV
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:1785: checking for shl_load in -ldld" >&5
+echo "configure:1786: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1789,7 +1790,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1793 "configure"
+#line 1794 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1800,7 +1801,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1828,7 +1829,7 @@ else
fi
# Dynamic linking for HP-UX
echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:1832: checking for setlocale in -lxpg4" >&5
+echo "configure:1833: checking for setlocale in -lxpg4" >&5
ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1836,7 +1837,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lxpg4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1840 "configure"
+#line 1841 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1847,7 +1848,7 @@ int main() {
setlocale()
; return 0; }
EOF
-if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1880,12 +1881,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1884: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1885: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 1890 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1893,7 +1894,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1918,7 +1919,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1922: checking for opendir in -ldir" >&5
+echo "configure:1923: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1926,7 +1927,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1930 "configure"
+#line 1931 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1937,7 +1938,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1959,7 +1960,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1963: checking for opendir in -lx" >&5
+echo "configure:1964: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1967,7 +1968,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1971 "configure"
+#line 1972 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1978,7 +1979,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2001,12 +2002,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2005: checking for ANSI C header files" >&5
+echo "configure:2006: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2010 "configure"
+#line 2011 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2014,7 +2015,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2031,7 +2032,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2035 "configure"
+#line 2036 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2049,7 +2050,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2053 "configure"
+#line 2054 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2070,7 +2071,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2074 "configure"
+#line 2075 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2081,7 +2082,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2110,17 +2111,17 @@ for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2114: checking for $ac_hdr" >&5
+echo "configure:2115: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2119 "configure"
+#line 2120 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2148,12 +2149,12 @@ done
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2152: checking for uid_t in sys/types.h" >&5
+echo "configure:2153: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2157 "configure"
+#line 2158 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2182,12 +2183,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2186: checking for size_t" >&5
+echo "configure:2187: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2191 "configure"
+#line 2192 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2215,12 +2216,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2219: checking for st_blksize in struct stat" >&5
+echo "configure:2220: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2224 "configure"
+#line 2225 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2228,7 +2229,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:2232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -2250,12 +2251,12 @@ fi
save_LIBOJBS="$LIBOBJS"
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:2254: checking for st_blocks in struct stat" >&5
+echo "configure:2255: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2259 "configure"
+#line 2260 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2263,7 +2264,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:2267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -2287,12 +2288,12 @@ fi
LIBOBJS="$save_LIBOBJS"
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:2291: checking for st_rdev in struct stat" >&5
+echo "configure:2292: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2296 "configure"
+#line 2297 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2300,7 +2301,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -2322,7 +2323,7 @@ fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2326: checking type of array argument to getgroups" >&5
+echo "configure:2327: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2330,7 +2331,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 2334 "configure"
+#line 2335 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -2355,7 +2356,7 @@ main()
}
EOF
-if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
@@ -2369,7 +2370,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 2373 "configure"
+#line 2374 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2393,12 +2394,12 @@ EOF
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2397: checking return type of signal handlers" >&5
+echo "configure:2398: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2402 "configure"
+#line 2403 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2415,7 +2416,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -2436,19 +2437,19 @@ EOF
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2440: checking for working alloca.h" >&5
+echo "configure:2441: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2445 "configure"
+#line 2446 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -2469,12 +2470,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2473: checking for alloca" >&5
+echo "configure:2474: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2478 "configure"
+#line 2479 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2502,7 +2503,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2534,12 +2535,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2538: checking whether alloca needs Cray hooks" >&5
+echo "configure:2539: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2543 "configure"
+#line 2544 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2564,12 +2565,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2568: checking for $ac_func" >&5
+echo "configure:2569: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2573 "configure"
+#line 2574 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2592,7 +2593,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2619,7 +2620,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2623: checking stack direction for C alloca" >&5
+echo "configure:2624: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2627,7 +2628,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2631 "configure"
+#line 2632 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2646,7 +2647,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2668,12 +2669,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2672: checking for pid_t" >&5
+echo "configure:2673: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2677 "configure"
+#line 2678 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2702,17 +2703,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2706: checking for vfork.h" >&5
+echo "configure:2707: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2711 "configure"
+#line 2712 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2737,18 +2738,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2741: checking for working vfork" >&5
+echo "configure:2742: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2747: checking for vfork" >&5
+echo "configure:2748: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2752 "configure"
+#line 2753 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2771,7 +2772,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2793,7 +2794,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
+#line 2798 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2888,7 +2889,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2911,7 +2912,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2915: checking for 8-bit clean memcmp" >&5
+echo "configure:2916: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2919,7 +2920,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2923 "configure"
+#line 2924 "configure"
#include "confdefs.h"
main()
@@ -2929,7 +2930,7 @@ main()
}
EOF
-if { (eval echo configure:2933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -2951,12 +2952,12 @@ for ac_func in dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
fnmatch isinf isnan finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2955: checking for $ac_func" >&5
+echo "configure:2956: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2960 "configure"
+#line 2961 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2979,7 +2980,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3012,12 +3013,12 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\
dlopen sigprocmask sigaction _setjmp setsid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3016: checking for $ac_func" >&5
+echo "configure:3017: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3021 "configure"
+#line 3022 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3040,7 +3041,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3065,12 +3066,12 @@ fi
done
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3069: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3070: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3074 "configure"
+#line 3075 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -3078,7 +3079,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -3099,12 +3100,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3103: checking for tm_zone in struct tm" >&5
+echo "configure:3104: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3108 "configure"
+#line 3109 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -3112,7 +3113,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:3116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -3132,12 +3133,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3136: checking for tzname" >&5
+echo "configure:3137: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3141 "configure"
+#line 3142 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -3147,7 +3148,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -3170,14 +3171,14 @@ fi
if test "$ac_cv_func_strftime" = no; then
cat > conftest.$ac_ext <<EOF
-#line 3174 "configure"
+#line 3175 "configure"
#include "confdefs.h"
int main() {
extern int daylight; int i = daylight;
; return 0; }
EOF
-if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_DAYLIGHT 1
@@ -3197,7 +3198,7 @@ EOF
else
echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6
-echo "configure:3201: checking for BSD signal semantics" >&5
+echo "configure:3202: checking for BSD signal semantics" >&5
if eval "test \"`echo '$''{'rb_cv_bsd_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3205,7 +3206,7 @@ else
rb_cv_bsd_signal=no
else
cat > conftest.$ac_ext <<EOF
-#line 3209 "configure"
+#line 3210 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3227,7 +3228,7 @@ main()
}
EOF
-if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_bsd_signal=yes
else
@@ -3251,7 +3252,7 @@ EOF
fi
echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3255: checking whether getpgrp takes no argument" >&5
+echo "configure:3256: checking whether getpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3259,7 +3260,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3263 "configure"
+#line 3264 "configure"
#include "confdefs.h"
/*
@@ -3314,7 +3315,7 @@ main()
}
EOF
-if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getpgrp_void=yes
else
@@ -3338,7 +3339,7 @@ EOF
fi
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3342: checking whether setpgrp takes no argument" >&5
+echo "configure:3343: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3346,7 +3347,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3350 "configure"
+#line 3351 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -3366,7 +3367,7 @@ main()
}
EOF
-if { (eval echo configure:3370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -3391,7 +3392,7 @@ fi
echo $ac_n "checking for working strtod""... $ac_c" 1>&6
-echo "configure:3395: checking for working strtod" >&5
+echo "configure:3396: checking for working strtod" >&5
if eval "test \"`echo '$''{'rb_cv_func_strtod'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3399,7 +3400,7 @@ else
rb_cv_func_strtod=no
else
cat > conftest.$ac_ext <<EOF
-#line 3403 "configure"
+#line 3404 "configure"
#include "confdefs.h"
double strtod ();
@@ -3429,7 +3430,7 @@ main()
}
EOF
-if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_func_strtod=yes
else
@@ -3447,14 +3448,14 @@ echo "$ac_t""$rb_cv_func_strtod" 1>&6
test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3451: checking whether byte ordering is bigendian" >&5
+echo "configure:3452: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3458 "configure"
+#line 3459 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3465,11 +3466,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 3473 "configure"
+#line 3474 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3480,7 +3481,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3500,7 +3501,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3504 "configure"
+#line 3505 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3513,7 +3514,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3537,12 +3538,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3541: checking for working const" >&5
+echo "configure:3542: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3546 "configure"
+#line 3547 "configure"
#include "confdefs.h"
int main() {
@@ -3591,7 +3592,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3612,14 +3613,14 @@ EOF
fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3616: checking whether char is unsigned" >&5
+echo "configure:3617: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
-#line 3623 "configure"
+#line 3624 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -3641,7 +3642,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3645 "configure"
+#line 3646 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -3651,7 +3652,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:3655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -3676,7 +3677,7 @@ fi
echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6
-echo "configure:3680: checking whether right shift preserve sign bit" >&5
+echo "configure:3681: checking whether right shift preserve sign bit" >&5
if eval "test \"`echo '$''{'rb_cv_rshift_sign'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3684,7 +3685,7 @@ else
rb_cv_rshift_sign=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3688 "configure"
+#line 3689 "configure"
#include "confdefs.h"
int
@@ -3696,7 +3697,7 @@ main()
}
EOF
-if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_rshift_sign=yes
else
@@ -3724,19 +3725,19 @@ EOF
fi
echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
-echo "configure:3728: checking count field in FILE structures" >&5
+echo "configure:3729: checking count field in FILE structures" >&5
if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3733 "configure"
+#line 3734 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_cnt"
else
@@ -3746,14 +3747,14 @@ fi
rm -f conftest*
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3750 "configure"
+#line 3751 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->__cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="__cnt"
else
@@ -3764,14 +3765,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3768 "configure"
+#line 3769 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0;
; return 0; }
EOF
-if { (eval echo configure:3775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_r"
else
@@ -3782,14 +3783,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3786 "configure"
+#line 3787 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0;
; return 0; }
EOF
-if { (eval echo configure:3793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="readCount"
else
@@ -3800,14 +3801,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3804 "configure"
+#line 3805 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_rcount = 0;
; return 0; }
EOF
-if { (eval echo configure:3811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_rcount"
else
@@ -3873,7 +3874,7 @@ fi
case "$host_os" in
linux*)
echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6
-echo "configure:3877: checking whether ELF binaries are produced" >&5
+echo "configure:3878: checking whether ELF binaries are produced" >&5
if eval "test \"`echo '$''{'rb_cv_binary_elf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3881,7 +3882,7 @@ else
rb_cv_binary_elf=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3885 "configure"
+#line 3886 "configure"
#include "confdefs.h"
/* Test for whether ELF binaries are produced */
@@ -3901,7 +3902,7 @@ main() {
}
EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_binary_elf=yes
else
@@ -3931,14 +3932,20 @@ STATIC=
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6
-echo "configure:3935: checking whether OS depend dynamic link works" >&5
+echo "configure:3936: checking whether OS depend dynamic link works" >&5
if test "$GCC" = yes; then
case "$host_os" in
nextstep*) ;;
openstep*) ;;
rhapsody*) ;;
human*) ;;
- cygwin*) CCDLFLAGS=-DDLLIMPORT;;
+ bsdi3*) ;;
+ cygwin*) ;;
+ netbsd*) CCDLFLAGS=-fpic
+ case "$host_cpu" in
+ mips*) CCDLFLAGS=-fPIC ;;
+ *) ;;
+ esac ;;
*) CCDLFLAGS=-fPIC;;
esac
else
@@ -3985,17 +3992,15 @@ echo "configure:3935: checking whether OS depend dynamic link works" >&5
test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable"
fi
rb_cv_dlopen=yes ;;
- netbsd*) LDSHARED="ld -Bshareable"
- case "$host_cpu" in
- alpha|mips)
- LDFLAGS="-export-dynamic" ;;
- *)
- ;;
- esac
+ netbsd*) LDSHARED="ld -shared"
rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
rb_cv_dlopen=yes ;;
- nextstep*) LDSHARED='cc -r'
+ bsdi3*) case "$CC" in
+ *shlicc*) LDSHARED="$CC -r"
+ rb_cv_dlopen=yes ;;
+ esac ;;
+ nextstep*) LDSHARED='cc -r -nostdlib'
LDFLAGS="-u libsys_s"
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
@@ -4029,7 +4034,7 @@ echo "configure:3935: checking whether OS depend dynamic link works" >&5
DLDFLAGS="ruby.def -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
esac
rb_cv_dlopen=yes ;;
- cygwin*) LDSHARED='../../miniruby ../cygwin32_ld.rb'
+ cygwin*) LDSHARED='dllwrap --export-all -s'
rb_cv_dlopen=yes ;;
*) LDSHARED='ld' ;;
esac
@@ -4041,12 +4046,12 @@ if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
cat confdefs.h > config.h
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
-echo "configure:4045: checking whether matz's dln works" >&5
+echo "configure:4050: checking whether matz's dln works" >&5
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4050 "configure"
+#line 4055 "configure"
#include "confdefs.h"
#define USE_DLN_A_OUT
@@ -4056,7 +4061,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_dln_a_out=yes
else
@@ -4085,9 +4090,9 @@ if test "$dln_a_out_works" = yes; then
else
STATIC=-Bstatic
fi
- DLEXT=o
+ DLEXT=so
cat >> confdefs.h <<\EOF
-#define DLEXT ".o"
+#define DLEXT ".so"
EOF
CCDLFLAGS=
@@ -4098,9 +4103,9 @@ else
#define DLEXT ".sl"
EOF
;;
- nextstep*) DLEXT=o
+ nextstep*) DLEXT=bundle
cat >> confdefs.h <<\EOF
-#define DLEXT ".o"
+#define DLEXT ".bundle"
EOF
;;
openstep*) DLEXT=bundle
@@ -4120,7 +4125,7 @@ EOF
;;
os2_emx) DLEXT=o
cat >> confdefs.h <<\EOF
-#define DLEXT ".o"
+#define DLEXT ".so"
EOF
;;
*) DLEXT=so
@@ -4163,7 +4168,7 @@ fi
case "$host_os" in
human*)
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
-echo "configure:4167: checking for _harderr in -lsignal" >&5
+echo "configure:4172: checking for _harderr in -lsignal" >&5
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4171,7 +4176,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsignal $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4175 "configure"
+#line 4180 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4182,7 +4187,7 @@ int main() {
_harderr()
; return 0; }
EOF
-if { (eval echo configure:4186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4210,7 +4215,7 @@ else
fi
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
-echo "configure:4214: checking for hmemset in -lhmem" >&5
+echo "configure:4219: checking for hmemset in -lhmem" >&5
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4218,7 +4223,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lhmem $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4222 "configure"
+#line 4227 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4229,7 +4234,7 @@ int main() {
hmemset()
; return 0; }
EOF
-if { (eval echo configure:4233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4259,12 +4264,12 @@ fi
for ac_func in select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4263: checking for $ac_func" >&5
+echo "configure:4268: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4273 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4287,7 +4292,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4312,7 +4317,7 @@ fi
done
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
-echo "configure:4316: checking whether PD libc _dtos18 fail to convert big number" >&5
+echo "configure:4321: checking whether PD libc _dtos18 fail to convert big number" >&5
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4320,7 +4325,7 @@ else
rb_cv_missing__dtos18=no
else
cat > conftest.$ac_ext <<EOF
-#line 4324 "configure"
+#line 4329 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4332,7 +4337,7 @@ main ()
}
EOF
-if { (eval echo configure:4336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing__dtos18=yes
else
@@ -4354,7 +4359,7 @@ EOF
fi
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
-echo "configure:4358: checking whether PD libc fconvert fail to round" >&5
+echo "configure:4363: checking whether PD libc fconvert fail to round" >&5
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4362,7 +4367,7 @@ else
rb_cv_missing_fconvert=no
else
cat > conftest.$ac_ext <<EOF
-#line 4366 "configure"
+#line 4371 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4375,7 +4380,7 @@ main ()
}
EOF
-if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing_fconvert=yes
else
@@ -4453,6 +4458,7 @@ if test "$host_os" = "beos"; then
esac
fi
+FIRSTMAKEFILE=""
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
@@ -4478,6 +4484,14 @@ if test "$enable_shared" = 'yes'; then
LIBRUBY_ALIASES=''
fi
;;
+ netbsd*)
+ LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
+ case "$host_cpu" in
+ alpha|mipsel|mipseb|powerpc|sparc64) # ELF platforms
+ LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' ;;
+ *) LIBRUBY_ALIASES= ;; # a.out platforms
+ esac
+ ;;
hpux*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl'
@@ -4493,6 +4507,15 @@ if test "$enable_shared" = 'yes'; then
LIBRUBYARG='-L./ -Wl,lib$(RUBY_INSTALL_NAME).so'
SOLIBS='-lm -lc'
;;
+ cygwin*)
+ LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).a'
+ LIBRUBY_ALIASES=''
+ LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
+ LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)'
+ FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
+ LIBOBJS="$LIBOBJS strftime.o"
+ CCDLFLAGS=-DUSEIMPORTLIB
+ ;;
*)
;;
esac
@@ -4692,7 +4715,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile ext/extmk.rb" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$FIRSTMAKEFILE Makefile ext/extmk.rb" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -4807,7 +4830,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile ext/extmk.rb"}
+CONFIG_FILES=\${CONFIG_FILES-"$FIRSTMAKEFILE Makefile ext/extmk.rb"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/configure.in b/configure.in
index c298f49d72..e27708beb1 100644
--- a/configure.in
+++ b/configure.in
@@ -148,6 +148,7 @@ openstep*) ;;
rhapsody*) ;;
human*) ;;
beos*) ;;
+cygwin*) ;;
*) LIBS="-lm $LIBS";;
esac
AC_CHECK_LIB(crypt, crypt)
@@ -379,7 +380,13 @@ if test "$with_dln_a_out" != yes; then
openstep*) ;;
rhapsody*) ;;
human*) ;;
- cygwin*) CCDLFLAGS=-DDLLIMPORT;;
+ bsdi3*) ;;
+ cygwin*) ;;
+ netbsd*) CCDLFLAGS=-fpic
+ case "$host_cpu" in
+ mips*) CCDLFLAGS=-fPIC ;;
+ *) ;;
+ esac ;;
*) CCDLFLAGS=-fPIC;;
esac
else
@@ -426,17 +433,15 @@ if test "$with_dln_a_out" != yes; then
test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable"
fi
rb_cv_dlopen=yes ;;
- netbsd*) LDSHARED="ld -Bshareable"
- case "$host_cpu" in
- alpha|mips)
- LDFLAGS="-export-dynamic" ;;
- *)
- ;;
- esac
+ netbsd*) LDSHARED="ld -shared"
rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
rb_cv_dlopen=yes ;;
- nextstep*) LDSHARED='cc -r'
+ bsdi3*) case "$CC" in
+ *shlicc*) LDSHARED="$CC -r"
+ rb_cv_dlopen=yes ;;
+ esac ;;
+ nextstep*) LDSHARED='cc -r -nostdlib'
LDFLAGS="-u libsys_s"
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
@@ -470,7 +475,7 @@ if test "$with_dln_a_out" != yes; then
DLDFLAGS="ruby.def -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
esac
rb_cv_dlopen=yes ;;
- cygwin*) LDSHARED='../../miniruby ../cygwin32_ld.rb'
+ cygwin*) LDSHARED='dllwrap --export-all -s'
rb_cv_dlopen=yes ;;
*) LDSHARED='ld' ;;
esac
@@ -502,15 +507,15 @@ if test "$dln_a_out_works" = yes; then
else
STATIC=-Bstatic
fi
- DLEXT=o
- AC_DEFINE(DLEXT, ".o")
+ DLEXT=so
+ AC_DEFINE(DLEXT, ".so")
CCDLFLAGS=
else
case "$host_os" in
hpux*) DLEXT=sl
AC_DEFINE(DLEXT, ".sl");;
- nextstep*) DLEXT=o
- AC_DEFINE(DLEXT, ".o");;
+ nextstep*) DLEXT=bundle
+ AC_DEFINE(DLEXT, ".bundle");;
openstep*) DLEXT=bundle
AC_DEFINE(DLEXT, ".bundle");;
rhapsody*) DLEXT=bundle
@@ -518,7 +523,7 @@ else
cygwin*) DLEXT=dll
AC_DEFINE(DLEXT, ".dll");;
os2_emx) DLEXT=o
- AC_DEFINE(DLEXT, ".o");;
+ AC_DEFINE(DLEXT, ".so");;
*) DLEXT=so
AC_DEFINE(DLEXT, ".so");;
esac
@@ -652,6 +657,7 @@ if test "$host_os" = "beos"; then
esac
fi
+FIRSTMAKEFILE=""
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
@@ -674,6 +680,14 @@ if test "$enable_shared" = 'yes'; then
LIBRUBY_ALIASES=''
fi
;;
+ netbsd*)
+ LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
+ case "$host_cpu" in
+ alpha|mipsel|mipseb|powerpc|sparc64) # ELF platforms
+ LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' ;;
+ *) LIBRUBY_ALIASES= ;; # a.out platforms
+ esac
+ ;;
hpux*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl'
@@ -689,6 +703,15 @@ if test "$enable_shared" = 'yes'; then
LIBRUBYARG='-L./ -Wl,lib$(RUBY_INSTALL_NAME).so'
SOLIBS='-lm -lc'
;;
+ cygwin*)
+ LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).a'
+ LIBRUBY_ALIASES=''
+ LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
+ LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)'
+ FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
+ LIBOBJS="$LIBOBJS strftime.o"
+ CCDLFLAGS=-DUSEIMPORTLIB
+ ;;
*)
;;
esac
@@ -755,4 +778,4 @@ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH}/${arch}")
echo "creating config.h"
cat confdefs.h > config.h
-AC_OUTPUT(Makefile ext/extmk.rb)
+AC_OUTPUT($FIRSTMAKEFILE Makefile ext/extmk.rb)
diff --git a/dln.c b/dln.c
index bee8a07447..ee8ca5de90 100644
--- a/dln.c
+++ b/dln.c
@@ -1158,35 +1158,6 @@ dln_strerror()
#if defined(_AIX)
-static void *
-aix_findmain()
-{
- struct ld_info *lp;
- char *buf;
- int size = 4 * 1024;
- int rc;
- void *ret;
-
- if ((buf = xmalloc(size)) == NULL) {
- return NULL;
- }
- while ((rc = loadquery(L_GETINFO, buf, size)) == -1 && errno == ENOMEM) {
- free(buf);
- size += 4 * 1024;
- if ((buf = xmalloc(size)) == NULL) {
- return NULL;
- }
- }
- if (rc == -1) {
- free(buf);
- return NULL;
- }
- lp = (struct ld_info *)buf;
- ret = lp->ldinfo_dataorg;
- free(buf);
- return ret;
-}
-
static void
aix_loaderror(const char *pathname)
{
@@ -1342,19 +1313,13 @@ dln_load(file)
#if defined(_AIX)
#define DLN_DEFINED
{
- static void *main_module = NULL;
void (*init_fct)();
- if (main_module == NULL) {
- if ((main_module = aix_findmain()) == NULL) {
- aix_loaderror(file);
- }
- }
init_fct = (void(*)())load((char*)file, 1, 0);
if (init_fct == NULL) {
aix_loaderror(file);
}
- if (loadbind(0, main_module, (void*)init_fct) == -1) {
+ if (loadbind(0, (void*)dln_load, (void*)init_fct) == -1) {
aix_loaderror(file);
}
(*init_fct)();
@@ -1372,7 +1337,7 @@ dln_load(file)
Mi hisho@tasihara.nest.or.jp,
and... Miss ARAI Akino(^^;)
----------------------------------------------------*/
-#if defined(NeXT) && ( NS_TARGET_MAJOR < 4 )/* NeXTSTEP rld functions */
+#if defined(NeXT) && (NS_TARGET_MAJOR < 4)/* NeXTSTEP rld functions */
{
unsigned long init_address;
@@ -1409,7 +1374,7 @@ dln_load(file)
void (*init_fct)();
- dyld_result = NSCreateObjectFileImageFromFile( file, &obj_file );
+ dyld_result = NSCreateObjectFileImageFromFile(file, &obj_file);
if (dyld_result != NSObjectFileImageSuccess) {
rb_loaderror("Failed to load %.200s", file);
@@ -1419,12 +1384,12 @@ dln_load(file)
/* lookup the initial function */
/*NSIsSymbolNameDefined require function name without "_" */
- if( NSIsSymbolNameDefined( buf + 1 ) ) {
+ if(NSIsSymbolNameDefined(buf + 1)) {
rb_loaderror("Failed to lookup Init function %.200s",file);
}
/* NSLookupAndBindSymbol require function name with "_" !! */
- init_fct = NSAddressOfSymbol( NSLookupAndBindSymbol( buf ) );
+ init_fct = NSAddressOfSymbol(NSLookupAndBindSymbol(buf));
(*init_fct)();
return ;
@@ -1499,8 +1464,8 @@ dln_load(file)
c2pstr(fullpath);
(void)FSMakeFSSpec(0, 0, fullpath, &libspec);
err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething);
- if ( err ) {
- rb_loaderror("Unresolved Alias - %s", file);
+ if (err) {
+ rb_loaderror("Unresolved Alias - %s", file);
}
/* Load the fragment (or return the connID if it is already loaded */
@@ -1508,16 +1473,16 @@ dln_load(file)
err = GetDiskFragment(&libspec, 0, 0, fragname,
kLoadCFrag, &connID, &mainAddr,
errMessage);
- if ( err ) {
- p2cstr(errMessage);
- rb_loaderror("%s - %s",errMessage , file);
+ if (err) {
+ p2cstr(errMessage);
+ rb_loaderror("%s - %s",errMessage , file);
}
/* Locate the address of the correct init function */
c2pstr(buf);
err = FindSymbol(connID, buf, &symAddr, &class);
- if ( err ) {
- rb_loaderror("Unresolved symbols - %s" , file);
+ if (err) {
+ rb_loaderror("Unresolved symbols - %s" , file);
}
init_fct = (void (*)())symAddr;
diff --git a/eval.c b/eval.c
index 79c181e7d2..f0c45f95c4 100644
--- a/eval.c
+++ b/eval.c
@@ -648,23 +648,23 @@ static VALUE ruby_wrapper; /* security wrapper */
scope_vmode = SCOPE_PUBLIC;
#define SCOPE_DONT_RECYCLE FL_USER2
-#define POP_SCOPE() \
+#define POP_SCOPE() \
if (FL_TEST(ruby_scope, SCOPE_DONT_RECYCLE)) {\
FL_SET(_old, SCOPE_DONT_RECYCLE);\
- }\
- else {\
+ } \
+ else { \
if (ruby_scope->flag == SCOPE_ALLOCA) {\
- ruby_scope->local_vars = 0;\
- ruby_scope->local_tbl = 0;\
+ ruby_scope->local_vars = 0; \
+ ruby_scope->local_tbl = 0; \
if (ruby_scope != top_scope)\
rb_gc_force_recycle((VALUE)ruby_scope);\
- }\
- else {\
+ } \
+ else { \
ruby_scope->flag |= SCOPE_NOSTACK;\
- }\
- }\
- ruby_scope = _old;\
- scope_vmode = _vmode;\
+ } \
+ } \
+ ruby_scope = _old; \
+ scope_vmode = _vmode; \
}
static VALUE rb_eval _((VALUE,NODE*));
@@ -2871,6 +2871,7 @@ module_setup(module, node)
PUSH_CLASS();
ruby_class = module;
PUSH_SCOPE();
+ PUSH_VARS();
if (node->nd_rval) ruby_frame->cbase = node->nd_rval;
if (node->nd_tbl) {
@@ -2894,6 +2895,7 @@ module_setup(module, node)
result = rb_eval(ruby_class, node->nd_next);
}
POP_TAG();
+ POP_VARS();
POP_SCOPE();
POP_CLASS();
@@ -4650,7 +4652,7 @@ rb_provided(feature)
}
static int rb_thread_loading _((const char*));
-static void rb_thread_loading_done _((void));
+static void rb_thread_loading_done _((const char*));
void
rb_provide(feature)
@@ -4677,6 +4679,7 @@ rb_f_require(obj, fname)
{
char *ext, *file, *feature, *buf; /* OK */
volatile VALUE load;
+ int state;
rb_secure(4);
Check_SafeStr(fname);
@@ -4729,34 +4732,32 @@ rb_f_require(obj, fname)
load_dyna:
if (rb_thread_loading(feature)) return Qfalse;
- else {
- int state;
- PUSH_TAG(PROT_NONE);
- if ((state = EXEC_TAG()) == 0) {
- load = rb_str_new2(file);
- file = RSTRING(load)->ptr;
- dln_load(file);
- rb_provide(feature);
- }
- POP_TAG();
- rb_thread_loading_done();
- if (state) JUMP_TAG(state);
+
+ rb_provide(feature);
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ load = rb_str_new2(file);
+ file = RSTRING(load)->ptr;
+ dln_load(file);
}
+ POP_TAG();
+ rb_thread_loading_done(feature);
+ if (state) JUMP_TAG(state);
+
return Qtrue;
load_rb:
if (rb_thread_loading(feature)) return Qfalse;
- else {
- int state;
- PUSH_TAG(PROT_NONE);
- if ((state = EXEC_TAG()) == 0) {
- rb_load(fname, 0);
- rb_provide(feature);
- }
- POP_TAG();
- rb_thread_loading_done();
- if (state) JUMP_TAG(state);
+ rb_provide(feature);
+
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ rb_load(fname, 0);
}
+ POP_TAG();
+ rb_thread_loading_done(feature);
+ if (state) JUMP_TAG(state);
+
return Qtrue;
}
@@ -5306,7 +5307,8 @@ bind_clone(self)
VALUE bind;
Data_Get_Struct(self, struct BLOCK, orig);
- bind = Data_Make_Struct(self,struct BLOCK,blk_mark,blk_free,data);
+ bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data);
+ CLONESETUP(bind,self);
MEMCPY(data, orig, struct BLOCK, 1);
data->frame.argv = ALLOC_N(VALUE, orig->frame.argc);
MEMCPY(data->frame.argv, orig->frame.argv, VALUE, orig->frame.argc);
@@ -6616,7 +6618,7 @@ rb_thread_main()
return main_thread->thread;
}
-static VALUE
+VALUE
rb_thread_wakeup(thread)
VALUE thread;
{
@@ -6629,7 +6631,7 @@ rb_thread_wakeup(thread)
return thread;
}
-static VALUE
+VALUE
rb_thread_run(thread)
VALUE thread;
{
@@ -6675,7 +6677,7 @@ rb_thread_pass()
return Qnil;
}
-static VALUE
+VALUE
rb_thread_stop()
{
rb_thread_critical = 0;
@@ -7125,32 +7127,29 @@ rb_thread_raise(argc, argv, thread)
return Qnil; /* not reached */
}
-static thread_t loading_thread;
-static int loading_nest;
+static st_table *loading_tbl;
static int
rb_thread_loading(feature)
const char *feature;
{
- if (curr_thread != curr_thread->next && loading_thread) {
- while (loading_thread != curr_thread) {
- rb_thread_schedule();
- CHECK_INTS;
- }
- if (rb_provided(feature)) return Qtrue; /* no need to load */
+ if (!rb_provided(feature)) return Qfalse; /* need to load */
+ if (!loading_tbl) {
+ loading_tbl = st_init_strtable();
}
-
- loading_thread = curr_thread;
- loading_nest++;
-
- return Qfalse;
+ while (st_lookup(loading_tbl, feature, 0)) {
+ CHECK_INTS;
+ rb_thread_schedule();
+ }
+ return Qtrue;
}
static void
-rb_thread_loading_done()
+rb_thread_loading_done(feature)
+ const char *feature;
{
- if (--loading_nest == 0) {
- loading_thread = 0;
+ if (loading_tbl) {
+ st_delete(loading_tbl, feature, 0);
}
}
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index c564b59b70..8090c2ab19 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -324,6 +324,19 @@ def create_makefile(target)
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
end
+ defflag = ''
+ if PLATFORM =~ /cygwin/ and not $static
+ if File.exist? target + ".def"
+ defflag = "--def=" + target + ".def"
+ end
+ if $libs
+ $libs = $libs + " @LIBRUBYARG@"
+ else
+ $libs = "@LIBRUBYARG@"
+ end
+ $DLDFLAGS = $DLDFLAGS + " -L" + $topdir
+ end
+
$srcdir = $top_srcdir + "/ext/" + $mdir
mfile = open("Makefile", "w")
mfile.printf "\
@@ -342,7 +355,7 @@ CC = @CC@
prefix = @prefix@
CFLAGS = %s -I#{$topdir} -I#{$top_srcdir} -I@includedir@ #{CFLAGS} #$CFLAGS %s
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
-LDSHARED = @LDSHARED@
+LDSHARED = @LDSHARED@ #{defflag}
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
mfile.printf "\
@@ -367,7 +380,7 @@ archdir = $(pkglibdir)/@arch@
$objs = []
for f in Dir["#{$top_srcdir}/ext/#{$mdir}/*.{#{SRC_EXT.join(%q{,})}}"]
f = File.basename(f)
- f.sub!(/\.(c|cc)$/, ".o")
+ f.sub!(/(#{SRC_EXT.join(%q{|})})$/, "o")
$objs.push f
end
end
@@ -418,23 +431,21 @@ $(DLLIB): $(OBJS)
$(DLLIB): $(OBJS)
$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
"
- elsif not SRC_EXT.detect{|ext| File.exist?(target + ext)}
- if PLATFORM == "m68k-human"
- mfile.printf "\
+ elsif PLATFORM == "m68k-human"
+ mfile.printf "\
$(DLLIB): $(OBJS)
ar cru $(DLLIB) $(OBJS)
"
- elsif PLATFORM =~ "-nextstep" || PLATFORM =~ "-openstep" || PLATFORM =~ "-rhapsody"
- mfile.printf "\
+ elsif PLATFORM =~ "-nextstep" || PLATFORM =~ "-openstep" || PLATFORM =~ "-rhapsody"
+ mfile.printf "\
$(DLLIB): $(OBJS)
cc -r $(CFLAGS) -o $(DLLIB) $(OBJS)
"
- else
- mfile.printf "\
+ else
+ mfile.printf "\
$(DLLIB): $(OBJS)
ld $(DLDFLAGS) -r -o $(DLLIB) $(OBJS)
"
- end
end
if File.exist?("depend")
diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c
index e95e135812..e63258f3f1 100644
--- a/ext/md5/md5init.c
+++ b/ext/md5/md5init.c
@@ -29,8 +29,9 @@ md5_update(obj, str)
Data_Get_Struct(obj, MD5_CTX, md5);
MD5Update(md5, str->ptr, str->len);
- return Qnil;
+ return obj;
}
+
static VALUE
md5_digest(obj)
VALUE obj;
@@ -46,6 +47,26 @@ md5_digest(obj)
}
static VALUE
+md5_hexdigest(obj)
+ VALUE obj;
+{
+ MD5_CTX *md5, ctx;
+ unsigned char digest[16];
+ char buf[35];
+ char *p = buf;
+ int i;
+
+ Data_Get_Struct(obj, MD5_CTX, md5);
+ ctx = *md5;
+ MD5Final(digest, &ctx);
+
+ for (i=0; i<16; i++) {
+ sprintf(buf+i*2, "%x", digest[i]);
+ }
+ return rb_str_new(buf, 32);
+}
+
+static VALUE
md5_clone(obj)
VALUE obj;
{
@@ -90,5 +111,6 @@ Init_md5()
rb_define_method(cMD5, "update", md5_update, 1);
rb_define_method(cMD5, "digest", md5_digest, 0);
+ rb_define_method(cMD5, "hexdigest", md5_hexdigest, 0);
rb_define_method(cMD5, "clone", md5_clone, 0);
}
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 0d3ba7f060..6462c3c7ca 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -19,6 +19,10 @@
#include <sys/stropts.h>
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#define DEVICELEN 16
#if !defined(HAVE_OPENPTY)
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 0bd11bb946..f532f8a21d 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -16,6 +16,7 @@ if readline_dir
$LDFLAGS = "-L#{readline_dir}"
end
+have_library("user32", nil) if /cygwin/ === PLATFORM
have_library("termcap", "tgetnum")
have_library("curses", "tgetnum")
if have_header("readline/readline.h") and
diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
index 724f800c79..74fae207b9 100644
--- a/ext/socket/addrinfo.h
+++ b/ext/socket/addrinfo.h
@@ -27,6 +27,8 @@
* SUCH DAMAGE.
*/
+#ifndef ADDR_INFO_H
+#define ADDR_INFO_H
#ifndef HAVE_GETADDRINFO
/* special compatibility hack */
@@ -167,3 +169,4 @@ Standard C system should have one. */
#endif
#endif
+#endif
diff --git a/ext/socket/depend b/ext/socket/depend
index 09e851498e..df2f0c5d16 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,3 +1,3 @@
socket.o : socket.c $(hdrdir)/ruby.h $(hdrdir)/config.h $(hdrdir)/defines.h $(hdrdir)/rubyio.h $(hdrdir)/rubysig.h sockport.h
-getaddrinfo.o: getaddrinfo.c addrinfo.h sockport.h
-getnameinfo.o: getnameinfo.c addrinfo.h sockport.h
+getnameinfo.o: getnameinfo.c $(hdrdir)/config.h addrinfo.h sockport.h
+getaddrinfo.o: getaddrinfo.c $(hdrdir)/config.h addrinfo.h sockport.h
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 37d8de5cbb..1e41c02261 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -6,8 +6,11 @@ case PLATFORM
when /mswin32/
test_func = "WSACleanup"
have_library("wsock32", "WSACleanup")
-when /cygwin32/
+when /cygwin/
+ $LDFLAGS << " -L/usr/lib" if File.directory?("/usr/lib")
+ $CFLAGS << " -I/usr/include"
test_func = "socket"
+ have_library("bind", "gethostbyaddr")
when /beos/
test_func = "socket"
have_library("net", "socket")
@@ -252,8 +255,8 @@ if have_getaddrinfo
$CFLAGS="-DHAVE_GETADDRINFO "+$CFLAGS
else
$CFLAGS="-I. "+$CFLAGS
- $objs += "getaddrinfo.o"
- $objs += "getnameinfo.o"
+ $objs += ["getaddrinfo.o"]
+ $objs += ["getnameinfo.o"]
have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton")
end
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index f4da5bbf7a..5af329225c 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -61,6 +61,12 @@
#define YES 1
#define NO 0
+struct sockinet {
+ u_char si_len;
+ u_char si_family;
+ u_short si_port;
+};
+
static struct afd {
int a_af;
int a_addrlen;
@@ -68,18 +74,18 @@ static struct afd {
int a_off;
} afdl [] = {
#ifdef INET6
- {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
- offsetof(struct sockaddr_in6, sin6_addr)},
+#define N_INET6 0
+ {PF_INET6, sizeof(struct in6_addr),
+ sizeof(struct sockaddr_in6),
+ offsetof(struct sockaddr_in6, sin6_addr)},
+#define N_INET 1
+#else
+#define N_INET 0
#endif
- {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in),
- offsetof(struct sockaddr_in, sin_addr)},
- {0, 0, 0},
-};
-
-struct sockinet {
- u_char si_len;
- u_char si_family;
- u_short si_port;
+ {PF_INET, sizeof(struct in_addr),
+ sizeof(struct sockaddr_in),
+ offsetof(struct sockaddr_in, sin_addr)},
+ {0, 0, 0, 0},
};
#define ENI_NOSOCKET 0
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index dda7eb06fc..0912ca9dd1 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -583,6 +583,21 @@ thread_write_select(fd)
}
static int
+ruby_socket(domain, type, proto)
+ int domain, type, proto;
+{
+ int fd;
+
+ fd = socket(domain, type, proto);
+ if (fd < 0) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ fd = socket(domain, type, proto);
+ }
+ }
+}
+
+static int
ruby_connect(fd, sockaddr, len, socks)
int fd;
struct sockaddr *sockaddr;
@@ -683,11 +698,12 @@ open_inet(class, h, serv, type)
fd = -1;
for (res = res0; res; res = res->ai_next) {
- status = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ status = ruby_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
syscall = "socket(2)";
fd = status;
- if (fd < 0)
+ if (fd < 0) {
continue;
+ }
if (type == INET_SERVER) {
status = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
@@ -939,8 +955,10 @@ open_unix(class, path, server)
OpenFile *fptr;
Check_SafeStr(path);
- fd = socket(AF_UNIX, SOCK_STREAM, 0);
- if (fd < 0) rb_sys_fail("socket(2)");
+ fd = ruby_socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0) {
+ rb_sys_fail("socket(2)");
+ }
MEMZERO(&sockaddr, struct sockaddr_un, 1);
sockaddr.sun_family = AF_UNIX;
@@ -1017,11 +1035,17 @@ udp_s_open(argc, argv, class)
{
VALUE arg;
int socktype = AF_INET;
+ int fd;
if (rb_scan_args(argc, argv, "01", &arg) == 1) {
socktype = NUM2INT(arg);
}
- return sock_new(class, socket(socktype, SOCK_DGRAM, 0));
+ fd = ruby_socket(socktype, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ rb_sys_fail("socket(2) - udp");
+ }
+
+ return sock_new(class, fd);
}
static VALUE
@@ -1312,7 +1336,7 @@ sock_s_open(class, domain, type, protocol)
int d, t;
setup_domain_and_type(domain, &d, type, &t);
- fd = socket(d, t, NUM2INT(protocol));
+ fd = ruby_socket(d, t, NUM2INT(protocol));
if (fd < 0) rb_sys_fail("socket(2)");
return sock_new(class, fd);
@@ -1333,8 +1357,14 @@ sock_s_socketpair(class, domain, type, protocol)
int d, t, sp[2];
setup_domain_and_type(domain, &d, type, &t);
- if (socketpair(d, t, NUM2INT(protocol), sp) < 0)
+ again:
+ if (socketpair(d, t, NUM2INT(protocol), sp) < 0) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ goto again;
+ }
rb_sys_fail("socketpair(2)");
+ }
return rb_assoc_new(sock_new(class, sp[0]), sock_new(class, sp[1]));
#else
@@ -1920,6 +1950,8 @@ Init_socket()
#endif
#ifdef AF_INET6
sock_define_const("AF_INET6", AF_INET6);
+#endif
+#ifdef PF_INET6
sock_define_const("PF_INET6", PF_INET6);
#endif
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index 3a2007362f..99bec91a1a 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -1,6 +1,6 @@
/************************************************
- sockcomm.h -
+ sockport.h -
$Author$
$Date$
@@ -8,8 +8,8 @@
************************************************/
-#ifndef SOCKCOMM_H
-#define SOCKCOMM_H
+#ifndef SOCKPORT_H
+#define SOCKPORT_H
#ifndef SA_LEN
# ifdef HAVE_SA_LEN
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 5f6f9a0c02..6652b9409a 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -30,6 +30,8 @@ fprintf(stderr, ARG1, ARG2); fprintf(stderr, "\n"); }
static VALUE eTkCallbackBreak;
static VALUE eTkCallbackContinue;
+static VALUE ip_invoke_real _((int, VALUE*, VALUE));
+
/* from tkAppInit.c */
/*
@@ -42,55 +44,47 @@ int *tclDummyMathPtr = (int *) matherr;
/*---- module TclTkLib ----*/
-/* Tk_ThreadTimer */
-typedef struct {
- Tcl_TimerToken token;
- int flag;
-} Tk_TimerData;
-
-/* timer callback */
-static void
-_timer_for_tcl(clientData)
- ClientData clientData;
-{
- Tk_TimerData *timer = (Tk_TimerData*)clientData;
+static VALUE main_thread;
- timer->flag = 0;
- CHECK_INTS;
+struct invoke_queue {
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+ int done;
+ VALUE result;
+ VALUE thread;
+ struct invoke_queue *next;
+};
- if (timer->flag) {
- Tk_DeleteTimerHandler(timer->token);
- }
- timer->token = Tk_CreateTimerHandler(200, _timer_for_tcl,
- (ClientData)timer);
- timer->flag = 1;
-}
+static struct invoke_queue *iqueue;
/* execute Tk_MainLoop */
static VALUE
lib_mainloop(self)
VALUE self;
{
- Tk_TimerData *timer;
-
- timer = (Tk_TimerData *)ALLOC(Tk_TimerData);
- timer->flag = 0;
- timer->token = Tk_CreateTimerHandler(200, _timer_for_tcl,
- (ClientData)timer);
- timer->flag = 1;
+ struct invoke_queue *q, *tmp;
+ VALUE thread;
DUMP1("start Tk_Mainloop");
while (Tk_GetNumMainWindows() > 0) {
- Tcl_DoOneEvent(0);
+ Tcl_DoOneEvent(TCL_DONT_WAIT);
CHECK_INTS;
+ q = iqueue;
+ while (q) {
+ tmp = q;
+ q = q->next;
+ if (!tmp->done) {
+ tmp->done = 1;
+ tmp->result = ip_invoke_real(tmp->argc, tmp->argv, tmp->obj);
+ thread = tmp->thread;
+ tmp = tmp->next;
+ rb_thread_run(thread);
+ }
+ }
}
DUMP1("stop Tk_Mainloop");
- if (timer->flag) {
- Tk_DeleteTimerHandler(timer->token);
- }
- free(timer);
-
return Qnil;
}
@@ -206,11 +200,11 @@ ip_new(self)
/* from Tcl_AppInit() */
DUMP1("Tcl_Init");
if (Tcl_Init(ptr->ip) == TCL_ERROR) {
- rb_raise(rb_eRuntimeError, "Tcl_Init");
+ rb_raise(rb_eRuntimeError, "%s", ptr->ip->result);
}
DUMP1("Tk_Init");
if (Tk_Init(ptr->ip) == TCL_ERROR) {
- rb_raise(rb_eRuntimeError, "Tk_Init");
+ rb_raise(rb_eRuntimeError, "%s", ptr->ip->result);
}
DUMP1("Tcl_StaticPackage(\"Tk\")");
Tcl_StaticPackage(ptr->ip, "Tk", Tk_Init,
@@ -324,14 +318,13 @@ ip_fromUTF8(self, str, encodename)
static VALUE
-ip_invoke(argc, argv, obj)
+ip_invoke_real(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
struct tcltkip *ptr; /* tcltkip data struct */
int i;
- int object = 0;
Tcl_CmdInfo info;
char *cmd;
char **av = (char **)NULL;
@@ -350,13 +343,10 @@ ip_invoke(argc, argv, obj)
if (!Tcl_GetCommandInfo(ptr->ip, cmd, &info)) {
rb_raise(rb_eNameError, "invalid command name `%s'", cmd);
}
-#if TCL_MAJOR_VERSION >= 8
- object = info.isNativeObjectProc;
-#endif
/* memory allocation for arguments of this command */
- if (object) {
#if TCL_MAJOR_VERSION >= 8
+ if (info.isNativeObjectProc) {
/* object interface */
ov = (Tcl_Obj **)ALLOCA_N(Tcl_Obj *, argc+1);
for (i = 0; i < argc; ++i) {
@@ -365,8 +355,10 @@ ip_invoke(argc, argv, obj)
Tcl_IncrRefCount(ov[i]);
}
ov[argc] = (Tcl_Obj *)NULL;
+ }
+ else
#endif
- } else {
+ {
/* string interface */
av = (char **)ALLOCA_N(char *, argc+1);
for (i = 0; i < argc; ++i) {
@@ -381,8 +373,8 @@ ip_invoke(argc, argv, obj)
Tcl_ResetResult(ptr->ip);
/* Invoke the C procedure */
- if (object) {
#if TCL_MAJOR_VERSION >= 8
+ if (info.isNativeObjectProc) {
int dummy;
ptr->return_value = (*info.objProc)(info.objClientData,
ptr->ip, argc, ov);
@@ -395,9 +387,10 @@ ip_invoke(argc, argv, obj)
for (i=0; i<argc; i++) {
Tcl_DecrRefCount(ov[i]);
}
-#endif
}
- else {
+ else
+#endif
+ {
ptr->return_value = (*info.proc)(info.clientData,
ptr->ip, argc, av);
}
@@ -410,6 +403,51 @@ ip_invoke(argc, argv, obj)
return rb_str_new2(ptr->ip->result);
}
+static VALUE
+ip_invoke(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ struct invoke_queue *tmp, *p;
+ VALUE result = rb_thread_current();
+
+ if (result == main_thread) {
+ return ip_invoke_real(argc, argv, obj);
+ }
+ tmp = ALLOC(struct invoke_queue);
+ tmp->obj = obj;
+ tmp->argc = argc;
+ tmp->argv = ALLOC_N(VALUE, argc);
+ MEMCPY(tmp->argv, argv, VALUE, argc);
+ tmp->thread = result;
+ tmp->done = 0;
+
+ tmp->next = iqueue;
+ iqueue = tmp;
+
+ rb_thread_stop();
+ result = tmp->result;
+ if (iqueue == tmp) {
+ iqueue = tmp->next;
+ free(tmp->argv);
+ free(tmp);
+ return result;
+ }
+
+ p = iqueue;
+ while (p->next) {
+ if (p->next == tmp) {
+ p->next = tmp->next;
+ free(tmp->argv);
+ free(tmp);
+ break;
+ }
+ p = p->next;
+ }
+ return result;
+}
+
/* get return code from Tcl_Eval() */
static VALUE
ip_retval(self)
@@ -454,6 +492,7 @@ Init_tcltklib()
rb_define_method(ip, "_return_value", ip_retval, 0);
rb_define_method(ip, "mainloop", lib_mainloop, 0);
+ main_thread = rb_thread_current();
#ifdef __MACOS__
_macinit();
#endif
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
index 3dde30d60d..3d8e4fa405 100644
--- a/ext/tk/lib/tktext.rb
+++ b/ext/tk/lib/tktext.rb
@@ -285,8 +285,8 @@ class TkText<TkTextWin
end
else
- if ( key == 'font' || key == 'kanjifont' \
- || key == 'latinfont' || key == 'asciifont' )
+ if key == 'font' || key == 'kanjifont' ||
+ key == 'latinfont' || key == 'asciifont'
tagfont_configure({key=>val})
else
tk_send 'tag', 'configure', tag, "-#{key}", val
@@ -320,7 +320,7 @@ class TkText<TkTextWin
end
def tag_ranges(tag)
- l = tk_split_list(tk_send('tag', 'ranges', tag))
+ l = tk_split_simplelist(tk_send('tag', 'ranges', tag))
r = []
while key=l.shift
r.push [key, l.shift]
@@ -329,11 +329,11 @@ class TkText<TkTextWin
end
def tag_nextrange(tag, first, last=None)
- tk_split_list(tk_send('tag', 'nextrange', tag, first, last))
+ tk_split_simplelist(tk_send('tag', 'nextrange', tag, first, last))
end
def tag_prevrange(tag, first, last=None)
- tk_split_list(tk_send('tag', 'prevrange', tag, first, last))
+ tk_split_simplelist(tk_send('tag', 'prevrange', tag, first, last))
end
def search_with_length(pat,start,stop=None)
@@ -437,9 +437,19 @@ class TkTextTag<TkObject
@path = @id = $tk_text_tag
$tk_text_tag = $tk_text_tag.succ
#tk_call @t.path, "tag", "configure", @id, *hash_kv(keys)
- configure(keys) if keys
+ if args != [] then
+ keys = args.pop
+ if keys.kind_of? Hash then
+ add(*args) if args != []
+ configure(keys)
+ else
+ args.push keys
+ add(*args)
+ end
+ end
@t._addtag id, self
end
+
def id
return @id
end
@@ -470,11 +480,11 @@ class TkTextTag<TkObject
end
def nextrange(first, last=None)
- tk_split_list(tk_call(@t.path, 'tag', 'nextrange', @id, first, last))
+ tk_split_simplelist(tk_call(@t.path, 'tag', 'nextrange', @id, first, last))
end
def prevrange(first, last=None)
- tk_split_list(tk_call(@t.path, 'tag', 'prevrange', @id, first, last))
+ tk_split_simplelist(tk_call(@t.path, 'tag', 'prevrange', @id, first, last))
end
def [](key)
@@ -631,6 +641,18 @@ class TkTextMarkCurrent<TkTextMark
end
end
+class TkTextMarkAnchor<TkTextMark
+ def initialize(parent,index=nil)
+ if not parent.kind_of?(TkText)
+ fail format("%s need to be TkText", parent.inspect)
+ end
+ @t = parent
+ @path = @id = 'anchor'
+ tk_call @t.path, 'mark', 'set', @id, index if index
+ @t._addtag id, self
+ end
+end
+
class TkTextWindow<TkObject
def initialize(parent, index, keys)
if not parent.kind_of?(TkText)
@@ -726,6 +748,133 @@ class TkTextWindow<TkObject
}
end
end
+
+ def _dump(type, *index)
+ str = tk_send('dump', type, *index)
+ result = []
+ sel = nil
+ i = 0
+ while i < str.size
+ # retrieve key
+ idx = str.index(/ /, i)
+ result.push str[i..(idx-1)]
+ i = idx + 1
+
+ # retrieve value
+ case result[-1]
+ when 'text'
+ if str[i] == ?{
+ # text formed as {...}
+ val, i = _retrieve_braced_text(str, i)
+ result.push val
+ else
+ # text which may contain backslahes
+ val, i = _retrieve_backslashed_text(str, i)
+ result.push val
+ end
+ else
+ idx = str.index(/ /, i)
+ val = str[i..(idx-1)]
+ case result[-1]
+ when 'mark'
+ case val
+ when 'insert'
+ result.push TkTextMarkInsert.new(self)
+ when 'current'
+ result.push TkTextMarkCurrent.new(self)
+ when 'anchor'
+ result.push TkTextMarkAnchor.new(self)
+ else
+ result.push tk_tcl2rb(val)
+ end
+ when 'tagon'
+ if val == 'sel'
+ if sel
+ result.push sel
+ else
+ result.push TkTextTagSel.new(self)
+ end
+ else
+ result.push tk_tcl2rb val
+ end
+ when 'tagoff'
+ result.push tk_tcl2rb sel
+ when 'window'
+ result.push tk_tcl2rb val
+ end
+ i = idx + 1
+ end
+
+ # retrieve index
+ idx = str.index(/ /, i)
+ if idx
+ result.push str[i..(idx-1)]
+ i = idx + 1
+ else
+ result.push str[i..-1]
+ break
+ end
+ end
+
+ kvis = []
+ until result.empty?
+ kvis.push [result.shift, result.shift, result.shift]
+ end
+ kvis # result is [[key1, value1, index1], [key2, value2, index2], ...]
+ end
+ private :_dump
+
+ def _retrieve_braced_text(str, i)
+ cnt = 0
+ idx = i
+ while idx < str.size
+ case str[idx]
+ when ?{
+ cnt += 1
+ when ?}
+ cnt -= 1
+ if cnt == 0
+ break
+ end
+ end
+ idx += 1
+ end
+ return str[i+1..idx-1], idx + 2
+ end
+ private :_retrieve_braced_text
+
+ def _retrieve_backslashed_text(str, i)
+ j = i
+ idx = nil
+ loop {
+ idx = str.index(/ /, j)
+ if str[idx-1] == ?\\
+ j += 1
+ else
+ break
+ end
+ }
+ val = str[i..(idx-1)]
+ val.gsub!(/\\( |\{|\})/, '\1')
+ return val, idx + 1
+ end
+ private :_retrieve_backslashed_text
+
+ def dump_all(*index)
+ _dump('-all', *index)
+ end
+ def dump_mark(*index)
+ _dump('-mark', *index)
+ end
+ def dump_tag(*index)
+ _dump('-tag', *index)
+ end
+ def dump_text(*index)
+ _dump('-text', *index)
+ end
+ def dump_window(*index)
+ _dump('-window', *index)
+ end
end
class TkTextImage<TkObject
diff --git a/hash.c b/hash.c
index 79f6542a4e..8a219aa061 100644
--- a/hash.c
+++ b/hash.c
@@ -1048,6 +1048,13 @@ ruby_setenv(name, value)
SetEnvironmentVariable(name,value);
#endif
+#elif defined __CYGWIN__
+#undef setenv
+#undef unsetenv
+ if (value)
+ setenv(name,value,1);
+ else
+ unsetenv(name);
#else /* WIN32 */
int i=envix(name); /* where does it go? */
diff --git a/intern.h b/intern.h
index 4c84be41f5..a5a3400366 100644
--- a/intern.h
+++ b/intern.h
@@ -132,6 +132,9 @@ void rb_thread_fd_close _((int));
int rb_thread_alone _((void));
void rb_thread_sleep _((int));
void rb_thread_sleep_forever _((void));
+VALUE rb_thread_stop _((void));
+VALUE rb_thread_wakeup _((VALUE));
+VALUE rb_thread_run _((VALUE));
VALUE rb_thread_create _((VALUE (*)(), void*));
int rb_thread_scope_shared_p _((void));
void rb_thread_interrupt _((void));
diff --git a/io.c b/io.c
index a0be6a9ef0..f76bf354f3 100644
--- a/io.c
+++ b/io.c
@@ -306,10 +306,6 @@ rb_io_eof(io)
rb_io_check_readable(fptr);
if (READ_DATA_PENDING(fptr->f)) return Qfalse;
-#if 0
- if (feof(fptr->f)) return Qtrue;
- return Qfalse;
-#else
READ_CHECK(fptr->f);
TRAP_BEG;
ch = getc(fptr->f);
@@ -320,7 +316,6 @@ rb_io_eof(io)
return Qfalse;
}
return Qtrue;
-#endif
}
static VALUE
@@ -811,6 +806,22 @@ rb_io_getc(io)
return INT2FIX(c & 0xff);
}
+int
+rb_getc(f)
+ FILE *f;
+{
+ int c;
+
+ if (!READ_DATA_PENDING(f)) {
+ rb_thread_wait_fd(fileno(f));
+ }
+ TRAP_BEG;
+ c = getc(f);
+ TRAP_END;
+
+ return c;
+}
+
static VALUE
rb_io_readchar(io)
VALUE io;
diff --git a/lib/telnet.rb b/lib/telnet.rb
index 855a9f5334..4251de1ee9 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -1,21 +1,23 @@
=begin
+$Date: 1999/06/04 06:24:58 $
-= simple telnet cliant library
+== SIMPLE TELNET CLIANT LIBRARY
-telnet.rb ver0.17 1999/04/30
-Wakou Aoyama <wakou@fsinet.or.jp>
+telnet.rb
+
+Version 0.20
+Wakou Aoyama <wakou@fsinet.or.jp>
-= methods
-== new (make new Telnet object)
+=== MAKE NEW TELNET OBJECT
host = Telnet.new({"Binmode" => FALSE, # default: FALSE
"Host" => "localhost", # default: "localhost"
"Output_log" => "output_log", # default: not output
"Dump_log" => "dump_log", # default: not output
"Port" => 23, # default: 23
- "Prompt" => /[$%#>] \Z/, # default: /[$%#>] \Z/
+ "Prompt" => /[$%#>] \z/n, # default: /[$%#>] \z/n
"Telnetmode" => TRUE, # default: TRUE
"Timeout" => 10, # default: 10
"Waittime" => 0, # default: 0
@@ -29,7 +31,7 @@ if set "Telnetmode" option FALSE. not TELNET command interpretation.
the same character as "Prompt" is included in the data, and, when
the network or the host is very heavy, the value is enlarged.
-=== status output
+=== STATUS OUTPUT
host = Telnet.new({"Hosh" => "localhost"){|c| print c }
@@ -37,11 +39,11 @@ connection status output.
example
-Trying localhost...
-Connected to localhost.
+ Trying localhost...
+ Connected to localhost.
-== waitfor (wait for match)
+=== WAIT FOR MATCH
line = host.waitfor(/match/)
line = host.waitfor({"Match" => /match/,
@@ -51,7 +53,7 @@ Connected to localhost.
if set "String" option. Match = Regexp.new(quote(string))
-=== realtime output
+==== REALTIME OUTPUT
host.waitfor(/match/){|c| print c }
host.waitfor({"Match" => /match/,
@@ -61,138 +63,157 @@ if set "String" option. Match = Regexp.new(quote(string))
of cource, set sync=TRUE or flush is necessary.
-== cmd (send string and wait prompt)
+=== SEND STRING AND WAIT PROMPT
line = host.cmd("string")
line = host.cmd({"String" => "string",
- "Prompt" => /[$%#>] \Z/,
+ "Prompt" => /[$%#>] \z/n,
"Timeout" => 10})
-=== realtime output
+==== REALTIME OUTPUT
host.cmd("string"){|c| print c }
host.cmd({"String" => "string",
- "Prompt" => /[$%#>] \Z/,
+ "Prompt" => /[$%#>] \z/n,
"Timeout" => 10}){|c| print c }
of cource, set sync=TRUE or flush is necessary.
-== print (send string)
+=== SEND STRING
host.print("string")
-== telnetmode (turn telnet command interpretation)
+=== TURN TELNET COMMAND INTERPRETATION
host.telnetmode # turn on/off
host.telnetmode(TRUE) # on
host.telnetmode(FALSE) # off
-== binmode (toggle newline translation)
+=== TOGGLE NEWLINE TRANSLATION
host.binmode # turn TRUE/FALSE
host.binmode(TRUE) # no translate newline
host.binmode(FALSE) # translate newline
-== login
+=== LOGIN
host.login("username", "password")
host.login({"Name" => "username",
"Password" => "password",
- "Prompt" => /[$%#>] \Z/,
+ "Prompt" => /[$%#>] \z/n,
"Timeout" => 10})
-=== realtime output
+==== REALTIME OUTPUT
host.login("username", "password"){|c| print c }
host.login({"Name" => "username",
"Password" => "password",
- "Prompt" => /[$%#>] \Z/,
+ "Prompt" => /[$%#>] \z/n,
"Timeout" => 10}){|c| print c }
of cource, set sync=TRUE or flush is necessary.
-= sample
+== EXAMPLE
-== login and send command
+=== LOGIN AND SEND COMMAND
localhost = Telnet.new({"Host" => "localhost",
"Timeout" => 10,
- "Prompt" => /[$%#>] \Z/})
+ "Prompt" => /[$%#>] \z/n})
localhost.login("username", "password"){|c| print c }
localhost.cmd("command"){|c| print c }
localhost.close
-== checks a POP server to see if you have mail
+=== CHECKS A POP SERVER TO SEE IF YOU HAVE MAIL
pop = Telnet.new({"Host" => "your_destination_host_here",
"Port" => 110,
"Telnetmode" => FALSE,
- "Prompt" => /^\+OK/})
+ "Prompt" => /^\+OK/n})
pop.cmd("user " + "your_username_here"){|c| print c}
pop.cmd("pass " + "your_password_here"){|c| print c}
pop.cmd("list"){|c| print c}
-= history
+== HISTORY
+
+=== Version 0.20
+waitfor: support for divided telnet command
+
+=== Version 0.181 1999/05/22
+bug fix: print method
+
+=== Version 0.18 1999/05/14
+respond to "IAC WON'T SGA" with "IAC DON'T SGA"
+
+DON'T SGA : end of line --> CR + LF
+
+bug fix: preprocess method
-ver0.17 1999/04/30
-bug fix
-$! + "\n" --> $!.to_s + "\n"
+=== Version 0.17 1999/04/30
+bug fix: $! + "\n" --> $!.to_s + "\n"
-ver0.163 1999/04/11
+=== Version 0.163 1999/04/11
STDOUT.write(message) --> yield(message) if iterator?
-ver0.162 1999/03/17
+=== Version 0.162 1999/03/17
add "Proxy" option
+
required timeout.rb
-ver0.161 1999/02/03
+=== Version 0.161 1999/02/03
select --> IO::select
-ver0.16 1998/10/09
+=== Version 0.16 1998/10/09
preprocess method change for the better
+
add binmode method.
-change default Binmode
+
+change default Binmode
TRUE --> FALSE
-ver0.15 1998/10/04
+=== Version 0.15 1998/10/04
add telnetmode method.
-ver0.141 1998/09/22
+=== Version 0.141 1998/09/22
change default prompt
-/[$%#>] $/ --> /[$%#>] \Z/
+ /[$%#>] $/ --> /[$%#>] \Z/
-ver0.14 1998/09/01
+=== Version 0.14 1998/09/01
IAC WILL SGA send EOL --> CR+NULL
+
IAC WILL SGA IAC DO BIN send EOL --> CR
+
NONE send EOL --> LF
+
add Dump_log option.
-ver0.13 1998/08/25
+=== Version 0.13 1998/08/25
add print method.
-ver0.122 1998/08/05
+=== Version 0.122 1998/08/05
support for HP-UX 10.20 thanks to WATANABE Tetsuya <tetsu@jpn.hp.com>
+
socket.<< --> socket.write
-ver0.121 1998/07/15
+=== Version 0.121 1998/07/15
string.+= --> string.concat
-ver0.12 1998/06/01
+=== Version 0.12 1998/06/01
add timeout, waittime.
-ver0.11 1998/04/21
+=== Version 0.11 1998/04/21
add realtime output.
-ver0.10 1998/04/13
+=== Version 0.10 1998/04/13
first release.
=end
@@ -205,84 +226,89 @@ TimeOut = TimeoutError
class Telnet < SimpleDelegator
- IAC = 255.chr # interpret as command:
- DONT = 254.chr # you are not to use option
- DO = 253.chr # please, you use option
- WONT = 252.chr # I won't use option
- WILL = 251.chr # I will use option
- SB = 250.chr # interpret as subnegotiation
- GA = 249.chr # you may reverse the line
- EL = 248.chr # erase the current line
- EC = 247.chr # erase the current character
- AYT = 246.chr # are you there
- AO = 245.chr # abort output--but let prog finish
- IP = 244.chr # interrupt process--permanently
- BREAK = 243.chr # break
- DM = 242.chr # data mark--for connect. cleaning
- NOP = 241.chr # nop
- SE = 240.chr # end sub negotiation
- EOR = 239.chr # end of record (transparent mode)
- ABORT = 238.chr # Abort process
- SUSP = 237.chr # Suspend process
- EOF = 236.chr # End of file
- SYNCH = 242.chr # for telfunc calls
-
- OPT_BINARY = 0.chr # Binary Transmission
- OPT_ECHO = 1.chr # Echo
- OPT_RCP = 2.chr # Reconnection
- OPT_SGA = 3.chr # Suppress Go Ahead
- OPT_NAMS = 4.chr # Approx Message Size Negotiation
- OPT_STATUS = 5.chr # Status
- OPT_TM = 6.chr # Timing Mark
- OPT_RCTE = 7.chr # Remote Controlled Trans and Echo
- OPT_NAOL = 8.chr # Output Line Width
- OPT_NAOP = 9.chr # Output Page Size
- OPT_NAOCRD = 10.chr # Output Carriage-Return Disposition
- OPT_NAOHTS = 11.chr # Output Horizontal Tab Stops
- OPT_NAOHTD = 12.chr # Output Horizontal Tab Disposition
- OPT_NAOFFD = 13.chr # Output Formfeed Disposition
- OPT_NAOVTS = 14.chr # Output Vertical Tabstops
- OPT_NAOVTD = 15.chr # Output Vertical Tab Disposition
- OPT_NAOLFD = 16.chr # Output Linefeed Disposition
- OPT_XASCII = 17.chr # Extended ASCII
- OPT_LOGOUT = 18.chr # Logout
- OPT_BM = 19.chr # Byte Macro
- OPT_DET = 20.chr # Data Entry Terminal
- OPT_SUPDUP = 21.chr # SUPDUP
- OPT_SUPDUPOUTPUT = 22.chr # SUPDUP Output
- OPT_SNDLOC = 23.chr # Send Location
- OPT_TTYPE = 24.chr # Terminal Type
- OPT_EOR = 25.chr # End of Record
- OPT_TUID = 26.chr # TACACS User Identification
- OPT_OUTMRK = 27.chr # Output Marking
- OPT_TTYLOC = 28.chr # Terminal Location Number
- OPT_3270REGIME = 29.chr # Telnet 3270 Regime
- OPT_X3PAD = 30.chr # X.3 PAD
- OPT_NAWS = 31.chr # Negotiate About Window Size
- OPT_TSPEED = 32.chr # Terminal Speed
- OPT_LFLOW = 33.chr # Remote Flow Control
- OPT_LINEMODE = 34.chr # Linemode
- OPT_XDISPLOC = 35.chr # X Display Location
- OPT_OLD_ENVIRON = 36.chr # Environment Option
- OPT_AUTHENTICATION = 37.chr # Authentication Option
- OPT_ENCRYPT = 38.chr # Encryption Option
- OPT_NEW_ENVIRON = 39.chr # New Environment Option
- OPT_EXOPL = 255.chr # Extended-Options-List
+ IAC = 255.chr # "\377" # interpret as command:
+ DONT = 254.chr # "\376" # you are not to use option
+ DO = 253.chr # "\375" # please, you use option
+ WONT = 252.chr # "\374" # I won't use option
+ WILL = 251.chr # "\373" # I will use option
+ SB = 250.chr # "\372" # interpret as subnegotiation
+ GA = 249.chr # "\371" # you may reverse the line
+ EL = 248.chr # "\370" # erase the current line
+ EC = 247.chr # "\367" # erase the current character
+ AYT = 246.chr # "\366" # are you there
+ AO = 245.chr # "\365" # abort output--but let prog finish
+ IP = 244.chr # "\364" # interrupt process--permanently
+ BREAK = 243.chr # "\363" # break
+ DM = 242.chr # "\362" # data mark--for connect. cleaning
+ NOP = 241.chr # "\361" # nop
+ SE = 240.chr # "\360" # end sub negotiation
+ EOR = 239.chr # "\357" # end of record (transparent mode)
+ ABORT = 238.chr # "\356" # Abort process
+ SUSP = 237.chr # "\355" # Suspend process
+ EOF = 236.chr # "\354" # End of file
+ SYNCH = 242.chr # "\362" # for telfunc calls
+
+ OPT_BINARY = 0.chr # "\000" # Binary Transmission
+ OPT_ECHO = 1.chr # "\001" # Echo
+ OPT_RCP = 2.chr # "\002" # Reconnection
+ OPT_SGA = 3.chr # "\003" # Suppress Go Ahead
+ OPT_NAMS = 4.chr # "\004" # Approx Message Size Negotiation
+ OPT_STATUS = 5.chr # "\005" # Status
+ OPT_TM = 6.chr # "\006" # Timing Mark
+ OPT_RCTE = 7.chr # "\a" # Remote Controlled Trans and Echo
+ OPT_NAOL = 8.chr # "\010" # Output Line Width
+ OPT_NAOP = 9.chr # "\t" # Output Page Size
+ OPT_NAOCRD = 10.chr # "\n" # Output Carriage-Return Disposition
+ OPT_NAOHTS = 11.chr # "\v" # Output Horizontal Tab Stops
+ OPT_NAOHTD = 12.chr # "\f" # Output Horizontal Tab Disposition
+ OPT_NAOFFD = 13.chr # "\r" # Output Formfeed Disposition
+ OPT_NAOVTS = 14.chr # "\016" # Output Vertical Tabstops
+ OPT_NAOVTD = 15.chr # "\017" # Output Vertical Tab Disposition
+ OPT_NAOLFD = 16.chr # "\020" # Output Linefeed Disposition
+ OPT_XASCII = 17.chr # "\021" # Extended ASCII
+ OPT_LOGOUT = 18.chr # "\022" # Logout
+ OPT_BM = 19.chr # "\023" # Byte Macro
+ OPT_DET = 20.chr # "\024" # Data Entry Terminal
+ OPT_SUPDUP = 21.chr # "\025" # SUPDUP
+ OPT_SUPDUPOUTPUT = 22.chr # "\026" # SUPDUP Output
+ OPT_SNDLOC = 23.chr # "\027" # Send Location
+ OPT_TTYPE = 24.chr # "\030" # Terminal Type
+ OPT_EOR = 25.chr # "\031" # End of Record
+ OPT_TUID = 26.chr # "\032" # TACACS User Identification
+ OPT_OUTMRK = 27.chr # "\e" # Output Marking
+ OPT_TTYLOC = 28.chr # "\034" # Terminal Location Number
+ OPT_3270REGIME = 29.chr # "\035" # Telnet 3270 Regime
+ OPT_X3PAD = 30.chr # "\036" # X.3 PAD
+ OPT_NAWS = 31.chr # "\037" # Negotiate About Window Size
+ OPT_TSPEED = 32.chr # " " # Terminal Speed
+ OPT_LFLOW = 33.chr # "!" # Remote Flow Control
+ OPT_LINEMODE = 34.chr # "\"" # Linemode
+ OPT_XDISPLOC = 35.chr # "#" # X Display Location
+ OPT_OLD_ENVIRON = 36.chr # "$" # Environment Option
+ OPT_AUTHENTICATION = 37.chr # "%" # Authentication Option
+ OPT_ENCRYPT = 38.chr # "&" # Encryption Option
+ OPT_NEW_ENVIRON = 39.chr # "'" # New Environment Option
+ OPT_EXOPL = 255.chr # "\377" # Extended-Options-List
NULL = "\000"
CR = "\015"
LF = "\012"
EOL = CR + LF
+v = $-v
+$-v = false
+ VERSION = "0.20"
+ RELEASE_DATE = "$Date: 1999/06/04 06:24:58 $"
+$-v = v
def initialize(options)
@options = options
- @options["Binmode"] = FALSE if not @options.include?("Binmode")
- @options["Host"] = "localhost" if not @options.include?("Host")
- @options["Port"] = 23 if not @options.include?("Port")
- @options["Prompt"] = /[$%#>] \Z/ if not @options.include?("Prompt")
- @options["Telnetmode"] = TRUE if not @options.include?("Telnetmode")
- @options["Timeout"] = 10 if not @options.include?("Timeout")
- @options["Waittime"] = 0 if not @options.include?("Waittime")
+ @options["Binmode"] = FALSE if not @options.include?("Binmode")
+ @options["Host"] = "localhost" if not @options.include?("Host")
+ @options["Port"] = 23 if not @options.include?("Port")
+ @options["Prompt"] = /[$%#>] \z/n if not @options.include?("Prompt")
+ @options["Telnetmode"] = TRUE if not @options.include?("Telnetmode")
+ @options["Timeout"] = 10 if not @options.include?("Timeout")
+ @options["Waittime"] = 0 if not @options.include?("Waittime")
@telnet_option = { "SGA" => FALSE, "BINARY" => FALSE }
@@ -333,7 +359,7 @@ class Telnet < SimpleDelegator
end
super(@sock)
- end
+ end # initialize
attr :sock
@@ -353,50 +379,64 @@ class Telnet < SimpleDelegator
end
end
- def preprocess(str)
+ def preprocess(string)
+ str = string.dup
- if not @options["Binmode"]
- str.gsub!(/#{CR}#{NULL}/no, CR) # combine CR+NULL into CR
- str.gsub!(/#{EOL}/no, "\n") # combine EOL into "\n"
- end
+ # combine CR+NULL into CR
+ str.gsub!(/#{CR}#{NULL}/no, CR) if @options["Telnetmode"]
+
+ # combine EOL into "\n"
+ str.gsub!(/#{EOL}/no, "\n") if not @options["Binmode"]
# respond to "IAC DO x"
- str.gsub!(/(?:(?!#{IAC}))?#{IAC}#{DO}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
- if OPT_BINARY == $1
+ str.gsub!(/([^#{IAC}]?)#{IAC}#{DO}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
+ if OPT_BINARY == $2
@telnet_option["BINARY"] = TRUE
@sock.write(IAC + WILL + OPT_BINARY)
else
- @sock.write(IAC + WONT + $1)
+ @sock.write(IAC + WONT + $2)
end
- ''
+ $1
}
# respond to "IAC DON'T x" with "IAC WON'T x"
- str.gsub!(/(?:(?!#{IAC}))?#{IAC}#{DONT}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
- @sock.write(IAC + WONT + $1)
- ''
+ str.gsub!(/([^#{IAC}]?)#{IAC}#{DONT}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
+ @sock.write(IAC + WONT + $2)
+ $1
}
# respond to "IAC WILL x"
- str.gsub!(/(?:(?!#{IAC}))?#{IAC}#{WILL}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
- if OPT_SGA == $1
+ str.gsub!(/([^#{IAC}]?)#{IAC}#{WILL}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
+ if OPT_ECHO == $2
+ @sock.write(IAC + DO + OPT_ECHO)
+ elsif OPT_SGA == $2
@telnet_option["SGA"] = TRUE
@sock.write(IAC + DO + OPT_SGA)
end
- ''
+ $1
}
- # ignore "IAC WON'T x"
- str.gsub!(/(?:(?!#{IAC}))?#{IAC}#{WONT}[#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]/no, '')
+ # respond to "IAC WON'T x"
+ str.gsub!(/([^#{IAC}]?)#{IAC}#{WONT}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
+ if OPT_ECHO == $2
+ @sock.write(IAC + DONT + OPT_ECHO)
+ elsif OPT_SGA == $2
+ @telnet_option["SGA"] = FALSE
+ @sock.write(IAC + DONT + OPT_SGA)
+ end
+ $1
+ }
# respond to "IAC AYT" (are you there)
- str.gsub!(/(?:(?!#{IAC}))?#{IAC}#{AYT}/no){
+ str.gsub!(/([^#{IAC}]?)#{IAC}#{AYT}/no){
@sock.write("nobody here but us pigeons" + EOL)
- ''
+ $1
}
- str.gsub(/#{IAC}#{IAC}/no, IAC) # handle escaped IAC characters
- end
+ str.gsub!(/#{IAC}#{IAC}/no, IAC) # handle escaped IAC characters
+
+ str
+ end # preprocess
def waitfor(options)
time_out = @options["Timeout"]
@@ -417,41 +457,50 @@ class Telnet < SimpleDelegator
end
line = ''
+ buf = ''
until(not IO::select([@sock], nil, nil, waittime) and prompt === line)
raise TimeOut, "timed-out; wait for the next data" if
not IO::select([@sock], nil, nil, time_out)
- buf = ''
begin
- buf = @sock.sysread(1024 * 1024)
- @dumplog.print(buf) if @options.include?("Dump_log")
- buf = preprocess(buf) if @options["Telnetmode"]
- rescue EOFError # End of file reached
- break
- ensure
+ c = @sock.sysread(1024 * 1024)
+ @dumplog.print(c) if @options.include?("Dump_log")
+ buf.concat c
+ if @options["Telnetmode"]
+ buf = preprocess(buf)
+ if /#{IAC}.?\z/no === buf
+ next
+ end
+ end
@log.print(buf) if @options.include?("Output_log")
yield buf if iterator?
line.concat(buf)
+ buf = ''
+ rescue EOFError # End of file reached
+ break
end
end
line
end
def print(string)
- string.gsub!(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
- if @options["Binmode"]
- @sock.write(string)
- else
+ str = string.dup + "\n"
+
+ str.gsub!(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
+
+ if not @options["Binmode"]
if @telnet_option["BINARY"] and @telnet_option["SGA"]
# IAC WILL SGA IAC DO BIN send EOL --> CR
- @sock.write(string.gsub(/\n/, CR) + CR)
+ str.gsub!(/\n/n, CR)
elsif @telnet_option["SGA"]
# IAC WILL SGA send EOL --> CR+NULL
- @sock.write(string.gsub(/\n/, CR + NULL) + CR + NULL)
+ str.gsub!(/\n/n, CR + NULL)
else
- # NONE send EOL --> LF
- @sock.write(string.gsub(/\n/, LF) + LF)
+ # NONE send EOL --> CR+LF
+ str.gsub!(/\n/n, EOL)
end
end
+
+ @sock.write(str)
end
def cmd(options)
@@ -484,14 +533,14 @@ class Telnet < SimpleDelegator
end
if iterator?
- line = waitfor(/login[: ]*\Z/){|c| yield c }
+ line = waitfor(/login[: ]*\z/n){|c| yield c }
line.concat( cmd({"String" => username,
- "Match" => /Password[: ]*\Z/}){|c| yield c } )
+ "Match" => /Password[: ]*\z/n}){|c| yield c } )
line.concat( cmd(password){|c| yield c } )
else
- line = waitfor(/login[: ]*\Z/)
+ line = waitfor(/login[: ]*\z/n)
line.concat( cmd({"String" => username,
- "Match" => /Password[: ]*\Z/}) )
+ "Match" => /Password[: ]*\z/n}) )
line.concat( cmd(password) )
end
line
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 3fb7ff23d5..11a8fba979 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -28,15 +28,13 @@ class Tempfile < SimpleDelegator
}
end
- def initialize(basename, tmpdir = nil)
+ def initialize(basename, tmpdir=ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp')
umask = File.umask(0177)
- tmpname = lock = nil
begin
n = 0
while true
begin
- tmpdir ||= ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'] || '/tmp'
- tmpname = sprintf('%s/%s.%d.%d', tmpdir, basename, $$, n)
+ tmpname = sprintf('%s/%s%d.%d', tmpdir, basename, $$, n)
lock = tmpname + '.lock'
unless File.exist?(tmpname) or File.exist?(lock)
Dir.mkdir(lock)
diff --git a/marshal.c b/marshal.c
index d045b5fe9b..3990092154 100644
--- a/marshal.c
+++ b/marshal.c
@@ -457,7 +457,7 @@ static int
r_byte(arg)
struct load_arg *arg;
{
- if (arg->fp) return getc(arg->fp);
+ if (arg->fp) return rb_getc(arg->fp);
if (arg->ptr < arg->end) return *(unsigned char*)arg->ptr++;
return EOF;
}
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 46b23be21c..0623e2dec5 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -152,6 +152,15 @@ The variable ruby-indent-level controls the amount of indentation.
(setq mode-name "Ruby")
(setq major-mode 'ruby-mode)
(ruby-mode-variables)
+ ;; for font-lock
+ (make-local-variable 'font-lock-syntactic-keywords)
+ (setq font-lock-syntactic-keywords
+ '(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil))
+ ("\\(#\\)[{$@]" 1 (1 . nil))))
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
+ (setq font-lock-keywords ruby-font-lock-keywords)
+
(run-hooks 'ruby-mode-hook))
(defun ruby-current-indentation ()
@@ -627,8 +636,7 @@ An end of a defun is found by moving forward from the beginning of one."
("\\$\\(.\\|\\sw+\\)" nil type)
("[$@].[a-zA-Z_0-9]*" nil struct)
("^__END__" nil label))))
-
- ((featurep 'font-lock)
+ )
(or (boundp 'font-lock-variable-name-face)
(setq font-lock-variable-name-face font-lock-type-face))
(defvar ruby-font-lock-keywords
@@ -687,15 +695,5 @@ An end of a defun is found by moving forward from the beginning of one."
'("^\\s *def\\s *\\<\\(\\(\\w\\|\\s_\\)+\\.\\)?\\(\\(\\w\\|\\s_\\)+\\)\\>"
3 font-lock-function-name-face t))
"*Additional expressions to highlight in ruby mode.")
- (add-hook
- 'ruby-mode-hook
- (lambda ()
- (make-local-variable 'font-lock-syntactic-keywords)
- (setq font-lock-syntactic-keywords
- '(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil))
- ("\\(#\\)[{$@]" 1 (1 . nil))))
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
- (setq font-lock-keywords ruby-font-lock-keywords)))))
(provide 'ruby-mode)
diff --git a/mkconfig.rb b/mkconfig.rb
index 370523d97b..400f7691af 100644
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -64,7 +64,7 @@ end
print v_fast, v_others
print <<EOS
- CONFIG["compile_dir"] = "#{File.expand_path(File.dirname($0))}"
+ CONFIG["compile_dir"] = "#{Dir.pwd}"
CONFIG.each_value do |val|
val.gsub!(/\\$\\(([^()]+)\\)/) do |var|
key = $1
diff --git a/object.c b/object.c
index 306d5270fa..2586d05737 100644
--- a/object.c
+++ b/object.c
@@ -460,7 +460,7 @@ rb_mod_clone(module)
VALUE module;
{
NEWOBJ(clone, struct RClass);
- OBJSETUP(clone, CLASS_OF(module), TYPE(module));
+ CLONESETUP(clone, module);
clone->super = RCLASS(module)->super;
clone->iv_tbl = 0;
diff --git a/pack.c b/pack.c
index d1527a571b..e37b7fdc0b 100644
--- a/pack.c
+++ b/pack.c
@@ -14,8 +14,17 @@
#include <sys/types.h>
#include <ctype.h>
-#ifndef atof
-double strtod();
+#define SIZE16 2
+#define SIZE32 4
+
+#if SIZEOF_SHORT != 2 || SIZEOF_LONG != 4
+# define NATINT_PACK
+#endif
+
+#ifdef NATINT_PACK
+# define NATINT_LEN(type,len) (natint?sizeof(type):(len))
+#else
+# define NATINT_LEN(type,len) sizeof(type)
#endif
#define define_swapx(x, xtype) \
@@ -280,6 +289,9 @@ static char *toofew = "too few arguments";
static void encodes _((VALUE,char*,int,int));
static void qpencode _((VALUE,VALUE,int));
+static long uv_to_utf8 _((char*,long));
+static long utf8_to_uv _((char*,int*));
+
static void
pack_add_ptr(str, add)
VALUE str, add;
@@ -304,9 +316,11 @@ pack_pack(ary, fmt)
int items, len, idx;
char *ptr;
int plen;
-
+#ifdef NATINT_PACK
+ int natint; /* native integer */
+#endif
- p = rb_str2cstr(fmt, &plen);
+ p = str2cstr(fmt, &plen);
pend = p + plen;
res = rb_str_new(0, 0);
@@ -317,7 +331,24 @@ pack_pack(ary, fmt)
while (p < pend) {
type = *p++; /* get data type */
+#ifdef NATINT_PACK
+ natint = 0;
+#endif
+
+ if (ISSPACE(type)) continue;
+ if (*p == '_') {
+ char *natstr = "sSiIlL";
+ if (strchr(natstr, type)) {
+#ifdef NATINT_PACK
+ natint = 1;
+#endif
+ p++;
+ }
+ else {
+ rb_raise(rb_eArgError, "'_' allowed only after types %s", natstr);
+ }
+ }
if (*p == '*') { /* set data length */
len = strchr("@Xxu", type) ? 0 : items;
p++;
@@ -339,9 +370,7 @@ pack_pack(ary, fmt)
plen = 0;
}
else {
- from = rb_obj_as_string(from);
- ptr = RSTRING(from)->ptr;
- plen = RSTRING(from)->len;
+ ptr = str2cstr(from, &plen);
}
if (p[-1] == '*')
@@ -350,6 +379,7 @@ pack_pack(ary, fmt)
switch (type) {
case 'a':
case 'A':
+ case 'Z':
if (plen >= len)
rb_str_cat(res, ptr, len);
else {
@@ -366,8 +396,12 @@ pack_pack(ary, fmt)
case 'b':
{
int byte = 0;
- int i;
+ int i, j;
+ if (len > plen) {
+ j = (len - plen + 1)/2;
+ len = plen;
+ }
for (i=0; i++ < len; ptr++) {
if (*ptr & 1)
byte |= 128;
@@ -385,14 +419,21 @@ pack_pack(ary, fmt)
c = byte & 0xff;
rb_str_cat(res, &c, 1);
}
+ len = RSTRING(res)->len;
+ rb_str_resize(res, len+j);
+ MEMZERO(RSTRING(res)->ptr+len, char, j);
}
break;
case 'B':
{
int byte = 0;
- int i;
+ int i, j;
+ if (len > plen) {
+ j = (len - plen + 1)/2;
+ len = plen;
+ }
for (i=0; i++ < len; ptr++) {
byte |= *ptr & 1;
if (i & 7)
@@ -409,60 +450,73 @@ pack_pack(ary, fmt)
c = byte & 0xff;
rb_str_cat(res, &c, 1);
}
+ len = RSTRING(res)->len;
+ rb_str_resize(res, len+j);
+ MEMZERO(RSTRING(res)->ptr+len, char, j);
}
break;
case 'h':
{
int byte = 0;
- int i;
+ int i, j;
+ if (len > plen) {
+ j = (len - plen + 1)/2;
+ len = plen;
+ }
for (i=0; i++ < len; ptr++) {
- if (ISXDIGIT(*ptr)) {
- if (ISALPHA(*ptr))
- byte |= (((*ptr & 15) + 9) & 15) << 4;
- else
- byte |= (*ptr & 15) << 4;
- if (i & 1)
- byte >>= 4;
- else {
- char c = byte & 0xff;
- rb_str_cat(res, &c, 1);
- byte = 0;
- }
+ if (ISALPHA(*ptr))
+ byte |= (((*ptr & 15) + 9) & 15) << 4;
+ else
+ byte |= (*ptr & 15) << 4;
+ if (i & 1)
+ byte >>= 4;
+ else {
+ char c = byte & 0xff;
+ rb_str_cat(res, &c, 1);
+ byte = 0;
}
}
if (len & 1) {
char c = byte & 0xff;
rb_str_cat(res, &c, 1);
}
+ len = RSTRING(res)->len;
+ rb_str_resize(res, len+j);
+ MEMZERO(RSTRING(res)->ptr+len, char, j);
}
break;
case 'H':
{
int byte = 0;
- int i;
+ int i, j;
+ if (len > plen) {
+ j = (len - plen + 1)/2;
+ len = plen;
+ }
for (i=0; i++ < len; ptr++) {
- if (ISXDIGIT(*ptr)) {
- if (ISALPHA(*ptr))
- byte |= ((*ptr & 15) + 9) & 15;
- else
- byte |= *ptr & 15;
- if (i & 1)
- byte <<= 4;
- else {
- char c = byte & 0xff;
- rb_str_cat(res, &c, 1);
- byte = 0;
- }
+ if (ISALPHA(*ptr))
+ byte |= ((*ptr & 15) + 9) & 15;
+ else
+ byte |= *ptr & 15;
+ if (i & 1)
+ byte <<= 4;
+ else {
+ char c = byte & 0xff;
+ rb_str_cat(res, &c, 1);
+ byte = 0;
}
}
if (len & 1) {
char c = byte & 0xff;
rb_str_cat(res, &c, 1);
}
+ len = RSTRING(res)->len;
+ rb_str_resize(res, len+j);
+ MEMZERO(RSTRING(res)->ptr+len, char, j);
}
break;
}
@@ -492,7 +546,7 @@ pack_pack(ary, fmt)
else {
s = NUM2INT(from);
}
- rb_str_cat(res, (char*)&s, sizeof(short));
+ rb_str_cat(res, (char*)&s, NATINT_LEN(short,2));
}
break;
@@ -520,7 +574,7 @@ pack_pack(ary, fmt)
else {
l = NUM2ULONG(from);
}
- rb_str_cat(res, (char*)&l, sizeof(long));
+ rb_str_cat(res, (char*)&l, NATINT_LEN(long,4));
}
break;
@@ -534,7 +588,7 @@ pack_pack(ary, fmt)
s = NUM2INT(from);
}
s = htons(s);
- rb_str_cat(res, (char*)&s, sizeof(short));
+ rb_str_cat(res, (char*)&s, NATINT_LEN(short,2));
}
break;
@@ -548,7 +602,7 @@ pack_pack(ary, fmt)
l = NUM2ULONG(from);
}
l = htonl(l);
- rb_str_cat(res, (char*)&l, sizeof(long));
+ rb_str_cat(res, (char*)&l, NATINT_LEN(long,4));
}
break;
@@ -562,7 +616,7 @@ pack_pack(ary, fmt)
s = NUM2INT(from);
}
s = htovs(s);
- rb_str_cat(res, (char*)&s, sizeof(short));
+ rb_str_cat(res, (char*)&s, NATINT_LEN(short,2));
}
break;
@@ -576,7 +630,7 @@ pack_pack(ary, fmt)
l = NUM2ULONG(from);
}
l = htovl(l);
- rb_str_cat(res, (char*)&l, sizeof(long));
+ rb_str_cat(res, (char*)&l, NATINT_LEN(long,4));
}
break;
@@ -732,11 +786,24 @@ pack_pack(ary, fmt)
rb_raise(rb_eArgError, "% may only be used in unpack");
break;
+ case 'U':
+ while (len-- > 0) {
+ unsigned long l;
+ char buf[8];
+
+ from = NEXTFROM;
+ if (NIL_P(from)) l = 0;
+ else {
+ l = NUM2ULONG(from);
+ }
+ l = uv_to_utf8(buf, l);
+ rb_str_cat(res, (char*)&buf, l);
+ }
+ break;
+
case 'u':
case 'm':
- from = rb_obj_as_string(NEXTFROM);
- ptr = RSTRING(from)->ptr;
- plen = RSTRING(from)->len;
+ ptr = str2cstr(NEXTFROM, &plen);
if (len <= 1)
len = 45;
@@ -914,7 +981,19 @@ hex2num(c)
}
}
-#define PACK_LENGTH_ADJUST(type) do { \
+#ifdef NATINT_PACK
+#define PACK_LENGTH_ADJUST(type,sz) do { \
+ int t__len = NATINT_LEN((type),(sz)); \
+ tmp = 0; \
+ if (len > (send-s)/t__len) { \
+ if (!star) { \
+ tmp = len-(send-s)/t__len; \
+ } \
+ len = (send-s)/t__len; \
+ } \
+} while (0)
+#else
+#define PACK_LENGTH_ADJUST(type,sz) do { \
tmp = 0; \
if (len > (send-s)/sizeof(type)) { \
if (!star) { \
@@ -923,6 +1002,7 @@ hex2num(c)
len = (send-s)/sizeof(type); \
} \
} while (0)
+#endif
#define PACK_ITEM_ADJUST() while (tmp--) rb_ary_push(ary, Qnil);
@@ -936,17 +1016,35 @@ pack_unpack(str, fmt)
VALUE ary;
char type;
int len, tmp, star;
+#ifdef NATINT_PACK
+ int natint; /* native integer */
+#endif
- s = rb_str2cstr(str, &len);
+ s = str2cstr(str, &len);
send = s + len;
- p = rb_str2cstr(fmt, &len);
+ p = str2cstr(fmt, &len);
pend = p + len;
ary = rb_ary_new();
while (p < pend) {
star = 0;
type = *p++;
- if (*p == '*') {
+ if (*p == '_') {
+ char *natstr = "sSiIlL";
+
+ if (strchr(natstr, type)) {
+#ifdef NATINT_PACK
+ natint = 1;
+#endif
+ p++;
+ }
+ else {
+ rb_raise(rb_eArgError, "'_' allowed only after types %s", natstr);
+ }
+ }
+ if (p >= pend)
+ len = 1;
+ else if (*p == '*') {
star = 1;
len = send - s;
p++;
@@ -971,8 +1069,22 @@ pack_unpack(str, fmt)
while (t >= s) {
if (*t != ' ' && *t != '\0') break;
- t--;
- len--;
+ t--; len--;
+ }
+ rb_ary_push(ary, rb_str_new(s, len));
+ s += end;
+ }
+ break;
+
+ case 'Z':
+ if (len > send - s) len = send - s;
+ {
+ int end = len;
+ char *t = s + len - 1;
+
+ while (t >= s) {
+ if (*t) break;
+ t--; len--;
}
rb_ary_push(ary, rb_str_new(s, len));
s += end;
@@ -985,6 +1097,7 @@ pack_unpack(str, fmt)
s += len;
break;
+
case 'b':
{
VALUE bitstr;
@@ -1066,7 +1179,7 @@ pack_unpack(str, fmt)
break;
case 'c':
- PACK_LENGTH_ADJUST(char);
+ PACK_LENGTH_ADJUST(char,sizeof(char));
while (len-- > 0) {
int c = *s++;
if (c > (char)127) c-=256;
@@ -1076,7 +1189,7 @@ pack_unpack(str, fmt)
break;
case 'C':
- PACK_LENGTH_ADJUST(char);
+ PACK_LENGTH_ADJUST(unsigned char,sizeof(unsigned char));
while (len-- > 0) {
unsigned char c = *s++;
rb_ary_push(ary, INT2FIX(c));
@@ -1085,29 +1198,29 @@ pack_unpack(str, fmt)
break;
case 's':
- PACK_LENGTH_ADJUST(short);
+ PACK_LENGTH_ADJUST(short,2);
while (len-- > 0) {
short tmp;
- memcpy(&tmp, s, sizeof(short));
- s += sizeof(short);
+ memcpy(&tmp, s, NATINT_LEN(short,2));
+ s += NATINT_LEN(short,2);
rb_ary_push(ary, INT2FIX(tmp));
}
PACK_ITEM_ADJUST();
break;
case 'S':
- PACK_LENGTH_ADJUST(short);
+ PACK_LENGTH_ADJUST(unsigned short,2);
while (len-- > 0) {
unsigned short tmp;
- memcpy(&tmp, s, sizeof(short));
- s += sizeof(short);
+ memcpy(&tmp, s, NATINT_LEN(unsigned short,2));
+ s += NATINT_LEN(unsigned short,2);
rb_ary_push(ary, INT2FIX(tmp));
}
PACK_ITEM_ADJUST();
break;
case 'i':
- PACK_LENGTH_ADJUST(int);
+ PACK_LENGTH_ADJUST(int,sizeof(int));
while (len-- > 0) {
int tmp;
memcpy(&tmp, s, sizeof(int));
@@ -1118,44 +1231,44 @@ pack_unpack(str, fmt)
break;
case 'I':
- PACK_LENGTH_ADJUST(int);
+ PACK_LENGTH_ADJUST(unsigned int,sizeof(unsigned int));
while (len-- > 0) {
unsigned int tmp;
- memcpy(&tmp, s, sizeof(int));
- s += sizeof(int);
+ memcpy(&tmp, s, sizeof(unsigned int));
+ s += sizeof(unsigned int);
rb_ary_push(ary, rb_uint2inum(tmp));
}
PACK_ITEM_ADJUST();
break;
case 'l':
- PACK_LENGTH_ADJUST(long);
+ PACK_LENGTH_ADJUST(long,4);
while (len-- > 0) {
long tmp;
- memcpy(&tmp, s, sizeof(long));
- s += sizeof(long);
+ memcpy(&tmp, s, NATINT_LEN(long,4));
+ s += NATINT_LEN(long,4);
rb_ary_push(ary, rb_int2inum(tmp));
}
PACK_ITEM_ADJUST();
break;
case 'L':
- PACK_LENGTH_ADJUST(long);
+ PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp;
- memcpy(&tmp, s, sizeof(long));
- s += sizeof(long);
+ memcpy(&tmp, s, NATINT_LEN(unsigned long,4));
+ s += NATINT_LEN(unsigned long,4);
rb_ary_push(ary, rb_uint2inum(tmp));
}
PACK_ITEM_ADJUST();
break;
case 'n':
- PACK_LENGTH_ADJUST(short);
+ PACK_LENGTH_ADJUST(unsigned short,2);
while (len-- > 0) {
unsigned short tmp;
- memcpy(&tmp, s, sizeof(short));
- s += sizeof(short);
+ memcpy(&tmp, s, NATINT_LEN(unsigned short,2));
+ s += NATINT_LEN(unsigned short,2);
tmp = ntohs(tmp);
rb_ary_push(ary, rb_uint2inum(tmp));
}
@@ -1163,11 +1276,11 @@ pack_unpack(str, fmt)
break;
case 'N':
- PACK_LENGTH_ADJUST(long);
+ PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp;
- memcpy(&tmp, s, sizeof(long));
- s += sizeof(long);
+ memcpy(&tmp, s, NATINT_LEN(unsigned long,4));
+ s += NATINT_LEN(unsigned long,4);
tmp = ntohl(tmp);
rb_ary_push(ary, rb_uint2inum(tmp));
}
@@ -1175,11 +1288,11 @@ pack_unpack(str, fmt)
break;
case 'v':
- PACK_LENGTH_ADJUST(short);
+ PACK_LENGTH_ADJUST(unsigned short,2);
while (len-- > 0) {
unsigned short tmp;
- memcpy(&tmp, s, sizeof(short));
- s += sizeof(short);
+ memcpy(&tmp, s, NATINT_LEN(unsigned short,2));
+ s += NATINT_LEN(unsigned short,2);
tmp = vtohs(tmp);
rb_ary_push(ary, rb_uint2inum(tmp));
}
@@ -1187,11 +1300,11 @@ pack_unpack(str, fmt)
break;
case 'V':
- PACK_LENGTH_ADJUST(long);
+ PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
unsigned long tmp;
- memcpy(&tmp, s, sizeof(long));
- s += sizeof(long);
+ memcpy(&tmp, s, NATINT_LEN(long,4));
+ s += NATINT_LEN(long,4);
tmp = vtohl(tmp);
rb_ary_push(ary, rb_uint2inum(tmp));
}
@@ -1200,7 +1313,7 @@ pack_unpack(str, fmt)
case 'f':
case 'F':
- PACK_LENGTH_ADJUST(float);
+ PACK_LENGTH_ADJUST(float,sizeof(float));
while (len-- > 0) {
float tmp;
memcpy(&tmp, s, sizeof(float));
@@ -1211,7 +1324,7 @@ pack_unpack(str, fmt)
break;
case 'e':
- PACK_LENGTH_ADJUST(float);
+ PACK_LENGTH_ADJUST(float,sizeof(float));
while (len-- > 0) {
float tmp;
FLOAT_CONVWITH(ftmp);
@@ -1225,7 +1338,7 @@ pack_unpack(str, fmt)
break;
case 'E':
- PACK_LENGTH_ADJUST(double);
+ PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
double tmp;
DOUBLE_CONVWITH(dtmp);
@@ -1240,7 +1353,7 @@ pack_unpack(str, fmt)
case 'D':
case 'd':
- PACK_LENGTH_ADJUST(double);
+ PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
double tmp;
memcpy(&tmp, s, sizeof(double));
@@ -1251,7 +1364,7 @@ pack_unpack(str, fmt)
break;
case 'g':
- PACK_LENGTH_ADJUST(float);
+ PACK_LENGTH_ADJUST(float,sizeof(float));
while (len-- > 0) {
float tmp;
FLOAT_CONVWITH(ftmp;)
@@ -1265,7 +1378,7 @@ pack_unpack(str, fmt)
break;
case 'G':
- PACK_LENGTH_ADJUST(double);
+ PACK_LENGTH_ADJUST(double,sizeof(double));
while (len-- > 0) {
double tmp;
DOUBLE_CONVWITH(dtmp);
@@ -1278,6 +1391,18 @@ pack_unpack(str, fmt)
PACK_ITEM_ADJUST();
break;
+ case 'U':
+ if (len > send - s) len = send - s;
+ while (len-- > 0 && s < send) {
+ int alen;
+ unsigned long l;
+
+ l = utf8_to_uv(s, &alen);
+ s += alen;
+ rb_ary_push(ary, INT2NUM(l));
+ }
+ break;
+
case 'u':
{
VALUE str = rb_str_new(0, (send - s)*3/4);
@@ -1327,6 +1452,8 @@ pack_unpack(str, fmt)
else if (s < send && (s+1 == send || s[1] == '\n'))
s += 2; /* possible checksum byte */
}
+
+ RSTRING(str)->ptr[total] = '\0';
RSTRING(str)->len = total;
rb_ary_push(ary, str);
}
@@ -1369,6 +1496,7 @@ pack_unpack(str, fmt)
*ptr++ = a << 2 | b >> 4;
*ptr++ = b << 4 | c >> 2;
}
+ *ptr = '\0';
RSTRING(str)->len = ptr - RSTRING(str)->ptr;
rb_ary_push(ary, str);
}
@@ -1395,6 +1523,7 @@ pack_unpack(str, fmt)
}
s++;
}
+ *ptr = '\0';
RSTRING(str)->len = ptr - RSTRING(str)->ptr;
rb_ary_push(ary, str);
}
@@ -1454,6 +1583,82 @@ pack_unpack(str, fmt)
return ary;
}
+#define BYTEWIDTH 8
+
+static long
+uv_to_utf8(buf, uv)
+ char *buf;
+ long uv;
+{
+ if (uv < 0x80) {
+ buf[0] = (char)uv;
+ return 1;
+ }
+ if (uv < 0x7ff) {
+ buf[0] = ((uv>>6)&0xff)|0xc0;
+ buf[1] = uv&0x3f;
+ return 2;
+ }
+ if (uv < 0xffff) {
+ buf[0] = ((uv>>12)&0xff)|0xe0;
+ buf[1] = (uv>>6)&0x3f;
+ buf[2] = uv&0x3f;
+ return 3;
+ }
+ if (uv < 0x1fffff) {
+ buf[0] = ((uv>>18)&0xff)|0xf0;
+ buf[1] = (uv>>12)&0x3f;
+ buf[2] = (uv>>6)&0x3f;
+ buf[3] = uv&0x3f;
+ return 4;
+ }
+ if (uv < 0x3ffffff) {
+ buf[0] = ((uv>>24)&0xff)|0xf0;
+ buf[1] = (uv>>18)&0x3f;
+ buf[2] = (uv>>12)&0x3f;
+ buf[3] = (uv>>6)&0x3f;
+ buf[4] = uv&0x3f;
+ return 5;
+ }
+ if (uv < 0x7fffffff) {
+ buf[0] = ((uv>>30)&0xff)|0xfc;
+ buf[1] = (uv>>24)&0x3f;
+ buf[2] = (uv>>18)&0x3f;
+ buf[3] = (uv>>12)&0x3f;
+ buf[4] = (uv>>6)&0x3f;
+ buf[5] = uv&0x3f;
+ return 6;
+ }
+ buf[0] = uv>>BYTEWIDTH;
+ buf[1] = uv&0xff;
+ return 2;
+}
+
+static long
+utf8_to_uv(p, lenp)
+ char *p;
+ int *lenp;
+{
+ int c = (*p++)&0xff;
+ unsigned long uv;
+ int n = 1;
+
+ if (c < 0xc0) n = 1;
+ else if (c < 0xe0) n = 2;
+ else if (c < 0xf0) n = 3;
+ else if (c < 0xf8) n = 4;
+ else if (c < 0xfc) n = 5;
+ else if (c < 0xfe) n = 6;
+ *lenp = n--;
+
+ uv = c;
+ uv &= (1<<(BYTEWIDTH-2-n)) - 1;
+ while (n--) {
+ uv = uv << 6 | *p++ & ((1<<6)-1);
+ }
+ return uv;
+}
+
void
Init_pack()
{
diff --git a/parse.c b/parse.c
deleted file mode 100644
index 71cf6c8300..0000000000
--- a/parse.c
+++ /dev/null
@@ -1,7571 +0,0 @@
-
-/* A Bison parser, made from parse.y
- by GNU Bison version 1.25.90
- */
-
-#define YYBISON 1 /* Identify Bison output. */
-
-#define kCLASS 257
-#define kMODULE 258
-#define kDEF 259
-#define kUNDEF 260
-#define kBEGIN 261
-#define kRESCUE 262
-#define kENSURE 263
-#define kEND 264
-#define kIF 265
-#define kUNLESS 266
-#define kTHEN 267
-#define kELSIF 268
-#define kELSE 269
-#define kCASE 270
-#define kWHEN 271
-#define kWHILE 272
-#define kUNTIL 273
-#define kFOR 274
-#define kBREAK 275
-#define kNEXT 276
-#define kREDO 277
-#define kRETRY 278
-#define kIN 279
-#define kDO 280
-#define kRETURN 281
-#define kYIELD 282
-#define kSUPER 283
-#define kSELF 284
-#define kNIL 285
-#define kTRUE 286
-#define kFALSE 287
-#define kAND 288
-#define kOR 289
-#define kNOT 290
-#define kIF_MOD 291
-#define kUNLESS_MOD 292
-#define kWHILE_MOD 293
-#define kUNTIL_MOD 294
-#define kALIAS 295
-#define kDEFINED 296
-#define klBEGIN 297
-#define klEND 298
-#define k__LINE__ 299
-#define k__FILE__ 300
-#define tIDENTIFIER 301
-#define tFID 302
-#define tGVAR 303
-#define tIVAR 304
-#define tCONSTANT 305
-#define tINTEGER 306
-#define tFLOAT 307
-#define tSTRING 308
-#define tXSTRING 309
-#define tREGEXP 310
-#define tDSTRING 311
-#define tDXSTRING 312
-#define tDREGEXP 313
-#define tNTH_REF 314
-#define tBACK_REF 315
-#define tUPLUS 316
-#define tUMINUS 317
-#define tPOW 318
-#define tCMP 319
-#define tEQ 320
-#define tEQQ 321
-#define tNEQ 322
-#define tGEQ 323
-#define tLEQ 324
-#define tANDOP 325
-#define tOROP 326
-#define tMATCH 327
-#define tNMATCH 328
-#define tDOT2 329
-#define tDOT3 330
-#define tAREF 331
-#define tASET 332
-#define tLSHFT 333
-#define tRSHFT 334
-#define tCOLON2 335
-#define tCOLON3 336
-#define tOP_ASGN 337
-#define tASSOC 338
-#define tLPAREN 339
-#define tLBRACK 340
-#define tLBRACE 341
-#define tSTAR 342
-#define tAMPER 343
-#define tSYMBEG 344
-#define LAST_TOKEN 345
-
-#line 13 "parse.y"
-
-
-#define YYDEBUG 1
-#include "ruby.h"
-#include "env.h"
-#include "node.h"
-#include "st.h"
-#include <stdio.h>
-#include <errno.h>
-
-#define ID_SCOPE_SHIFT 3
-#define ID_SCOPE_MASK 0x07
-#define ID_LOCAL 0x01
-#define ID_INSTANCE 0x02
-#define ID_GLOBAL 0x03
-#define ID_ATTRSET 0x04
-#define ID_CONST 0x05
-
-#define is_id_notop(id) ((id)>LAST_TOKEN)
-#define is_local_id(id) (is_id_notop(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
-#define is_global_id(id) (is_id_notop(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
-#define is_instance_id(id) (is_id_notop(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
-#define is_attrset_id(id) (is_id_notop(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET)
-#define is_const_id(id) (is_id_notop(id)&&((id)&ID_SCOPE_MASK)==ID_CONST)
-
-NODE *ruby_eval_tree_begin = 0;
-NODE *ruby_eval_tree = 0;
-
-char *ruby_sourcefile; /* current source file */
-int ruby_sourceline; /* current line no. */
-
-static int yylex();
-static int yyerror();
-
-static enum lex_state {
- EXPR_BEG, /* ignore newline, +/- is a sign. */
- EXPR_MID, /* newline significant, +/- is a sign. */
- EXPR_END, /* newline significant, +/- is a operator. */
- EXPR_ARG, /* newline significant, +/- is a operator. */
- EXPR_FNAME, /* ignore newline, no reserved words. */
- EXPR_DOT, /* right after `.' or `::', no reserved words. */
- EXPR_CLASS, /* immediate after `class', no here document. */
-} lex_state;
-
-static int class_nest = 0;
-static int in_single = 0;
-static int compile_for_eval = 0;
-static ID cur_mid = 0;
-
-static NODE *cond();
-static NODE *logop();
-
-static NODE *newline_node();
-static void fixpos();
-
-static int value_expr();
-static void void_expr();
-static void void_stmts();
-
-static NODE *block_append();
-static NODE *list_append();
-static NODE *list_concat();
-static NODE *arg_concat();
-static NODE *call_op();
-static int in_defined = 0;
-
-static NODE *arg_blk_pass();
-static NODE *new_call();
-static NODE *new_fcall();
-
-static NODE *gettable();
-static NODE *assignable();
-static NODE *aryset();
-static NODE *attrset();
-static void rb_backref_error();
-static NODE *node_assign();
-
-static NODE *match_gen();
-static void local_push();
-static void local_pop();
-static int local_append();
-static int local_cnt();
-static int local_id();
-static ID *local_tbl();
-
-static struct RVarmap *dyna_push();
-static void dyna_pop();
-static int dyna_in_block();
-
-#define cref_push() NEW_CREF()
-static void cref_pop();
-static NODE *cur_cref;
-
-static void top_local_init();
-static void top_local_setup();
-
-#line 110 "parse.y"
-typedef union {
- NODE *node;
- VALUE val;
- ID id;
- int num;
- struct RVarmap *vars;
-} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define YYFINAL 647
-#define YYFLAG -32768
-#define YYNTBASE 118
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 345 ? yytranslate[x] : 212)
-
-static const char yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 116,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 104, 2, 2, 2, 103, 98, 2, 115,
- 110, 101, 99, 111, 100, 109, 102, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 93, 117, 95,
- 91, 94, 92, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 112, 2, 113, 97, 2, 114, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 107, 96, 108, 105, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, 106
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = { 0,
- 0, 1, 4, 7, 9, 11, 15, 18, 20, 21,
- 26, 30, 34, 38, 41, 45, 49, 53, 57, 58,
- 64, 69, 73, 75, 79, 82, 85, 87, 91, 95,
- 98, 101, 103, 106, 111, 116, 119, 121, 125, 127,
- 131, 133, 137, 140, 143, 149, 154, 157, 159, 161,
- 165, 168, 170, 174, 176, 181, 185, 187, 189, 194,
- 198, 200, 202, 204, 206, 208, 210, 212, 214, 216,
- 217, 222, 224, 226, 228, 230, 232, 234, 236, 238,
- 240, 242, 244, 246, 248, 250, 252, 254, 256, 258,
- 260, 262, 264, 266, 268, 270, 272, 274, 276, 278,
- 280, 282, 284, 286, 288, 290, 292, 294, 296, 298,
- 300, 302, 304, 306, 308, 310, 312, 314, 316, 318,
- 320, 322, 324, 326, 328, 330, 332, 334, 336, 338,
- 340, 342, 344, 346, 348, 350, 352, 354, 356, 360,
- 361, 366, 373, 379, 385, 389, 393, 397, 401, 405,
- 409, 413, 417, 421, 424, 427, 431, 435, 439, 443,
- 447, 451, 455, 459, 463, 467, 471, 475, 479, 482,
- 485, 489, 493, 497, 501, 502, 507, 513, 515, 517,
- 519, 522, 524, 527, 530, 536, 539, 542, 548, 553,
- 558, 566, 570, 572, 575, 578, 580, 582, 584, 586,
- 590, 592, 597, 600, 602, 604, 607, 609, 613, 616,
- 618, 620, 622, 624, 626, 628, 630, 635, 639, 643,
- 648, 652, 654, 659, 663, 665, 666, 673, 675, 678,
- 680, 683, 690, 697, 703, 709, 714, 722, 729, 733,
- 734, 741, 742, 750, 751, 757, 758, 765, 766, 767,
- 777, 779, 781, 783, 785, 787, 789, 792, 794, 796,
- 798, 804, 806, 809, 811, 813, 815, 818, 820, 824,
- 825, 831, 832, 838, 840, 842, 844, 846, 848, 851,
- 856, 863, 867, 874, 878, 883, 885, 887, 889, 895,
- 897, 902, 905, 907, 909, 915, 917, 919, 922, 924,
- 927, 929, 931, 933, 935, 937, 939, 941, 943, 945,
- 947, 949, 951, 953, 955, 957, 959, 961, 963, 965,
- 967, 968, 973, 976, 981, 984, 991, 996, 1001, 1004,
- 1009, 1012, 1015, 1017, 1018, 1020, 1024, 1028, 1030, 1034,
- 1037, 1039, 1042, 1045, 1047, 1049, 1050, 1056, 1058, 1061,
- 1064, 1066, 1070, 1074, 1076, 1078, 1080, 1082, 1084, 1086,
- 1088, 1090, 1092, 1094, 1096, 1098, 1099, 1101, 1102, 1104,
- 1105, 1107, 1109, 1111, 1113, 1115, 1118
-};
-
-static const short yyrhs[] = { -1,
- 119, 120, 0, 121, 206, 0, 211, 0, 122, 0,
- 121, 210, 122, 0, 1, 122, 0, 173, 0, 0,
- 41, 136, 123, 136, 0, 41, 49, 49, 0, 41,
- 49, 61, 0, 41, 49, 60, 0, 6, 137, 0,
- 122, 37, 125, 0, 122, 38, 125, 0, 122, 39,
- 125, 0, 122, 40, 125, 0, 0, 43, 124, 107,
- 120, 108, 0, 44, 107, 120, 108, 0, 134, 91,
- 175, 0, 125, 0, 127, 91, 151, 0, 27, 152,
- 0, 28, 152, 0, 126, 0, 125, 34, 125, 0,
- 125, 35, 125, 0, 36, 125, 0, 104, 126, 0,
- 141, 0, 202, 146, 0, 154, 109, 203, 146, 0,
- 154, 81, 203, 146, 0, 29, 146, 0, 129, 0,
- 85, 128, 110, 0, 129, 0, 85, 128, 110, 0,
- 131, 0, 131, 88, 134, 0, 131, 88, 0, 131,
- 132, 0, 131, 132, 111, 88, 134, 0, 131, 132,
- 111, 88, 0, 88, 133, 0, 88, 0, 133, 0,
- 85, 128, 110, 0, 130, 111, 0, 130, 0, 132,
- 111, 130, 0, 184, 0, 154, 112, 144, 113, 0,
- 154, 109, 47, 0, 186, 0, 184, 0, 154, 112,
- 144, 113, 0, 154, 109, 47, 0, 186, 0, 47,
- 0, 51, 0, 47, 0, 51, 0, 48, 0, 139,
- 0, 140, 0, 136, 0, 0, 137, 111, 138, 136,
- 0, 75, 0, 96, 0, 97, 0, 98, 0, 65,
- 0, 66, 0, 67, 0, 73, 0, 94, 0, 69,
- 0, 95, 0, 70, 0, 79, 0, 80, 0, 99,
- 0, 100, 0, 101, 0, 88, 0, 102, 0, 103,
- 0, 64, 0, 105, 0, 62, 0, 63, 0, 77,
- 0, 78, 0, 114, 0, 45, 0, 46, 0, 43,
- 0, 44, 0, 41, 0, 34, 0, 7, 0, 21,
- 0, 16, 0, 3, 0, 5, 0, 42, 0, 26,
- 0, 15, 0, 14, 0, 10, 0, 9, 0, 33,
- 0, 20, 0, 37, 0, 25, 0, 4, 0, 22,
- 0, 31, 0, 36, 0, 35, 0, 23, 0, 8,
- 0, 24, 0, 27, 0, 30, 0, 29, 0, 13,
- 0, 32, 0, 6, 0, 38, 0, 40, 0, 17,
- 0, 39, 0, 28, 0, 134, 91, 141, 0, 0,
- 184, 83, 142, 141, 0, 154, 112, 144, 113, 83,
- 141, 0, 154, 109, 47, 83, 141, 0, 154, 109,
- 51, 83, 141, 0, 186, 83, 141, 0, 141, 75,
- 141, 0, 141, 76, 141, 0, 141, 99, 141, 0,
- 141, 100, 141, 0, 141, 101, 141, 0, 141, 102,
- 141, 0, 141, 103, 141, 0, 141, 64, 141, 0,
- 62, 141, 0, 63, 141, 0, 141, 96, 141, 0,
- 141, 97, 141, 0, 141, 98, 141, 0, 141, 65,
- 141, 0, 141, 94, 141, 0, 141, 69, 141, 0,
- 141, 95, 141, 0, 141, 70, 141, 0, 141, 66,
- 141, 0, 141, 67, 141, 0, 141, 68, 141, 0,
- 141, 73, 141, 0, 141, 74, 141, 0, 104, 141,
- 0, 105, 141, 0, 141, 79, 141, 0, 141, 80,
- 141, 0, 141, 71, 141, 0, 141, 72, 141, 0,
- 0, 42, 207, 143, 141, 0, 141, 92, 141, 93,
- 141, 0, 154, 0, 145, 0, 211, 0, 146, 207,
- 0, 126, 0, 150, 111, 0, 150, 148, 0, 150,
- 111, 88, 141, 148, 0, 200, 111, 0, 200, 148,
- 0, 200, 111, 88, 141, 148, 0, 150, 111, 200,
- 148, 0, 150, 111, 200, 111, 0, 150, 111, 200,
- 111, 88, 141, 148, 0, 88, 141, 148, 0, 147,
- 0, 89, 141, 0, 111, 147, 0, 211, 0, 150,
- 0, 211, 0, 141, 0, 150, 111, 141, 0, 150,
- 0, 150, 111, 88, 141, 0, 88, 141, 0, 146,
- 0, 211, 0, 150, 208, 0, 181, 0, 154, 81,
- 51, 0, 82, 135, 0, 54, 0, 57, 0, 55,
- 0, 58, 0, 59, 0, 185, 0, 186, 0, 154,
- 112, 144, 113, 0, 86, 153, 113, 0, 87, 199,
- 108, 0, 27, 115, 152, 110, 0, 27, 115, 110,
- 0, 27, 0, 28, 115, 152, 110, 0, 28, 115,
- 110, 0, 28, 0, 0, 42, 207, 115, 155, 125,
- 110, 0, 48, 0, 202, 170, 0, 174, 0, 174,
- 170, 0, 11, 125, 162, 120, 164, 10, 0, 12,
- 125, 162, 120, 165, 10, 0, 18, 125, 163, 120,
- 10, 0, 19, 125, 163, 120, 10, 0, 16, 120,
- 176, 10, 0, 20, 166, 25, 125, 163, 120, 10,
- 0, 7, 120, 179, 165, 180, 10, 0, 85, 120,
- 110, 0, 0, 3, 135, 187, 156, 120, 10, 0,
- 0, 3, 79, 125, 209, 157, 120, 10, 0, 0,
- 4, 135, 158, 120, 10, 0, 0, 5, 136, 159,
- 189, 120, 10, 0, 0, 0, 5, 197, 205, 160,
- 136, 161, 189, 120, 10, 0, 21, 0, 22, 0,
- 23, 0, 24, 0, 209, 0, 13, 0, 209, 13,
- 0, 209, 0, 26, 0, 165, 0, 14, 125, 162,
- 120, 164, 0, 211, 0, 15, 120, 0, 134, 0,
- 127, 0, 211, 0, 96, 96, 0, 72, 0, 96,
- 166, 96, 0, 0, 26, 169, 167, 120, 10, 0,
- 0, 107, 171, 167, 120, 108, 0, 47, 0, 51,
- 0, 48, 0, 174, 0, 126, 0, 172, 168, 0,
- 202, 115, 145, 110, 0, 154, 109, 203, 115, 145,
- 110, 0, 154, 109, 203, 0, 154, 81, 203, 115,
- 145, 110, 0, 154, 81, 204, 0, 29, 115, 145,
- 110, 0, 29, 0, 173, 0, 126, 0, 17, 177,
- 162, 120, 178, 0, 150, 0, 150, 111, 88, 141,
- 0, 88, 141, 0, 165, 0, 176, 0, 8, 149,
- 163, 120, 179, 0, 211, 0, 211, 0, 9, 120,
- 0, 183, 0, 90, 182, 0, 56, 0, 136, 0,
- 50, 0, 49, 0, 52, 0, 53, 0, 47, 0,
- 50, 0, 49, 0, 51, 0, 31, 0, 30, 0,
- 32, 0, 33, 0, 46, 0, 45, 0, 184, 0,
- 60, 0, 61, 0, 209, 0, 0, 95, 188, 125,
- 209, 0, 1, 209, 0, 115, 190, 207, 110, 0,
- 190, 209, 0, 191, 111, 193, 111, 194, 196, 0,
- 191, 111, 193, 196, 0, 191, 111, 194, 196, 0,
- 191, 196, 0, 193, 111, 194, 196, 0, 193, 196,
- 0, 194, 196, 0, 195, 0, 0, 47, 0, 191,
- 111, 47, 0, 47, 91, 141, 0, 192, 0, 193,
- 111, 192, 0, 88, 47, 0, 88, 0, 89, 47,
- 0, 111, 195, 0, 211, 0, 185, 0, 0, 115,
- 198, 125, 207, 110, 0, 211, 0, 200, 208, 0,
- 150, 208, 0, 201, 0, 200, 111, 201, 0, 141,
- 84, 141, 0, 47, 0, 51, 0, 48, 0, 47,
- 0, 51, 0, 48, 0, 139, 0, 47, 0, 48,
- 0, 139, 0, 109, 0, 81, 0, 0, 210, 0,
- 0, 116, 0, 0, 116, 0, 111, 0, 117, 0,
- 116, 0, 209, 0, 210, 117, 0, 0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
- 232, 241, 260, 266, 267, 271, 275, 280, 281, 282,
- 287, 293, 302, 307, 313, 319, 325, 335, 345, 352,
- 359, 367, 372, 374, 380, 387, 392, 393, 397, 401,
- 406, 411, 413, 418, 424, 430, 438, 439, 444, 445,
- 450, 454, 458, 462, 466, 470, 474, 478, 483, 484,
- 489, 494, 498, 503, 507, 511, 515, 521, 525, 529,
- 533, 539, 543, 545, 546, 547, 548, 553, 559, 563,
- 564, 568, 569, 570, 571, 572, 573, 574, 575, 576,
- 577, 578, 579, 580, 581, 582, 583, 584, 585, 586,
- 587, 588, 589, 590, 591, 592, 593, 594, 596, 596,
- 596, 596, 597, 597, 597, 597, 597, 597, 597, 598,
- 598, 598, 598, 598, 598, 598, 599, 599, 599, 599,
- 599, 599, 599, 600, 600, 600, 600, 600, 600, 600,
- 601, 601, 601, 601, 601, 601, 602, 602, 604, 609,
- 610, 625, 640, 651, 662, 667, 671, 675, 679, 683,
- 687, 691, 695, 699, 703, 707, 711, 715, 719, 723,
- 727, 731, 735, 739, 743, 747, 751, 755, 759, 764,
- 768, 772, 776, 780, 784, 785, 789, 795, 800, 808,
- 809, 811, 816, 820, 824, 829, 833, 838, 843, 848,
- 852, 857, 862, 864, 870, 874, 876, 877, 879, 884,
- 890, 902, 907, 913, 927, 928, 930, 934, 939, 943,
- 947, 948, 952, 953, 954, 955, 956, 961, 969, 973,
- 980, 986, 992, 997, 1001, 1005, 1005, 1010, 1014, 1019,
- 1020, 1029, 1038, 1047, 1055, 1063, 1071, 1079, 1099, 1103,
- 1113, 1121, 1128, 1136, 1145, 1153, 1161, 1170, 1171, 1178,
- 1186, 1190, 1194, 1198, 1203, 1204, 1205, 1207, 1208, 1210,
- 1211, 1220, 1221, 1226, 1227, 1229, 1230, 1234, 1238, 1243,
- 1248, 1256, 1261, 1268, 1272, 1276, 1280, 1281, 1283, 1293,
- 1298, 1304, 1310, 1316, 1321, 1328, 1337, 1338, 1340, 1347,
- 1348, 1353, 1359, 1360, 1362, 1369, 1371, 1372, 1377, 1378,
- 1383, 1385, 1386, 1387, 1389, 1390, 1392, 1393, 1394, 1395,
- 1396, 1397, 1398, 1399, 1400, 1401, 1403, 1408, 1409, 1411,
- 1415, 1419, 1423, 1425, 1430, 1435, 1439, 1443, 1447, 1451,
- 1455, 1459, 1463, 1467, 1472, 1479, 1487, 1494, 1499, 1504,
- 1510, 1515, 1520, 1524, 1526, 1539, 1539, 1557, 1558, 1562,
- 1570, 1571, 1576, 1581, 1582, 1583, 1585, 1586, 1587, 1588,
- 1590, 1591, 1592, 1594, 1595, 1597, 1598, 1600, 1601, 1603,
- 1604, 1605, 1607, 1608, 1610, 1611, 1613
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = { "$","error","$undefined.","kCLASS",
-"kMODULE","kDEF","kUNDEF","kBEGIN","kRESCUE","kENSURE","kEND","kIF","kUNLESS",
-"kTHEN","kELSIF","kELSE","kCASE","kWHEN","kWHILE","kUNTIL","kFOR","kBREAK","kNEXT",
-"kREDO","kRETRY","kIN","kDO","kRETURN","kYIELD","kSUPER","kSELF","kNIL","kTRUE",
-"kFALSE","kAND","kOR","kNOT","kIF_MOD","kUNLESS_MOD","kWHILE_MOD","kUNTIL_MOD",
-"kALIAS","kDEFINED","klBEGIN","klEND","k__LINE__","k__FILE__","tIDENTIFIER",
-"tFID","tGVAR","tIVAR","tCONSTANT","tINTEGER","tFLOAT","tSTRING","tXSTRING",
-"tREGEXP","tDSTRING","tDXSTRING","tDREGEXP","tNTH_REF","tBACK_REF","tUPLUS",
-"tUMINUS","tPOW","tCMP","tEQ","tEQQ","tNEQ","tGEQ","tLEQ","tANDOP","tOROP","tMATCH",
-"tNMATCH","tDOT2","tDOT3","tAREF","tASET","tLSHFT","tRSHFT","tCOLON2","tCOLON3",
-"tOP_ASGN","tASSOC","tLPAREN","tLBRACK","tLBRACE","tSTAR","tAMPER","tSYMBEG",
-"'='","'?'","':'","'>'","'<'","'|'","'^'","'&'","'+'","'-'","'*'","'/'","'%'",
-"'!'","'~'","LAST_TOKEN","'{'","'}'","'.'","')'","','","'['","']'","'`'","'('",
-"'\\n'","';'","program","@1","compstmt","stmts","stmt","@2","@3","expr","command_call",
-"mlhs","mlhs_entry","mlhs_basic","mlhs_item","mlhs_head","mlhs_tail","mlhs_node",
-"lhs","cname","fname","undef_list","@4","op","reswords","arg","@5","@6","aref_args",
-"opt_call_args","call_args","block_arg","opt_block_arg","opt_list","args","mrhs",
-"ret_args","array","primary","@7","@8","@9","@10","@11","@12","@13","then","do",
-"if_tail","opt_else","block_var","opt_block_var","do_block","@14","brace_block",
-"@15","generic_call","block_call","method_call","stmt_rhs","case_body","when_args",
-"cases","rescue","ensure","literal","symbol","numeric","variable","var_ref",
-"backref","superclass","@16","f_arglist","f_args","f_arg","f_opt","f_optarg",
-"f_rest_arg","f_block_arg","opt_f_block_arg","singleton","@17","assoc_list",
-"assocs","assoc","operation","operation2","operation3","dot_or_colon","opt_terms",
-"opt_nl","trailer","term","terms","none", NULL
-};
-#endif
-
-static const short yyr1[] = { 0,
- 119, 118, 120, 121, 121, 121, 121, 122, 123, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 124, 122,
- 122, 122, 122, 125, 125, 125, 125, 125, 125, 125,
- 125, 125, 126, 126, 126, 126, 127, 127, 128, 128,
- 129, 129, 129, 129, 129, 129, 129, 129, 130, 130,
- 131, 132, 132, 133, 133, 133, 133, 134, 134, 134,
- 134, 135, 135, 136, 136, 136, 136, 136, 137, 138,
- 137, 139, 139, 139, 139, 139, 139, 139, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 139, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 141, 142,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
- 141, 141, 141, 141, 143, 141, 141, 141, 144, 145,
- 145, 146, 146, 146, 146, 146, 146, 146, 146, 146,
- 146, 146, 146, 147, 148, 148, 149, 149, 150, 150,
- 151, 151, 151, 152, 153, 153, 154, 154, 154, 154,
- 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
- 154, 154, 154, 154, 154, 155, 154, 154, 154, 154,
- 154, 154, 154, 154, 154, 154, 154, 154, 154, 156,
- 154, 157, 154, 158, 154, 159, 154, 160, 161, 154,
- 154, 154, 154, 154, 162, 162, 162, 163, 163, 164,
- 164, 165, 165, 166, 166, 167, 167, 167, 167, 169,
- 168, 171, 170, 172, 172, 172, 172, 172, 173, 174,
- 174, 174, 174, 174, 174, 174, 175, 175, 176, 177,
- 177, 177, 178, 178, 179, 179, 180, 180, 181, 181,
- 181, 182, 182, 182, 183, 183, 184, 184, 184, 184,
- 184, 184, 184, 184, 184, 184, 185, 186, 186, 187,
- 188, 187, 187, 189, 189, 190, 190, 190, 190, 190,
- 190, 190, 190, 190, 191, 191, 192, 193, 193, 194,
- 194, 195, 196, 196, 197, 198, 197, 199, 199, 199,
- 200, 200, 201, 202, 202, 202, 203, 203, 203, 203,
- 204, 204, 204, 205, 205, 206, 206, 207, 207, 208,
- 208, 208, 209, 209, 210, 210, 211
-};
-
-static const short yyr2[] = { 0,
- 0, 2, 2, 1, 1, 3, 2, 1, 0, 4,
- 3, 3, 3, 2, 3, 3, 3, 3, 0, 5,
- 4, 3, 1, 3, 2, 2, 1, 3, 3, 2,
- 2, 1, 2, 4, 4, 2, 1, 3, 1, 3,
- 1, 3, 2, 2, 5, 4, 2, 1, 1, 3,
- 2, 1, 3, 1, 4, 3, 1, 1, 4, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 3, 0,
- 4, 6, 5, 5, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
- 3, 3, 3, 3, 0, 4, 5, 1, 1, 1,
- 2, 1, 2, 2, 5, 2, 2, 5, 4, 4,
- 7, 3, 1, 2, 2, 1, 1, 1, 1, 3,
- 1, 4, 2, 1, 1, 2, 1, 3, 2, 1,
- 1, 1, 1, 1, 1, 1, 4, 3, 3, 4,
- 3, 1, 4, 3, 1, 0, 6, 1, 2, 1,
- 2, 6, 6, 5, 5, 4, 7, 6, 3, 0,
- 6, 0, 7, 0, 5, 0, 6, 0, 0, 9,
- 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
- 5, 1, 2, 1, 1, 1, 2, 1, 3, 0,
- 5, 0, 5, 1, 1, 1, 1, 1, 2, 4,
- 6, 3, 6, 3, 4, 1, 1, 1, 5, 1,
- 4, 2, 1, 1, 5, 1, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 4, 2, 4, 2, 6, 4, 4, 2, 4,
- 2, 2, 1, 0, 1, 3, 3, 1, 3, 2,
- 1, 2, 2, 1, 1, 0, 5, 1, 2, 2,
- 1, 3, 3, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
- 1, 1, 1, 1, 1, 2, 0
-};
-
-static const short yydefact[] = { 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 251, 252, 253, 254, 222, 225, 286,
- 312, 311, 313, 314, 0, 0, 368, 19, 0, 316,
- 315, 354, 356, 309, 308, 355, 305, 306, 210, 212,
- 301, 211, 213, 214, 318, 319, 0, 0, 0, 0,
- 377, 377, 48, 0, 0, 0, 2, 366, 5, 23,
- 27, 0, 37, 0, 41, 49, 0, 32, 178, 0,
- 8, 230, 207, 299, 317, 215, 216, 0, 4, 7,
- 62, 63, 0, 0, 244, 108, 120, 109, 133, 105,
- 126, 115, 114, 131, 113, 112, 107, 136, 117, 106,
- 121, 125, 127, 119, 111, 128, 138, 130, 129, 122,
- 132, 116, 104, 124, 123, 118, 134, 137, 135, 103,
- 110, 101, 102, 99, 100, 64, 66, 65, 94, 95,
- 92, 76, 77, 78, 81, 83, 79, 72, 96, 97,
- 84, 85, 89, 80, 82, 73, 74, 75, 86, 87,
- 88, 90, 91, 93, 98, 346, 246, 67, 68, 317,
- 345, 0, 129, 122, 132, 116, 99, 100, 64, 65,
- 69, 14, 377, 307, 228, 310, 0, 27, 0, 230,
- 0, 0, 0, 0, 222, 225, 286, 368, 265, 264,
- 0, 0, 317, 216, 0, 0, 0, 0, 0, 0,
- 182, 199, 204, 193, 377, 25, 178, 317, 216, 377,
- 351, 0, 26, 377, 36, 30, 0, 9, 369, 175,
- 0, 0, 154, 178, 155, 209, 0, 0, 0, 37,
- 199, 370, 0, 205, 370, 0, 370, 348, 47, 0,
- 54, 57, 304, 303, 302, 300, 31, 169, 170, 374,
- 373, 3, 375, 367, 0, 0, 0, 0, 0, 0,
- 0, 51, 0, 43, 52, 44, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 377, 270, 279, 272, 231,
- 140, 0, 377, 33, 229, 0, 0, 321, 240, 320,
- 0, 0, 334, 365, 364, 248, 70, 377, 377, 296,
- 256, 0, 255, 0, 0, 0, 0, 259, 0, 258,
- 0, 0, 0, 0, 377, 0, 377, 194, 221, 0,
- 0, 183, 184, 196, 0, 377, 186, 187, 224, 0,
- 0, 368, 180, 11, 13, 12, 0, 226, 0, 0,
- 0, 0, 0, 239, 38, 372, 371, 206, 218, 350,
- 219, 372, 349, 0, 377, 376, 6, 15, 16, 17,
- 18, 28, 29, 0, 201, 24, 0, 42, 0, 58,
- 61, 0, 288, 139, 287, 22, 153, 159, 164, 165,
- 166, 161, 163, 173, 174, 167, 168, 146, 147, 171,
- 172, 0, 160, 162, 156, 157, 158, 148, 149, 150,
- 151, 152, 361, 362, 208, 363, 0, 284, 357, 359,
- 358, 360, 282, 0, 179, 377, 377, 0, 145, 0,
- 242, 323, 0, 0, 0, 368, 335, 341, 0, 334,
- 0, 0, 377, 338, 377, 377, 333, 0, 0, 0,
- 197, 198, 0, 377, 262, 377, 257, 377, 0, 290,
- 0, 236, 0, 0, 0, 357, 358, 282, 0, 0,
- 0, 192, 220, 353, 0, 200, 195, 377, 357, 0,
- 0, 0, 352, 223, 285, 181, 10, 0, 176, 0,
- 21, 38, 200, 56, 0, 203, 0, 50, 0, 377,
- 46, 53, 0, 377, 35, 0, 0, 377, 34, 217,
- 268, 0, 0, 266, 0, 141, 280, 0, 0, 0,
- 245, 0, 0, 340, 342, 368, 0, 325, 0, 329,
- 344, 0, 331, 0, 332, 249, 71, 0, 0, 263,
- 0, 0, 297, 0, 0, 260, 0, 292, 0, 0,
- 234, 235, 217, 0, 377, 190, 189, 217, 377, 0,
- 20, 55, 0, 357, 0, 45, 177, 0, 143, 144,
- 0, 0, 267, 0, 0, 0, 0, 322, 241, 347,
- 337, 0, 247, 336, 377, 377, 343, 0, 339, 377,
- 334, 377, 298, 238, 0, 232, 233, 0, 377, 0,
- 185, 0, 188, 227, 202, 59, 283, 281, 142, 269,
- 271, 273, 243, 324, 0, 327, 328, 330, 0, 295,
- 0, 291, 293, 294, 289, 237, 377, 377, 0, 377,
- 191, 326, 250, 261, 0, 0, 0
-};
-
-static const short yydefgoto[] = { 645,
- 1, 228, 58, 59, 357, 221, 60, 61, 62, 229,
- 63, 64, 65, 266, 66, 179, 84, 157, 172, 459,
- 158, 159, 68, 438, 359, 434, 435, 352, 204, 343,
- 460, 205, 386, 206, 233, 224, 498, 444, 528, 311,
- 313, 458, 601, 322, 329, 555, 556, 192, 523, 298,
- 436, 300, 437, 70, 71, 180, 396, 327, 471, 635,
- 319, 552, 73, 246, 74, 208, 76, 209, 309, 443,
- 451, 452, 453, 454, 455, 456, 597, 540, 162, 312,
- 236, 210, 211, 195, 478, 428, 316, 252, 220, 368,
- 323, 254, 79
-};
-
-static const short yypact[] = {-32768,
- 1810, 5014, 139, 42, 3321, 4815, 2255, 5104, 5104, 2727,
- 5104, 5104, 6272,-32768,-32768,-32768,-32768, 3786, 3876, 3966,
--32768,-32768,-32768,-32768, 5104, 4712, -53,-32768, 72,-32768,
--32768, 1928, 2138,-32768,-32768, 2033,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768, 5914, 5914, 42, 2818,
- 5914, 5914, 6536, 4609, 6004, 5914,-32768, 226, 355, 212,
- 132, 41,-32768, 81, 6360,-32768, 105, 1680, -25, 172,
--32768, 54,-32768,-32768, 90,-32768, 159, 3426,-32768, 355,
--32768,-32768, 5104, 43,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 125, 142,
- 171, 220,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768, 292, 300, 303,-32768, 304,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 307,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768, 94, 195, 3516, 3606, 3696, 25,-32768, 121, 115,
- 25, 198, 36, 36, 129, 146, 156, -53,-32768,-32768,
- 136, 251, 28, 44, -9, 2926, 5914, 5914, 5914, 1160,
--32768, 1427,-32768,-32768, 167,-32768, 187, 97, 106, 181,
--32768, 4919,-32768, 5194,-32768,-32768, 278,-32768,-32768, 179,
- 209, 3034, 259, 210, 259,-32768, 2818, 215, 236, 272,
- 1680, -44, 277,-32768, -44, 279, -28,-32768,-32768, 228,
- 245, 274,-32768,-32768,-32768,-32768,-32768, 259, 259,-32768,
--32768,-32768,-32768, 3216, 5104, 5104, 5104, 5104, 5104, 5104,
- 5554,-32768, 2818, 6536,-32768, 288, 6094, 5914, 5914, 5914,
- 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914,
- 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914, 5914,
- 5914, 5914, 5914, 6565, 6624, 5194,-32768,-32768,-32768,-32768,
--32768, 5914, 5194,-32768,-32768, 12, 226,-32768,-32768,-32768,
- 3125, 5104, 89,-32768,-32768,-32768,-32768, 5914, 385,-32768,
--32768, 2363, 389, 5914, 2545, 5644, 393,-32768, 3125,-32768,
- 3125, 179, 6565, 6683, 5194, 5104, 774, 1680,-32768, 296,
- 5914, 5284,-32768,-32768, 6742, 5194, 5374,-32768,-32768, 311,
- 313, -53,-32768,-32768,-32768,-32768, 4815,-32768, 5914, 3034,
- 306, 6742, 315,-32768, 320, 5914,-32768,-32768,-32768,-32768,
--32768, 5914,-32768, 6801, 5194,-32768, 355, 212, 212, 212,
- 212,-32768,-32768, 5914, 322,-32768, 324,-32768, 298, 245,
- 274, 6448, 132, 1680,-32768,-32768, 259, 7031, 7031, 7031,
- 7031, 485, 485, 7071, 6991, 7031, 7031, 6951, 6951, 138,
- 138, 6911, 485, 485, 185, 185, 130, 211, 211, 259,
- 259, 259, 4056, 4146, 4236, 4326, 4416,-32768, 186,-32768,
- 334,-32768, 4506, 323,-32768, -6, -6, 5914, 1680, 328,
--32768,-32768, 5104, 3125, 430, 40, 354, 399, 401, 26,
- 3125, 226, 338,-32768, 340, 341,-32768, 4815, 4815, 29,
- 345,-32768, 2636, 448,-32768, 362,-32768, 385, 5914, 347,
- 18,-32768, 449, 451, 349, 51,-32768, 350, 356, 36,
- 378,-32768,-32768, 1680, 5914, 1427,-32768, 359, 144, 358,
- 5914, 1427,-32768,-32768,-32768,-32768,-32768, 5104, 1680, 366,
--32768, 287, 1680, 263, 365, 1680, 5734,-32768, 6860, 5194,
- 6536,-32768, 5914, 5194,-32768, 5914, 5914, 5194,-32768, 250,
--32768, 6184, 3125,-32768, 3034, 1680,-32768, 3125, 12, 465,
--32768, 369, 5914,-32768,-32768, -53, 471,-32768, 34,-32768,
--32768, 38,-32768, 400,-32768,-32768,-32768, 2255, 5914,-32768,
- 3125, 480,-32768, 5104, 481,-32768, 482, 1680, 5824, 2454,
--32768,-32768, 53, 3125, 774, 5464,-32768, 199, 774, 57,
--32768, 299, 5914, 74, 380,-32768, 1680, 384, 1680, 1680,
- 388, 5914,-32768, 403, 491, 387, 492,-32768,-32768,-32768,
- 1680, 394,-32768, 354, 395, 341,-32768, 354,-32768, 341,
- 89, 195,-32768,-32768, 25,-32768,-32768, 5914, 92, 495,
--32768, 5914,-32768,-32768, 1680, 299,-32768,-32768, 1680,-32768,
--32768,-32768,-32768,-32768, 38,-32768,-32768,-32768, 3125,-32768,
- 2363, 1680,-32768,-32768,-32768,-32768, 774, 341, 497, 362,
--32768,-32768,-32768,-32768, 508, 512,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768, 711,-32768, 13,-32768,-32768, 108, 1461, -11, -70,
- -27, -61,-32768,-32768, 461, 453, 61, 14,-32768,-32768,
- -237,-32768, 1082,-32768,-32768, -296, -182, 8, -306, -207,
--32768, -18,-32768, 16,-32768, -1,-32768,-32768,-32768,-32768,
--32768,-32768,-32768, -168, -162, -125, -305, -4, 79,-32768,
--32768, -41,-32768,-32768, 252, 703,-32768, -86,-32768,-32768,
- -73,-32768,-32768,-32768,-32768, 475, 525, 567,-32768,-32768,
- -69, 83,-32768, -481, -8, -494, -284, -413,-32768,-32768,
--32768, -36, -342, 93, -126,-32768,-32768,-32768, -167, -63,
- -33,-32768, 1100
-};
-
-
-#define YYLAST 7174
-
-
-static const short yytable[] = { 69,
- 69, 189, 348, 265, 493, 69, 69, 69, 69, 69,
- 69, 191, 325, 464, 80, 237, 207, 207, 207, 171,
- 332, 331, 230, 69, 253, 203, 203, 215, 457, 493,
- 321, 351, 232, 235, 213, 487, 305, 321, 479, 218,
- 487, 543, 545, 307, 596, 259, 260, 600, 69, 490,
- 310, 240, -58, 207, 328, 294, 426, 432, 259, 260,
- 599, 328, 219, 240, 85, 521, 366, 245, -61, 259,
- 260, 367, 447, 259, 260, -60, 207, -59, 505, -277,
- 594, 69, 372, 295, 598, 304, 296, 367, 81, 522,
- 259, 260, 82, 78, 78, 426, 432, 299, -60, 78,
- 78, 78, 78, 78, 78, 303, 463, 432, 326, 226,
- 78, 78, 78, 448, 449, 177, 181, 78, 183, 184,
- 440, 448, 449, -58, 432, 448, 449, 250, 251, 482,
- 638, 261, 216, 250, 251, 447, 432, 308, -54, -61,
- 250, 251, 78, 599, 250, 251, -60, 78, -59, 330,
- 330, 250, 251, 305, -57, 219, 363, -278, 250, 251,
- 299, -56, 557, -55, -60, 457, 614, 427, 433, -60,
- 78, 370, 301, 373, 487, 78, 448, 449, 222, 301,
- -58, 626, 627, -60, 496, 81, 628, -58, 302, 82,
- 306, 262, 387, 268, 69, 267, -61, 297, 207, 230,
- -54, 268, 318, 450, 317, -312, 475, 203, 281, 282,
- 207, 324, 207, 575, 326, 340, 333, 83, 433, 203,
- 69, 299, -311, 493, 642, 69, 516, 350, 289, 290,
- 291, 292, 293, -312, -60, 230, 289, 290, 291, 292,
- 293, 302, 385, 200, 334, 259, 260, 335, 268, -61,
- -311, -313, 69, 69, 69, 69, 69, 69, 69, 487,
- 212, 69, 389, 281, 282, 207, 377, 294, 516, -57,
- 214, 432, 441, 442, 268, 336, -60, 342, 532, -313,
- 567, 582, 288, 289, 290, 291, 292, 293, 78, -59,
- 333, 347, 78, 358, 207, 345, -56, 548, 346, 461,
- -314, 207, 560, 633, 78, 488, 78, 470, 333, 69,
- 69, 291, 292, 293, 78, 360, 457, 564, 362, 78,
- 69, 346, 268, 69, 364, -317, 354, 69, -314, 69,
- 512, 578, 582, 207, 69, 581, 374, 355, 356, 375,
- -59, 250, 251, -357, 207, 365, 78, 78, 78, 78,
- 78, 78, 78, -317, -216, 78, -317, 611, 69, 78,
- -55, 613, 378, 379, 380, 381, 382, 383, 592, -357,
- 497, -357, -316, 207, -357, 554, 463, -357, 333, -217,
- -315, -39, -216, -307, -310, -216, 371, 314, 78, 369,
- 240, 255, 256, 257, 258, 78, -40, -50, 392, 463,
- -316, 467, 472, 78, 78, 483, 509, -217, -315, 510,
- -217, -307, -310, 501, 78, 315, 517, 78, 538, 446,
- 494, 78, 495, 78, 502, 207, 330, 78, 78, 641,
- -50, 207, 507, 508, 515, 520, 631, 527, 78, 531,
- 519, 69, 69, 480, 533, 534, 330, 535, 539, 69,
- 542, 544, 78, 67, 67, 549, 551, 559, 561, 67,
- 562, 69, 67, 514, 518, 190, 198, 78, 563, 566,
- 568, 546, 547, 571, 589, 75, 75, 572, 590, 160,
- 593, 75, 75, 75, 75, 75, 75, 193, 449, 604,
- 606, 607, 616, 617, 622, 588, 69, 618, 620, 75,
- 621, 623, 67, 624, 636, 625, 643, 646, 207, 389,
- 189, 647, 207, 239, 644, 525, 207, 584, 395, 78,
- 191, 69, 634, 69, 75, 78, 69, 241, 630, 161,
- 595, 629, 536, 0, 0, 78, 78, 0, 0, 241,
- 0, 0, 0, 78, 0, 0, 69, 0, 268, 69,
- 529, 0, 69, 0, 0, 78, 0, 75, 69, 0,
- 0, 0, 69, 281, 282, 0, 0, 77, 77, 0,
- 0, 0, 0, 77, 77, 77, 77, 77, 77, 194,
- 286, 287, 288, 289, 290, 291, 292, 293, 0, 0,
- 78, 77, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 78, 0, 0, 570, 78, 0, 0, 0,
- 78, 0, 0, 0, 0, 78, 77, 78, 0, 242,
- 78, 0, 0, 0, 0, 0, 0, 69, 0, 69,
- 0, 242, 0, 0, 0, 0, 0, 0, 0, 0,
- 78, 0, 0, 78, 0, 0, 78, 0, 67, 77,
- 0, 0, 78, 0, 0, 0, 78, 0, 0, 0,
- 0, 605, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 0, 0, 0, 67, 0, 0, 0, 0, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 75, 0, 0, 0,
- 0, 75, 0, 72, 72, 0, 67, 0, 0, 72,
- 0, 57, 72, 0, 0, 67, 388, 173, 0, 0,
- 182, 78, 0, 78, 0, 0, 0, 0, 75, 75,
- 75, 75, 75, 75, 75, 0, 0, 75, 390, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 72, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 77, 67, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67, 0, 0, 67, 0, 0,
- 0, 67, 0, 67, 0, 75, 75, 0, 77, 0,
- 0, 0, 0, 77, 0, 0, 75, 0, 0, 75,
- 0, 0, 0, 75, 0, 75, 0, 0, 0, 0,
- 75, 0, 67, 0, 0, 0, 0, 0, 0, 0,
- 77, 77, 77, 77, 77, 77, 77, 0, 0, 77,
- 391, 0, 0, 0, 75, 0, 0, 268, 269, 270,
- 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
- 0, 0, 281, 282, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 283, 241, 284, 285, 286,
- 287, 288, 289, 290, 291, 292, 293, 77, 77, 0,
- 0, 0, 0, 0, 481, 0, 0, 0, 77, 0,
- 0, 77, 0, 0, 0, 77, 67, 77, 72, 0,
- 0, 0, 77, 67, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 67, 0, 75, 75, 0,
- 0, 0, 0, 0, 72, 75, 77, 0, 0, 72,
- 0, 0, 361, 0, 0, 0, 0, 75, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 72, 0, 242, 0,
- 0, 0, 0, 576, 0, 72, 0, 0, 0, 72,
- 0, 0, 75, 0, 190, 67, 0, 67, 0, 0,
- 67, 0, 0, 0, 0, 390, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 193, 75, 0, 75,
- 67, 0, 75, 67, 0, 0, 0, 0, 0, 77,
- 77, 0, 67, 72, 0, 0, 67, 77, 0, 0,
- 0, 445, 75, 0, 72, 75, 0, 72, 75, 77,
- 0, 72, 466, 72, 75, 468, 0, 0, 75, 473,
- 0, 474, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 72, 0, 77, 0, 0, 0, 0, 0,
- 500, 0, 0, 0, 0, 0, 0, 391, 0, 0,
- 0, 67, 0, 67, 0, 0, 0, 0, 194, 77,
- 0, 77, 0, 0, 77, 0, 0, 0, 0, 202,
- 202, 202, 0, 75, 0, 75, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 0, 0, 77, 0, 0,
- 77, 0, 0, 0, 0, 0, 77, 0, 223, 225,
- 77, 0, 231, 202, 0, 0, 248, 249, 0, 0,
- 0, 0, 0, 0, 0, 0, 72, 0, 0, 0,
- 234, 238, 0, 72, 530, 0, 0, 0, 0, 202,
- 0, 537, 3, 4, 5, 72, 7, 0, 0, 0,
- 8, 9, 0, 550, 0, 10, 0, 11, 12, 13,
- 14, 15, 16, 17, 0, 0, 185, 186, 20, 21,
- 22, 23, 24, 0, 0, 77, 0, 77, 0, 0,
- 0, 27, 0, 0, 30, 31, 174, 175, 34, 35,
- 176, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 0, 0, 72, 0, 72, 0, 0,
- 72, 0, 0, 585, 0, 586, 0, 0, 587, 0,
- 0, 49, 0, 0, 196, 51, 52, 197, 198, 54,
- 72, 0, 0, 72, 0, 0, 0, 0, 602, 0,
- 0, 603, 72, 199, 56, 0, 72, 0, 0, 339,
- 609, 0, 320, 0, 610, 0, 0, 0, 337, 338,
- 248, 202, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 202, 0, 202, 0, 0, 0, 0,
- 0, 0, 0, 0, 344, 0, 0, 0, 0, 344,
- 0, 0, 0, 353, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 72, 0, 72, 0, 0, 0, 0, 0, 639,
- 0, 640, 231, 0, 0, 0, 0, 0, 394, 397,
- 398, 399, 400, 401, 402, 403, 404, 405, 406, 407,
- 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
- 418, 419, 420, 421, 422, 0, 0, 202, 0, 0,
- 0, 0, 0, 439, 202, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 353, 0, 0, 0, 231,
- 0, 0, 353, 0, 0, 394, 0, 231, 0, 0,
- 0, 0, 0, 0, 0, 0, 202, 462, 465, 0,
- 0, 0, 484, 486, 0, 0, 0, 202, 492, 0,
- 0, 0, 0, 0, 353, 0, 344, 0, 0, 0,
- 499, 0, 0, 0, 0, 353, 0, 503, 0, 0,
- 0, 0, 0, 492, 0, 0, 202, 0, 0, 0,
- 0, 0, 0, 0, 0, 506, 0, 0, 178, 178,
- 0, 178, 178, 0, 353, 0, 0, 0, 201, 201,
- 201, 0, 0, 0, 0, 178, 0, 0, 0, 0,
- 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
- 278, 279, 280, 0, 0, 281, 282, 0, 202, 0,
- 341, 0, 0, 0, 202, 247, 0, 0, 283, 526,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 0, 0, 0, 0, 0, 524, 524, 0, 201, 0,
- 0, 0, 0, 178, 0, 0, 0, 0, 0, 0,
- 558, 0, 541, 0, 541, 541, 0, 0, 0, 0,
- 0, 0, 0, 553, 0, 465, 565, 465, 0, 0,
- 0, 0, 569, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 344, 503, 0,
- 0, 202, 0, 0, 577, 202, 0, 579, 580, 202,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 353,
- 0, 0, 0, 353, 591, 0, 0, 353, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 503, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 503, 0, 0, 0, 0, 0, 0, 492, 0, 0,
- 0, 0, 0, 0, 615, 0, 0, 0, 0, 0,
- 201, 0, 0, 619, 344, 0, 0, 0, 344, 0,
- 0, 0, 201, 0, 201, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 632,
- 0, 0, 0, 637, 541, 541, 0, 0, 0, 541,
- 0, 320, 0, 0, 0, 0, 0, 0, 465, 0,
- 0, 0, 0, 0, 0, 178, 178, 178, 178, 178,
- 178, 0, 0, 0, 0, 0, 0, 393, 0, 0,
- 0, 0, 0, 0, 0, 0, 344, 541, 0, 465,
- 0, 0, 0, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 201, 0, 281, 282,
- 0, 0, 0, 201, 0, 0, 0, 0, 0, 0,
- 0, 283, 178, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 201, 178, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 201, 0, 0, -377,
- 2, 0, 3, 4, 5, 6, 7, 0, 0, 0,
- 8, 9, 0, 0, 0, 10, 0, 11, 12, 13,
- 14, 15, 16, 17, 0, 201, 18, 19, 20, 21,
- 22, 23, 24, 0, 0, 25, 0, 0, 0, 0,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 201, 0, 0,
- 0, 49, 0, 201, 50, 51, 52, 53, 0, 54,
- 0, 0, 0, 178, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 55, 56, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, -377, -377, -307, 0, 0,
- 0, 0, 0, 0, 0, -307, -307, -307, 0, 0,
- 0, -307, -307, 0, -307, 0, 0, 0, 0, 0,
- 0, 0, 0, -274, 0, 0, 0, 0, 178, 0,
- 0, -307, -307, 0, -307, -307, -307, -307, 0, 0,
- 201, 0, 0, 0, 201, 0, 0, 0, 201, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, -307, -307, -307, 0, 0, -307, -307, -307, 0,
- -307, 0, 0, 0, 178, 0, 0, 0, -307, -307,
- 0, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, 0, -310, 0, 0, -307, -307, -307, -307, -307,
- -310, -310, -310, -307, -307, 0, -310, -310, 0, -310,
- 0, 0, 0, 0, 0, 0, 0, 0, -275, 0,
- 0, 0, 0, 0, 0, 0, -310, -310, 0, -310,
- -310, -310, -310, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, -310, -310, -310, 0,
- 0, -310, -310, -310, 0, -310, 0, 0, 0, 0,
- 0, 0, 0, -310, -310, 0, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, 0, -228, 0, 0,
- -310, -310, -310, -310, -310, -228, -228, -228, -310, -310,
- 0, -228, -228, 0, -228, 0, 0, 0, 0, 0,
- 0, 0, 0, -276, 0, 0, 0, 0, 0, 0,
- 0, -228, -228, 0, -228, -228, -228, -228, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, -228, -228, -228, 0, 0, -228, -228, -228, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, -228,
- 0, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, 0, 0, 0, 0, -228, -228, -228, 0, -228,
- 0, 0, 0, -228, -228, 2, 0, 3, 4, 5,
- 6, 7, -377, -377, -377, 8, 9, 0, 0, -377,
- 10, 0, 11, 12, 13, 14, 15, 16, 17, 0,
- 0, 18, 19, 20, 21, 22, 23, 24, 0, 0,
- 25, 0, 0, 0, 0, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 49, 0, 0, 50,
- 51, 52, 53, 0, 54, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 55, 56,
- 0, 0, 0, 2, 0, 3, 4, 5, 6, 7,
- -377, -377, -377, 8, 9, 0, -377, -377, 10, 0,
- 11, 12, 13, 14, 15, 16, 17, 0, 0, 18,
- 19, 20, 21, 22, 23, 24, 0, 0, 25, 0,
- 0, 0, 0, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 49, 0, 0, 50, 51, 52,
- 53, 0, 54, 0, 2, 0, 3, 4, 5, 6,
- 7, 0, 0, -377, 8, 9, 55, 56, -377, 10,
- -377, 11, 12, 13, 14, 15, 16, 17, -377, -377,
- 18, 19, 20, 21, 22, 23, 24, 0, 0, 25,
- 0, 0, 0, 0, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 50, 51,
- 52, 53, 0, 54, 0, 2, 0, 3, 4, 5,
- 6, 7, 0, 0, -377, 8, 9, 55, 56, -377,
- 10, 0, 11, 12, 13, 14, 15, 16, 17, -377,
- -377, 18, 19, 20, 21, 22, 23, 24, 0, 0,
- 25, 0, 0, 0, 0, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 49, 0, 0, 50,
- 51, 52, 53, 0, 54, 0, 2, 0, 3, 4,
- 5, 6, 7, 0, -377, -377, 8, 9, 55, 56,
- 0, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- -377, -377, 18, 19, 20, 21, 22, 23, 24, 0,
- 0, 25, 0, 0, 0, 0, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 50, 51, 52, 53, 0, 54, 0, 2, 0, 3,
- 4, 5, 6, 7, 0, 0, 0, 8, 9, 55,
- 56, 0, 10, -377, 11, 12, 13, 14, 15, 16,
- 17, -377, -377, 18, 19, 20, 21, 22, 23, 24,
- 0, 0, 25, 0, 0, 0, 0, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 49, 0,
- 0, 50, 51, 52, 53, 0, 54, 0, 2, 0,
- 3, 4, 5, 6, 7, 0, 0, 0, 8, 9,
- 55, 56, 0, 10, 0, 11, 12, 13, 14, 15,
- 16, 17, -377, -377, 18, 19, 20, 21, 22, 23,
- 24, 0, 0, 25, 0, 0, 0, 0, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
- 0, 0, 227, 51, 52, 53, 0, 54, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 55, 56, 0, 0, 0, 2, -377, 3, 4,
- 5, 6, 7, -377, -377, 0, 8, 9, 0, 0,
- 0, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 0, 0, 18, 19, 20, 21, 22, 23, 24, 0,
- 0, 25, 0, 0, 0, 0, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 50, 51, 52, 53, 0, 54, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 55,
- 56, 0, 0, 0, 2, -377, 3, 4, 5, 6,
- 7, -377, -377, 0, 8, 9, 0, 0, 0, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 18, 19, 20, 21, 22, 23, 24, 0, 0, 25,
- 0, 0, 0, 0, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 50, 51,
- 52, 53, 0, 54, 0, 2, 0, 3, 4, 5,
- 6, 7, 0, 0, -377, 8, 9, 55, 56, 0,
- 10, -377, 11, 12, 13, 14, 15, 16, 17, -377,
- -377, 18, 19, 20, 21, 22, 23, 24, 0, 0,
- 25, 0, 0, 0, 0, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 49, 0, 0, 50,
- 51, 52, 53, 0, 54, 0, 0, 0, 3, 4,
- 5, 6, 7, 0, 0, 0, 8, 9, 55, 56,
- 0, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- -377, -377, 18, 19, 20, 21, 22, 23, 24, 0,
- 0, 25, 0, 0, 0, 0, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 50, 51, 52, 53, 0, 54, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 55,
- 56, 0, 0, 86, 87, 88, 89, 90, 91, 92,
- 93, 0, 376, 94, 95, 96, 97, 98, 0, 0,
- 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, 125, 126, 127, 34,
- 35, 128, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 129, 130, 131, 132, 133, 134, 0, 135,
- 136, 0, 0, 137, 0, 138, 0, 139, 140, 141,
- 142, 0, 0, 0, 0, 0, 0, 0, 143, 0,
- 0, 0, 0, 0, 144, 145, 146, 147, 148, 149,
- 150, 151, 152, 153, 0, 154, 0, 0, 3, 4,
- 5, 0, 7, 0, 155, 156, 8, 9, 0, 0,
- 0, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 0, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, -354, -354,
- -354, 0, -354, 0, 0, 0, -354, -354, 0, 199,
- 56, -354, 299, -354, -354, -354, -354, -354, -354, -354,
- 303, 0, -354, -354, -354, -354, -354, -354, -354, 0,
- 0, 0, 0, 0, 0, 0, 0, -354, 0, 0,
- -354, -354, -354, -354, -354, -354, -354, -354, -354, -354,
- -354, -354, -354, -354, -354, -354, -354, -354, -354, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -354, 0, 0,
- -354, -354, -354, -354, -354, -354, 0, 0, -356, -356,
- -356, 0, -356, 0, 0, 0, -356, -356, 0, -354,
- -354, -356, -354, -356, -356, -356, -356, -356, -356, -356,
- -354, 0, -356, -356, -356, -356, -356, -356, -356, 0,
- 0, 0, 0, 0, 0, 0, 0, -356, 0, 0,
- -356, -356, -356, -356, -356, -356, -356, -356, -356, -356,
- -356, -356, -356, -356, -356, -356, -356, -356, -356, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -356, 0, 0,
- -356, -356, -356, -356, -356, -356, 0, 0, -355, -355,
- -355, 0, -355, 0, 0, 0, -355, -355, 0, -356,
- -356, -355, -356, -355, -355, -355, -355, -355, -355, -355,
- -356, 0, -355, -355, -355, -355, -355, -355, -355, 0,
- 0, 0, 0, 0, 0, 0, 0, -355, 0, 0,
- -355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
- -355, -355, -355, -355, -355, -355, -355, -355, -355, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -355, 0, 0,
- -355, -355, -355, -355, -355, -355, 0, 0, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, -355,
- -355, 10, -355, 11, 12, 13, 14, 15, 16, 17,
- -355, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, 199,
- 56, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 200, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, 199,
- 56, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 212, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, -357, -357,
- -357, 0, -357, 0, 0, 0, -357, -357, 0, 199,
- 56, -357, 0, -357, -357, -357, -357, -357, -357, -357,
- 214, 0, -357, -357, -357, -357, -357, -357, -357, 0,
- 0, 0, 0, 0, 0, 0, 0, -357, 0, 0,
- -357, -357, -357, -357, -357, -357, -357, -357, -357, -357,
- -357, -357, -357, -357, -357, -357, -357, -357, -357, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -357, 0, 0,
- -357, -357, -357, -357, -357, -357, 0, 0, -359, -359,
- -359, 0, -359, 0, 0, 0, -359, -359, 0, -357,
- -357, -359, 0, -359, -359, -359, -359, -359, -359, -359,
- -357, 0, -359, -359, -359, -359, -359, -359, -359, 0,
- 0, 0, 0, 0, 0, 0, 0, -359, 0, 0,
- -359, -359, -359, -359, -359, -359, -359, -359, -359, -359,
- -359, -359, -359, -359, -359, -359, -359, -359, -359, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -359, 0, 0,
- -359, -359, -359, -359, -359, -359, 0, 0, -358, -358,
- -358, 0, -358, 0, 0, 0, -358, -358, 0, -359,
- -359, -358, 0, -358, -358, -358, -358, -358, -358, -358,
- -359, 0, -358, -358, -358, -358, -358, -358, -358, 0,
- 0, 0, 0, 0, 0, 0, 0, -358, 0, 0,
- -358, -358, -358, -358, -358, -358, -358, -358, -358, -358,
- -358, -358, -358, -358, -358, -358, -358, -358, -358, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -358, 0, 0,
- -358, -358, -358, -358, -358, -358, 0, 0, -360, -360,
- -360, 0, -360, 0, 0, 0, -360, -360, 0, -358,
- -358, -360, 0, -360, -360, -360, -360, -360, -360, -360,
- -358, 0, -360, -360, -360, -360, -360, -360, -360, 0,
- 0, 0, 0, 0, 0, 0, 0, -360, 0, 0,
- -360, -360, -360, -360, -360, -360, -360, -360, -360, -360,
- -360, -360, -360, -360, -360, -360, -360, -360, -360, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -360, 0, 0,
- -360, -360, -360, -360, -360, -360, 0, 0, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, -360,
- -360, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- -360, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, 199,
- 56, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 514, 0, 185, 186, 20, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 0,
- 196, 51, 52, 197, 198, 54, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 199,
- 56, 86, 87, 88, 89, 90, 91, 92, 93, 0,
- 518, 94, 95, 96, 97, 98, 0, 0, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 163, 164,
- 165, 166, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 167, 168, 169, 127, 243, 244, 170,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 129, 130, 131, 132, 133, 134, 0, 135, 136, 0,
- 0, 137, 0, 138, 0, 139, 140, 141, 142, 0,
- 0, 0, 0, 0, 0, 0, 143, 0, 0, 0,
- 0, 0, 144, 145, 146, 147, 148, 149, 150, 151,
- 152, 153, 0, 154, 86, 87, 88, 89, 90, 91,
- 92, 93, 155, 0, 94, 95, 96, 97, 98, 0,
- 0, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 163, 164, 165, 166, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 123, 167, 168, 169, 127,
- 217, 0, 170, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 129, 130, 131, 132, 133, 134, 0,
- 135, 136, 0, 0, 137, 0, 138, 0, 139, 140,
- 141, 142, 0, 0, 0, 0, 0, 0, 0, 143,
- 0, 0, 0, 0, 0, 144, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 0, 154, 86, 87, 88,
- 89, 90, 91, 92, 93, 155, 0, 94, 95, 96,
- 97, 98, 0, 0, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 163, 164, 165, 166, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 167,
- 168, 169, 127, 0, 0, 170, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 129, 130, 131, 132,
- 133, 134, 0, 135, 136, 0, 0, 137, 0, 138,
- 0, 139, 140, 141, 142, 0, 0, 0, 0, 0,
- 0, 0, 143, 0, 0, 0, 0, 0, 144, 145,
- 146, 147, 148, 149, 150, 151, 152, 153, 0, 154,
- 0, 3, 4, 5, 0, 7, 0, 0, 155, 8,
- 9, 0, 0, 0, 10, 0, 11, 12, 13, 14,
- 15, 16, 17, 0, 0, 185, 186, 20, 21, 22,
- 23, 24, 0, 0, 0, 0, 0, 0, 0, 0,
- 27, 0, 0, 30, 31, 174, 175, 34, 35, 176,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 49, 0, 0, 196, 51, 52, 197, 198, 54, 0,
- 0, 0, 0, 0, 0, 0, 3, 4, 5, 6,
- 7, 0, 199, 56, 8, 9, 0, 0, 349, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 18, 19, 20, 21, 22, 23, 24, 0, 0, 25,
- 0, 0, 0, 0, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 50, 51,
- 52, 53, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 55, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 18, 19, 20, 21, 22, 23, 24, 0, 0, 25,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 50, 51,
- 52, 53, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 55, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 20, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 197, 198, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 485, 198, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 491, 198, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 612, 198, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 384, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 469, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 573, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 608, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 0, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 20, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 0, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 20, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 27, 0, 0, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 196, 51,
- 52, 0, 0, 54, 0, 0, 3, 4, 5, 0,
- 7, 0, 0, 0, 8, 9, 0, 199, 56, 10,
- 0, 11, 12, 13, 14, 15, 16, 17, 0, 0,
- 185, 186, 187, 21, 22, 23, 24, 0, 0, 0,
- 0, 0, 0, 0, 0, 188, 0, 0, 30, 31,
- 174, 175, 34, 35, 176, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 49, 0, 0, 50, 51,
- 52, 53, 0, 54, 3, 4, 5, 0, 7, 583,
- 0, 0, 8, 9, 0, 0, 0, 10, 0, 11,
- 12, 13, 14, 15, 16, 17, 0, 0, 185, 186,
- 187, 21, 22, 23, 24, 0, 0, 0, 0, 0,
- 0, 0, 0, 188, 0, 0, 30, 31, 174, 175,
- 34, 35, 176, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 49, 0, 0, 50, 51, 52, 53,
- 0, 54, 3, 4, 5, 0, 7, 0, 0, 0,
- 8, 9, 0, 0, 0, 10, 0, 11, 12, 13,
- 14, 15, 16, 17, 0, 0, 185, 186, 187, 21,
- 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,
- 0, 188, 0, 0, 30, 31, 174, 175, 34, 35,
- 176, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 49, 0, 0, 263, 51, 52, 264, 0, 54,
- 3, 4, 5, 0, 7, 0, 0, 0, 8, 9,
- 0, 0, 0, 10, 0, 11, 12, 13, 14, 15,
- 16, 17, 0, 0, 185, 186, 187, 21, 22, 23,
- 24, 0, 0, 0, 0, 0, 0, 0, 0, 188,
- 0, 0, 30, 31, 174, 175, 34, 35, 176, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
- 0, 0, 263, 51, 52, 511, 0, 54, 3, 4,
- 5, 0, 7, 0, 0, 0, 8, 9, 0, 0,
- 0, 10, 0, 11, 12, 13, 14, 15, 16, 17,
- 0, 0, 185, 186, 187, 21, 22, 23, 24, 0,
- 0, 0, 0, 0, 0, 0, 0, 188, 0, 0,
- 30, 31, 174, 175, 34, 35, 176, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 423, 424, 0, 0, 425, 0, 49, 0, 0,
- 196, 51, 52, 0, 0, 54, 129, 130, 131, 132,
- 133, 134, 0, 135, 136, 0, 0, 137, 0, 138,
- 0, 139, 140, 141, 142, 0, 0, 0, 0, 0,
- 0, 0, 143, 0, 0, 0, 0, 0, 144, 145,
- 146, 147, 148, 149, 150, 151, 152, 153, 0, 154,
- 429, 430, 0, 0, 431, 0, 0, 0, 155, 0,
- 0, 0, 0, 0, 0, 129, 130, 131, 132, 133,
- 134, 0, 135, 136, 0, 0, 137, 0, 138, 0,
- 139, 140, 141, 142, 0, 0, 0, 0, 0, 0,
- 0, 143, 0, 0, 0, 0, 0, 144, 145, 146,
- 147, 148, 149, 150, 151, 152, 153, 0, 154, 476,
- 430, 0, 0, 477, 0, 0, 0, 155, 0, 0,
- 0, 0, 0, 0, 129, 130, 131, 132, 133, 134,
- 0, 135, 136, 0, 0, 137, 0, 138, 0, 139,
- 140, 141, 142, 0, 0, 0, 0, 0, 0, 0,
- 143, 0, 0, 0, 0, 0, 144, 145, 146, 147,
- 148, 149, 150, 151, 152, 153, 0, 154, 489, 430,
- 0, 0, 431, 0, 0, 0, 155, 0, 0, 0,
- 0, 0, 0, 129, 130, 131, 132, 133, 134, 0,
- 135, 136, 0, 0, 137, 0, 138, 0, 139, 140,
- 141, 142, 0, 0, 0, 0, 0, 0, 0, 143,
- 0, 0, 0, 0, 0, 144, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 0, 154, 504, 430, 0,
- 0, 477, 0, 0, 0, 155, 0, 0, 0, 0,
- 0, 0, 129, 130, 131, 132, 133, 134, 0, 135,
- 136, 0, 0, 137, 0, 138, 0, 139, 140, 141,
- 142, 0, 0, 0, 0, 0, 0, 0, 143, 0,
- 0, 0, 0, 0, 144, 145, 146, 147, 148, 149,
- 150, 151, 152, 153, 0, 154, 574, 430, 0, 0,
- 477, 0, 0, 0, 155, 0, 0, 0, 0, 0,
- 0, 129, 130, 131, 132, 133, 134, 0, 135, 136,
- 0, 0, 137, 0, 138, 0, 139, 140, 141, 142,
- 0, 0, 0, 0, 0, 0, 0, 143, 0, 0,
- 0, 0, 0, 144, 145, 146, 147, 148, 149, 150,
- 151, 152, 153, 0, 154, 0, 0, 0, 0, 0,
- 0, 0, 0, 155, 268, 269, 270, 271, 272, 273,
- 274, 275, 276, 277, 278, 279, 280, 0, 0, 281,
- 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 283, 513, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 268, 269, 270, 271, 272, 273,
- 274, 275, 276, 277, 278,-32768,-32768, 0, 0, 281,
- 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 268, 269, 270, 271, 272, 273,
- 274, 275, 0, 277, 278, 0, 0, 0, 0, 281,
- 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 268,-32768,-32768,-32768,-32768, 273,
- 274, 0, 0,-32768,-32768, 0, 0, 0, 0, 281,
- 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 268, 269, 270, 271, 272, 273,
- 274, 0, 0, 277, 278, 0, 0, 0, 0, 281,
- 282, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293
-};
-
-static const short yycheck[] = { 1,
- 2, 13, 210, 65, 347, 7, 8, 9, 10, 11,
- 12, 13, 181, 319, 2, 52, 18, 19, 20, 6,
- 188, 184, 50, 25, 58, 18, 19, 20, 313, 372,
- 13, 214, 51, 52, 19, 342, 78, 13, 335, 26,
- 347, 455, 456, 1, 539, 34, 35, 542, 50, 346,
- 84, 53, 25, 55, 26, 81, 294, 295, 34, 35,
- 542, 26, 116, 65, 4, 72, 111, 54, 25, 34,
- 35, 116, 47, 34, 35, 25, 78, 25, 375, 26,
- 47, 83, 111, 109, 47, 78, 112, 116, 47, 96,
- 34, 35, 51, 1, 2, 333, 334, 107, 25, 7,
- 8, 9, 10, 11, 12, 115, 15, 345, 17, 49,
- 18, 19, 20, 88, 89, 8, 9, 25, 11, 12,
- 303, 88, 89, 96, 362, 88, 89, 116, 117, 337,
- 625, 91, 25, 116, 117, 47, 374, 95, 111, 96,
- 116, 117, 50, 625, 116, 117, 96, 55, 96, 183,
- 184, 116, 117, 195, 111, 116, 227, 26, 116, 117,
- 107, 111, 468, 111, 91, 450, 110, 294, 295, 96,
- 78, 235, 83, 237, 481, 83, 88, 89, 107, 83,
- 91, 595, 596, 110, 352, 47, 600, 91, 83, 51,
- 83, 111, 263, 64, 196, 91, 91, 26, 200, 227,
- 111, 64, 8, 115, 111, 81, 333, 200, 79, 80,
- 212, 91, 214, 510, 17, 200, 81, 79, 345, 212,
- 222, 107, 81, 566, 638, 227, 83, 212, 99, 100,
- 101, 102, 103, 109, 91, 263, 99, 100, 101, 102,
- 103, 83, 261, 115, 109, 34, 35, 112, 64, 91,
- 109, 81, 254, 255, 256, 257, 258, 259, 260, 566,
- 115, 263, 264, 79, 80, 267, 254, 81, 83, 111,
- 115, 509, 306, 307, 64, 25, 91, 111, 446, 109,
- 488, 83, 98, 99, 100, 101, 102, 103, 196, 91,
- 81, 111, 200, 115, 296, 109, 111, 460, 112, 318,
- 81, 303, 471, 609, 212, 342, 214, 326, 81, 311,
- 312, 101, 102, 103, 222, 107, 601, 480, 109, 227,
- 322, 112, 64, 325, 110, 81, 49, 329, 109, 331,
- 392, 514, 83, 335, 336, 518, 109, 60, 61, 112,
- 91, 116, 117, 81, 346, 110, 254, 255, 256, 257,
- 258, 259, 260, 109, 81, 263, 112, 565, 360, 267,
- 111, 569, 255, 256, 257, 258, 259, 260, 536, 107,
- 357, 109, 81, 375, 112, 14, 15, 115, 81, 81,
- 81, 110, 109, 81, 81, 112, 108, 81, 296, 113,
- 392, 37, 38, 39, 40, 303, 110, 111, 111, 15,
- 109, 13, 10, 311, 312, 110, 109, 109, 109, 112,
- 112, 109, 109, 108, 322, 109, 83, 325, 452, 312,
- 110, 329, 110, 331, 110, 427, 460, 335, 336, 637,
- 111, 433, 111, 110, 427, 113, 605, 110, 346, 10,
- 433, 443, 444, 336, 91, 47, 480, 47, 111, 451,
- 111, 111, 360, 1, 2, 111, 9, 111, 10, 7,
- 10, 463, 10, 115, 115, 13, 89, 375, 113, 111,
- 113, 458, 459, 108, 10, 1, 2, 113, 110, 5,
- 10, 7, 8, 9, 10, 11, 12, 13, 89, 10,
- 10, 10, 113, 110, 108, 529, 498, 110, 96, 25,
- 10, 10, 50, 110, 10, 111, 10, 0, 510, 511,
- 522, 0, 514, 53, 640, 437, 518, 522, 267, 427,
- 522, 523, 609, 525, 50, 433, 528, 53, 602, 5,
- 539, 601, 450, -1, -1, 443, 444, -1, -1, 65,
- -1, -1, -1, 451, -1, -1, 548, -1, 64, 551,
- 443, -1, 554, -1, -1, 463, -1, 83, 560, -1,
- -1, -1, 564, 79, 80, -1, -1, 1, 2, -1,
- -1, -1, -1, 7, 8, 9, 10, 11, 12, 13,
- 96, 97, 98, 99, 100, 101, 102, 103, -1, -1,
- 498, 25, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 510, -1, -1, 498, 514, -1, -1, -1,
- 518, -1, -1, -1, -1, 523, 50, 525, -1, 53,
- 528, -1, -1, -1, -1, -1, -1, 629, -1, 631,
- -1, 65, -1, -1, -1, -1, -1, -1, -1, -1,
- 548, -1, -1, 551, -1, -1, 554, -1, 196, 83,
- -1, -1, 560, -1, -1, -1, 564, -1, -1, -1,
- -1, 554, -1, -1, -1, -1, -1, -1, -1, -1,
- 196, -1, -1, -1, 222, -1, -1, -1, -1, 227,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 222, -1, -1, -1,
- -1, 227, -1, 1, 2, -1, 254, -1, -1, 7,
- -1, 1, 10, -1, -1, 263, 264, 7, -1, -1,
- 10, 629, -1, 631, -1, -1, -1, -1, 254, 255,
- 256, 257, 258, 259, 260, -1, -1, 263, 264, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 196, 311, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 322, -1, -1, 325, -1, -1,
- -1, 329, -1, 331, -1, 311, 312, -1, 222, -1,
- -1, -1, -1, 227, -1, -1, 322, -1, -1, 325,
- -1, -1, -1, 329, -1, 331, -1, -1, -1, -1,
- 336, -1, 360, -1, -1, -1, -1, -1, -1, -1,
- 254, 255, 256, 257, 258, 259, 260, -1, -1, 263,
- 264, -1, -1, -1, 360, -1, -1, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- -1, -1, 79, 80, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 92, 392, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 311, 312, -1,
- -1, -1, -1, -1, 111, -1, -1, -1, 322, -1,
- -1, 325, -1, -1, -1, 329, 444, 331, 196, -1,
- -1, -1, 336, 451, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 463, -1, 443, 444, -1,
- -1, -1, -1, -1, 222, 451, 360, -1, -1, 227,
- -1, -1, 222, -1, -1, -1, -1, 463, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 254, -1, 392, -1,
- -1, -1, -1, 511, -1, 263, -1, -1, -1, 267,
- -1, -1, 498, -1, 522, 523, -1, 525, -1, -1,
- 528, -1, -1, -1, -1, 511, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 522, 523, -1, 525,
- 548, -1, 528, 551, -1, -1, -1, -1, -1, 443,
- 444, -1, 560, 311, -1, -1, 564, 451, -1, -1,
- -1, 311, 548, -1, 322, 551, -1, 325, 554, 463,
- -1, 329, 322, 331, 560, 325, -1, -1, 564, 329,
- -1, 331, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 360, -1, 498, -1, -1, -1, -1, -1,
- 360, -1, -1, -1, -1, -1, -1, 511, -1, -1,
- -1, 629, -1, 631, -1, -1, -1, -1, 522, 523,
- -1, 525, -1, -1, 528, -1, -1, -1, -1, 18,
- 19, 20, -1, 629, -1, 631, -1, -1, -1, -1,
- -1, -1, -1, -1, 548, -1, -1, 551, -1, -1,
- 554, -1, -1, -1, -1, -1, 560, -1, 47, 48,
- 564, -1, 51, 52, -1, -1, 55, 56, -1, -1,
- -1, -1, -1, -1, -1, -1, 444, -1, -1, -1,
- 51, 52, -1, 451, 444, -1, -1, -1, -1, 78,
- -1, 451, 3, 4, 5, 463, 7, -1, -1, -1,
- 11, 12, -1, 463, -1, 16, -1, 18, 19, 20,
- 21, 22, 23, 24, -1, -1, 27, 28, 29, 30,
- 31, 32, 33, -1, -1, 629, -1, 631, -1, -1,
- -1, 42, -1, -1, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, -1, -1, 523, -1, 525, -1, -1,
- 528, -1, -1, 523, -1, 525, -1, -1, 528, -1,
- -1, 82, -1, -1, 85, 86, 87, 88, 89, 90,
- 548, -1, -1, 551, -1, -1, -1, -1, 548, -1,
- -1, 551, 560, 104, 105, -1, 564, -1, -1, 110,
- 560, -1, 173, -1, 564, -1, -1, -1, 197, 198,
- 199, 200, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 212, -1, 214, -1, -1, -1, -1,
- -1, -1, -1, -1, 205, -1, -1, -1, -1, 210,
- -1, -1, -1, 214, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 629, -1, 631, -1, -1, -1, -1, -1, 629,
- -1, 631, 261, -1, -1, -1, -1, -1, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
- 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
- 289, 290, 291, 292, 293, -1, -1, 296, -1, -1,
- -1, -1, -1, 302, 303, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 296, -1, -1, -1, 318,
- -1, -1, 303, -1, -1, 324, -1, 326, -1, -1,
- -1, -1, -1, -1, -1, -1, 335, 318, 319, -1,
- -1, -1, 341, 342, -1, -1, -1, 346, 347, -1,
- -1, -1, -1, -1, 335, -1, 337, -1, -1, -1,
- 359, -1, -1, -1, -1, 346, -1, 366, -1, -1,
- -1, -1, -1, 372, -1, -1, 375, -1, -1, -1,
- -1, -1, -1, -1, -1, 384, -1, -1, 8, 9,
- -1, 11, 12, -1, 375, -1, -1, -1, 18, 19,
- 20, -1, -1, -1, -1, 25, -1, -1, -1, -1,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, -1, -1, 79, 80, -1, 427, -1,
- 84, -1, -1, -1, 433, 55, -1, -1, 92, 438,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- -1, -1, -1, -1, -1, 436, 437, -1, 78, -1,
- -1, -1, -1, 83, -1, -1, -1, -1, -1, -1,
- 469, -1, 453, -1, 455, 456, -1, -1, -1, -1,
- -1, -1, -1, 464, -1, 466, 485, 468, -1, -1,
- -1, -1, 491, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 488, 507, -1,
- -1, 510, -1, -1, 513, 514, -1, 516, 517, 518,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 510,
- -1, -1, -1, 514, 533, -1, -1, 518, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 549, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 559, -1, -1, -1, -1, -1, -1, 566, -1, -1,
- -1, -1, -1, -1, 573, -1, -1, -1, -1, -1,
- 200, -1, -1, 582, 565, -1, -1, -1, 569, -1,
- -1, -1, 212, -1, 214, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 608,
- -1, -1, -1, 612, 595, 596, -1, -1, -1, 600,
- -1, 602, -1, -1, -1, -1, -1, -1, 609, -1,
- -1, -1, -1, -1, -1, 255, 256, 257, 258, 259,
- 260, -1, -1, -1, -1, -1, -1, 267, -1, -1,
- -1, -1, -1, -1, -1, -1, 637, 638, -1, 640,
- -1, -1, -1, 64, 65, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 296, -1, 79, 80,
- -1, -1, -1, 303, -1, -1, -1, -1, -1, -1,
- -1, 92, 312, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 335, 336, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 346, -1, -1, 0,
- 1, -1, 3, 4, 5, 6, 7, -1, -1, -1,
- 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
- 21, 22, 23, 24, -1, 375, 27, 28, 29, 30,
- 31, 32, 33, -1, -1, 36, -1, -1, -1, -1,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 427, -1, -1,
- -1, 82, -1, 433, 85, 86, 87, 88, -1, 90,
- -1, -1, -1, 443, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 104, 105, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 116, 117, 0, -1, -1,
- -1, -1, -1, -1, -1, 8, 9, 10, -1, -1,
- -1, 14, 15, -1, 17, -1, -1, -1, -1, -1,
- -1, -1, -1, 26, -1, -1, -1, -1, 498, -1,
- -1, 34, 35, -1, 37, 38, 39, 40, -1, -1,
- 510, -1, -1, -1, 514, -1, -1, -1, 518, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, -1, -1, 79, 80, 81, -1,
- 83, -1, -1, -1, 554, -1, -1, -1, 91, 92,
- -1, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, -1, 0, -1, -1, 108, 109, 110, 111, 112,
- 8, 9, 10, 116, 117, -1, 14, 15, -1, 17,
- -1, -1, -1, -1, -1, -1, -1, -1, 26, -1,
- -1, -1, -1, -1, -1, -1, 34, 35, -1, 37,
- 38, 39, 40, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, -1,
- -1, 79, 80, 81, -1, 83, -1, -1, -1, -1,
- -1, -1, -1, 91, 92, -1, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, -1, 0, -1, -1,
- 108, 109, 110, 111, 112, 8, 9, 10, 116, 117,
- -1, 14, 15, -1, 17, -1, -1, -1, -1, -1,
- -1, -1, -1, 26, -1, -1, -1, -1, -1, -1,
- -1, 34, 35, -1, 37, 38, 39, 40, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, -1, -1, 79, 80, 81, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
- -1, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, -1, -1, -1, -1, 108, 109, 110, -1, 112,
- -1, -1, -1, 116, 117, 1, -1, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, -1, -1, 15,
- 16, -1, 18, 19, 20, 21, 22, 23, 24, -1,
- -1, 27, 28, 29, 30, 31, 32, 33, -1, -1,
- 36, -1, -1, -1, -1, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 82, -1, -1, 85,
- 86, 87, 88, -1, 90, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 104, 105,
- -1, -1, -1, 1, -1, 3, 4, 5, 6, 7,
- 116, 117, 10, 11, 12, -1, 14, 15, 16, -1,
- 18, 19, 20, 21, 22, 23, 24, -1, -1, 27,
- 28, 29, 30, 31, 32, 33, -1, -1, 36, -1,
- -1, -1, -1, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 82, -1, -1, 85, 86, 87,
- 88, -1, 90, -1, 1, -1, 3, 4, 5, 6,
- 7, -1, -1, 10, 11, 12, 104, 105, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 116, 117,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, 36,
- -1, -1, -1, -1, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, 1, -1, 3, 4, 5,
- 6, 7, -1, -1, 10, 11, 12, 104, 105, 15,
- 16, -1, 18, 19, 20, 21, 22, 23, 24, 116,
- 117, 27, 28, 29, 30, 31, 32, 33, -1, -1,
- 36, -1, -1, -1, -1, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 82, -1, -1, 85,
- 86, 87, 88, -1, 90, -1, 1, -1, 3, 4,
- 5, 6, 7, -1, 9, 10, 11, 12, 104, 105,
- -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 116, 117, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, 36, -1, -1, -1, -1, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, -1, 90, -1, 1, -1, 3,
- 4, 5, 6, 7, -1, -1, -1, 11, 12, 104,
- 105, -1, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 116, 117, 27, 28, 29, 30, 31, 32, 33,
- -1, -1, 36, -1, -1, -1, -1, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 82, -1,
- -1, 85, 86, 87, 88, -1, 90, -1, 1, -1,
- 3, 4, 5, 6, 7, -1, -1, -1, 11, 12,
- 104, 105, -1, 16, -1, 18, 19, 20, 21, 22,
- 23, 24, 116, 117, 27, 28, 29, 30, 31, 32,
- 33, -1, -1, 36, -1, -1, -1, -1, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 82,
- -1, -1, 85, 86, 87, 88, -1, 90, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 104, 105, -1, -1, -1, 1, 110, 3, 4,
- 5, 6, 7, 116, 117, -1, 11, 12, -1, -1,
- -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- -1, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, 36, -1, -1, -1, -1, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, -1, 90, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
- 105, -1, -1, -1, 1, 110, 3, 4, 5, 6,
- 7, 116, 117, -1, 11, 12, -1, -1, -1, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, 36,
- -1, -1, -1, -1, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, 1, -1, 3, 4, 5,
- 6, 7, -1, -1, 10, 11, 12, 104, 105, -1,
- 16, 108, 18, 19, 20, 21, 22, 23, 24, 116,
- 117, 27, 28, 29, 30, 31, 32, 33, -1, -1,
- 36, -1, -1, -1, -1, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 82, -1, -1, 85,
- 86, 87, 88, -1, 90, -1, -1, -1, 3, 4,
- 5, 6, 7, -1, -1, -1, 11, 12, 104, 105,
- -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 116, 117, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, 36, -1, -1, -1, -1, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, -1, 90, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
- 105, -1, -1, 3, 4, 5, 6, 7, 8, 9,
- 10, -1, 117, 13, 14, 15, 16, 17, -1, -1,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 62, 63, 64, 65, 66, 67, -1, 69,
- 70, -1, -1, 73, -1, 75, -1, 77, 78, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, 88, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, -1, 105, -1, -1, 3, 4,
- 5, -1, 7, -1, 114, 115, 11, 12, -1, -1,
- -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- -1, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, 107, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, 107, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, 107, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, 107, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, 104,
- 105, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 115, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 82, -1, -1,
- 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
- 105, 3, 4, 5, 6, 7, 8, 9, 10, -1,
- 115, 13, 14, 15, 16, 17, -1, -1, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 62, 63, 64, 65, 66, 67, -1, 69, 70, -1,
- -1, 73, -1, 75, -1, 77, 78, 79, 80, -1,
- -1, -1, -1, -1, -1, -1, 88, -1, -1, -1,
- -1, -1, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, -1, 105, 3, 4, 5, 6, 7, 8,
- 9, 10, 114, -1, 13, 14, 15, 16, 17, -1,
- -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, -1, 51, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 62, 63, 64, 65, 66, 67, -1,
- 69, 70, -1, -1, 73, -1, 75, -1, 77, 78,
- 79, 80, -1, -1, -1, -1, -1, -1, -1, 88,
- -1, -1, -1, -1, -1, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, -1, 105, 3, 4, 5,
- 6, 7, 8, 9, 10, 114, -1, 13, 14, 15,
- 16, 17, -1, -1, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, -1, -1, 51, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 62, 63, 64, 65,
- 66, 67, -1, 69, 70, -1, -1, 73, -1, 75,
- -1, 77, 78, 79, 80, -1, -1, -1, -1, -1,
- -1, -1, 88, -1, -1, -1, -1, -1, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, -1, 105,
- -1, 3, 4, 5, -1, 7, -1, -1, 114, 11,
- 12, -1, -1, -1, 16, -1, 18, 19, 20, 21,
- 22, 23, 24, -1, -1, 27, 28, 29, 30, 31,
- 32, 33, -1, -1, -1, -1, -1, -1, -1, -1,
- 42, -1, -1, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 82, -1, -1, 85, 86, 87, 88, 89, 90, -1,
- -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
- 7, -1, 104, 105, 11, 12, -1, -1, 110, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, 36,
- -1, -1, -1, -1, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, 36,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, 89, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, 89, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, 89, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, 89, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, -1, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, -1, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, -1, -1, 90, -1, -1, 3, 4, 5, -1,
- 7, -1, -1, -1, 11, 12, -1, 104, 105, 16,
- -1, 18, 19, 20, 21, 22, 23, 24, -1, -1,
- 27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
- -1, -1, -1, -1, -1, 42, -1, -1, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 82, -1, -1, 85, 86,
- 87, 88, -1, 90, 3, 4, 5, -1, 7, 96,
- -1, -1, 11, 12, -1, -1, -1, 16, -1, 18,
- 19, 20, 21, 22, 23, 24, -1, -1, 27, 28,
- 29, 30, 31, 32, 33, -1, -1, -1, -1, -1,
- -1, -1, -1, 42, -1, -1, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 82, -1, -1, 85, 86, 87, 88,
- -1, 90, 3, 4, 5, -1, 7, -1, -1, -1,
- 11, 12, -1, -1, -1, 16, -1, 18, 19, 20,
- 21, 22, 23, 24, -1, -1, 27, 28, 29, 30,
- 31, 32, 33, -1, -1, -1, -1, -1, -1, -1,
- -1, 42, -1, -1, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 82, -1, -1, 85, 86, 87, 88, -1, 90,
- 3, 4, 5, -1, 7, -1, -1, -1, 11, 12,
- -1, -1, -1, 16, -1, 18, 19, 20, 21, 22,
- 23, 24, -1, -1, 27, 28, 29, 30, 31, 32,
- 33, -1, -1, -1, -1, -1, -1, -1, -1, 42,
- -1, -1, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 82,
- -1, -1, 85, 86, 87, 88, -1, 90, 3, 4,
- 5, -1, 7, -1, -1, -1, 11, 12, -1, -1,
- -1, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- -1, -1, 27, 28, 29, 30, 31, 32, 33, -1,
- -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 47, 48, -1, -1, 51, -1, 82, -1, -1,
- 85, 86, 87, -1, -1, 90, 62, 63, 64, 65,
- 66, 67, -1, 69, 70, -1, -1, 73, -1, 75,
- -1, 77, 78, 79, 80, -1, -1, -1, -1, -1,
- -1, -1, 88, -1, -1, -1, -1, -1, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, -1, 105,
- 47, 48, -1, -1, 51, -1, -1, -1, 114, -1,
- -1, -1, -1, -1, -1, 62, 63, 64, 65, 66,
- 67, -1, 69, 70, -1, -1, 73, -1, 75, -1,
- 77, 78, 79, 80, -1, -1, -1, -1, -1, -1,
- -1, 88, -1, -1, -1, -1, -1, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, -1, 105, 47,
- 48, -1, -1, 51, -1, -1, -1, 114, -1, -1,
- -1, -1, -1, -1, 62, 63, 64, 65, 66, 67,
- -1, 69, 70, -1, -1, 73, -1, 75, -1, 77,
- 78, 79, 80, -1, -1, -1, -1, -1, -1, -1,
- 88, -1, -1, -1, -1, -1, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, -1, 105, 47, 48,
- -1, -1, 51, -1, -1, -1, 114, -1, -1, -1,
- -1, -1, -1, 62, 63, 64, 65, 66, 67, -1,
- 69, 70, -1, -1, 73, -1, 75, -1, 77, 78,
- 79, 80, -1, -1, -1, -1, -1, -1, -1, 88,
- -1, -1, -1, -1, -1, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, -1, 105, 47, 48, -1,
- -1, 51, -1, -1, -1, 114, -1, -1, -1, -1,
- -1, -1, 62, 63, 64, 65, 66, 67, -1, 69,
- 70, -1, -1, 73, -1, 75, -1, 77, 78, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, 88, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, -1, 105, 47, 48, -1, -1,
- 51, -1, -1, -1, 114, -1, -1, -1, -1, -1,
- -1, 62, 63, 64, 65, 66, 67, -1, 69, 70,
- -1, -1, 73, -1, 75, -1, 77, 78, 79, 80,
- -1, -1, -1, -1, -1, -1, -1, 88, -1, -1,
- -1, -1, -1, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, -1, 105, -1, -1, -1, -1, -1,
- -1, -1, -1, 114, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, -1, -1, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 92, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, -1, -1, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 64, 65, 66, 67, 68, 69,
- 70, 71, -1, 73, 74, -1, -1, -1, -1, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 64, 65, 66, 67, 68, 69,
- 70, -1, -1, 73, 74, -1, -1, -1, -1, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103, 64, 65, 66, 67, 68, 69,
- 70, -1, -1, 73, 74, -1, -1, -1, -1, 79,
- 80, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 103
-};
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/misc/bison.simple"
-/* This file comes from bison-1.25.90. */
-
-/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include <alloca.h>
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C. */
-/* This used to test MSDOS, but that is a bad idea
- since that symbol is in the user namespace. */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
- instead, just don't use alloca. */
-#include <malloc.h>
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
- So I turned it off. rms, 2 May 1997. */
-/* #include <malloc.h> */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
- and on HPUX 10. Eventually we can turn this on. */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
-#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-#define YYFAIL goto yyerrlab
-#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-#ifndef YYPURE
-#define YYLEX yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int yychar; /* the lookahead symbol */
-YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
-#endif
-
-int yynerrs; /* number of parse errors so far */
-#endif /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
-#endif
-
-/* YYINITDEPTH indicates the initial size of the parser's stacks */
-
-#ifndef YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy. Note that the size argument
- should be passed with type unsigned int, because that is what the non-GCC
- definitions require. With GCC, __builtin_memcpy takes an arg
- of type size_t, but it can handle unsigned int. */
-
-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
-#else /* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (to, from, count)
- char *to;
- char *from;
- unsigned int count;
-{
- register char *f = from;
- register char *t = to;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
- register char *t = to;
- register char *f = from;
- register int i = count;
-
- while (i-- > 0)
- *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 216 "/usr/share/misc/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
-{
- register int yystate;
- register int yyn;
- register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
-
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
-
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-
-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK (yyvsp--, yyssp--)
-#endif
-
- int yystacksize = YYINITDEPTH;
- int yyfree_stacks = 0;
-
-#ifdef YYPURE
- int yychar;
- YYSTYPE yylval;
- int yynerrs;
-#ifdef YYLSP_NEEDED
- YYLTYPE yylloc;
-#endif
-#endif
-
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
-
- int yylen;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
-#endif
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss - 1;
- yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
- yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in yystate . */
-/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
-yynewstate:
-
- *++yyssp = yystate;
-
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Give user a chance to reallocate the stack */
- /* Use copies of these so that the &'s don't force the real ones into memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
-#endif
-
- /* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
-#ifdef YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
-#else
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
-#endif
-
- yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
- yyls = yyls1;
-#endif
-#else /* no yyoverflow */
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 2;
- }
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
- yyfree_stacks = 1;
-#endif
- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1,
- size * (unsigned int) sizeof (*yyssp));
- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
- size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1,
- size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
- goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
- if (yychar == YYEMPTY)
- {
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
-#endif
- yychar = YYLEX;
- }
-
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
-#endif
- }
- else
- {
- yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise meaning
- of a token, for further debugging info. */
-#ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
-#endif
- fprintf (stderr, ")\n");
- }
-#endif
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
-
- yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-/* Do the default action for the current state. */
-yydefault:
-
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
-
-/* Do a reduction. yyn is the number of a rule to reduce with. */
-yyreduce:
- yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- int i;
-
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symbols being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
-
-
- switch (yyn) {
-
-case 1:
-#line 232 "parse.y"
-{
- yyval.vars = ruby_dyna_vars;
- lex_state = EXPR_BEG;
- top_local_init();
- NEW_CREF0(); /* initialize constant c-ref */
- if ((VALUE)ruby_class == rb_cObject) class_nest = 0;
- else class_nest = 1;
- ;
- break;}
-case 2:
-#line 241 "parse.y"
-{
- if (yyvsp[0].node && !compile_for_eval) {
- /* last expression should not be void */
- if (nd_type(yyvsp[0].node) != NODE_BLOCK) void_expr(yyvsp[0].node);
- else {
- NODE *node = yyvsp[0].node;
- while (node->nd_next) {
- node = node->nd_next;
- }
- void_expr(node->nd_head);
- }
- }
- ruby_eval_tree = block_append(ruby_eval_tree, yyvsp[0].node);
- top_local_setup();
- cur_cref = 0;
- class_nest = 0;
- ruby_dyna_vars = yyvsp[-1].vars;
- ;
- break;}
-case 3:
-#line 261 "parse.y"
-{
- void_stmts(yyvsp[-1].node);
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 5:
-#line 268 "parse.y"
-{
- yyval.node = newline_node(yyvsp[0].node);
- ;
- break;}
-case 6:
-#line 272 "parse.y"
-{
- yyval.node = block_append(yyvsp[-2].node, newline_node(yyvsp[0].node));
- ;
- break;}
-case 7:
-#line 276 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 9:
-#line 281 "parse.y"
-{lex_state = EXPR_FNAME;;
- break;}
-case 10:
-#line 282 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("alias within method");
- yyval.node = NEW_ALIAS(yyvsp[-2].id, yyvsp[0].id);
- ;
- break;}
-case 11:
-#line 288 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("alias within method");
- yyval.node = NEW_VALIAS(yyvsp[-1].id, yyvsp[0].id);
- ;
- break;}
-case 12:
-#line 294 "parse.y"
-{
- char buf[3];
-
- if (cur_mid || in_single)
- yyerror("alias within method");
- sprintf(buf, "$%c", yyvsp[0].node->nd_nth);
- yyval.node = NEW_VALIAS(yyvsp[-1].id, rb_intern(buf));
- ;
- break;}
-case 13:
-#line 303 "parse.y"
-{
- yyerror("can't make alias for the number variables");
- yyval.node = 0;
- ;
- break;}
-case 14:
-#line 308 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("undef within method");
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 15:
-#line 314 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_IF(cond(yyvsp[0].node), yyvsp[-2].node, 0);
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 16:
-#line 320 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_UNLESS(cond(yyvsp[0].node), yyvsp[-2].node, 0);
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 17:
-#line 326 "parse.y"
-{
- value_expr(yyvsp[0].node);
- if (nd_type(yyvsp[-2].node) == NODE_BEGIN) {
- yyval.node = NEW_WHILE(cond(yyvsp[0].node), yyvsp[-2].node->nd_body, 0);
- }
- else {
- yyval.node = NEW_WHILE(cond(yyvsp[0].node), yyvsp[-2].node, 1);
- }
- ;
- break;}
-case 18:
-#line 336 "parse.y"
-{
- value_expr(yyvsp[0].node);
- if (nd_type(yyvsp[-2].node) == NODE_BEGIN) {
- yyval.node = NEW_UNTIL(cond(yyvsp[0].node), yyvsp[-2].node->nd_body, 0);
- }
- else {
- yyval.node = NEW_UNTIL(cond(yyvsp[0].node), yyvsp[-2].node, 1);
- }
- ;
- break;}
-case 19:
-#line 346 "parse.y"
-{
- if (cur_mid || in_single) {
- yyerror("BEGIN in method");
- }
- local_push();
- ;
- break;}
-case 20:
-#line 353 "parse.y"
-{
- ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
- NEW_PREEXE(yyvsp[-1].node));
- local_pop();
- yyval.node = 0;
- ;
- break;}
-case 21:
-#line 360 "parse.y"
-{
- if (compile_for_eval && (cur_mid || in_single)) {
- yyerror("END in method; use at_exit");
- }
-
- yyval.node = NEW_ITER(0, NEW_POSTEXE(), yyvsp[-1].node);
- ;
- break;}
-case 22:
-#line 368 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = node_assign(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 24:
-#line 375 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyvsp[-2].node->nd_value = yyvsp[0].node;
- yyval.node = yyvsp[-2].node;
- ;
- break;}
-case 25:
-#line 381 "parse.y"
-{
- value_expr(yyvsp[0].node);
- if (!compile_for_eval && !cur_mid && !in_single)
- yyerror("return appeared outside of method");
- yyval.node = NEW_RETURN(yyvsp[0].node);
- ;
- break;}
-case 26:
-#line 388 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_YIELD(yyvsp[0].node);
- ;
- break;}
-case 28:
-#line 394 "parse.y"
-{
- yyval.node = logop(NODE_AND, yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 29:
-#line 398 "parse.y"
-{
- yyval.node = logop(NODE_OR, yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 30:
-#line 402 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_NOT(cond(yyvsp[0].node));
- ;
- break;}
-case 31:
-#line 407 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_NOT(cond(yyvsp[0].node));
- ;
- break;}
-case 33:
-#line 414 "parse.y"
-{
- yyval.node = new_fcall(yyvsp[-1].id, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 34:
-#line 419 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = new_call(yyvsp[-3].node, yyvsp[-1].id, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-3].node);
- ;
- break;}
-case 35:
-#line 425 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = new_call(yyvsp[-3].node, yyvsp[-1].id, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-3].node);
- ;
- break;}
-case 36:
-#line 431 "parse.y"
-{
- if (!compile_for_eval && !cur_mid && !in_single)
- yyerror("super called outside of method");
- yyval.node = NEW_SUPER(yyvsp[0].node);
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 38:
-#line 440 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 40:
-#line 446 "parse.y"
-{
- yyval.node = NEW_MASGN(NEW_LIST(yyvsp[-1].node), 0);
- ;
- break;}
-case 41:
-#line 451 "parse.y"
-{
- yyval.node = NEW_MASGN(NEW_LIST(yyvsp[0].node), 0);
- ;
- break;}
-case 42:
-#line 455 "parse.y"
-{
- yyval.node = NEW_MASGN(NEW_LIST(yyvsp[-2].node), yyvsp[0].node);
- ;
- break;}
-case 43:
-#line 459 "parse.y"
-{
- yyval.node = NEW_MASGN(NEW_LIST(yyvsp[-1].node), -1);
- ;
- break;}
-case 44:
-#line 463 "parse.y"
-{
- yyval.node = NEW_MASGN(list_concat(NEW_LIST(yyvsp[-1].node),yyvsp[0].node), 0);
- ;
- break;}
-case 45:
-#line 467 "parse.y"
-{
- yyval.node = NEW_MASGN(list_concat(NEW_LIST(yyvsp[-4].node),yyvsp[-3].node),yyvsp[0].node);
- ;
- break;}
-case 46:
-#line 471 "parse.y"
-{
- yyval.node = NEW_MASGN(list_concat(NEW_LIST(yyvsp[-3].node),yyvsp[-2].node),-1);
- ;
- break;}
-case 47:
-#line 475 "parse.y"
-{
- yyval.node = NEW_MASGN(0, yyvsp[0].node);
- ;
- break;}
-case 48:
-#line 479 "parse.y"
-{
- yyval.node = NEW_MASGN(0, -1);
- ;
- break;}
-case 50:
-#line 485 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 51:
-#line 490 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 52:
-#line 495 "parse.y"
-{
- yyval.node = NEW_LIST(yyvsp[0].node);
- ;
- break;}
-case 53:
-#line 499 "parse.y"
-{
- yyval.node = list_append(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 54:
-#line 504 "parse.y"
-{
- yyval.node = assignable(yyvsp[0].id, 0);
- ;
- break;}
-case 55:
-#line 508 "parse.y"
-{
- yyval.node = aryset(yyvsp[-3].node, yyvsp[-1].node);
- ;
- break;}
-case 56:
-#line 512 "parse.y"
-{
- yyval.node = attrset(yyvsp[-2].node, yyvsp[0].id);
- ;
- break;}
-case 57:
-#line 516 "parse.y"
-{
- rb_backref_error(yyvsp[0].node);
- yyval.node = 0;
- ;
- break;}
-case 58:
-#line 522 "parse.y"
-{
- yyval.node = assignable(yyvsp[0].id, 0);
- ;
- break;}
-case 59:
-#line 526 "parse.y"
-{
- yyval.node = aryset(yyvsp[-3].node, yyvsp[-1].node);
- ;
- break;}
-case 60:
-#line 530 "parse.y"
-{
- yyval.node = attrset(yyvsp[-2].node, yyvsp[0].id);
- ;
- break;}
-case 61:
-#line 534 "parse.y"
-{
- rb_backref_error(yyvsp[0].node);
- yyval.node = 0;
- ;
- break;}
-case 62:
-#line 540 "parse.y"
-{
- yyerror("class/module name must be CONSTANT");
- ;
- break;}
-case 67:
-#line 549 "parse.y"
-{
- lex_state = EXPR_END;
- yyval.id = yyvsp[0].id;
- ;
- break;}
-case 68:
-#line 554 "parse.y"
-{
- lex_state = EXPR_END;
- yyval.id = yyvsp[0].id;
- ;
- break;}
-case 69:
-#line 560 "parse.y"
-{
- yyval.node = NEW_UNDEF(yyvsp[0].id);
- ;
- break;}
-case 70:
-#line 563 "parse.y"
-{lex_state = EXPR_FNAME;;
- break;}
-case 71:
-#line 564 "parse.y"
-{
- yyval.node = block_append(yyvsp[-3].node, NEW_UNDEF(yyvsp[0].id));
- ;
- break;}
-case 72:
-#line 568 "parse.y"
-{ yyval.id = tDOT2; ;
- break;}
-case 73:
-#line 569 "parse.y"
-{ yyval.id = '|'; ;
- break;}
-case 74:
-#line 570 "parse.y"
-{ yyval.id = '^'; ;
- break;}
-case 75:
-#line 571 "parse.y"
-{ yyval.id = '&'; ;
- break;}
-case 76:
-#line 572 "parse.y"
-{ yyval.id = tCMP; ;
- break;}
-case 77:
-#line 573 "parse.y"
-{ yyval.id = tEQ; ;
- break;}
-case 78:
-#line 574 "parse.y"
-{ yyval.id = tEQQ; ;
- break;}
-case 79:
-#line 575 "parse.y"
-{ yyval.id = tMATCH; ;
- break;}
-case 80:
-#line 576 "parse.y"
-{ yyval.id = '>'; ;
- break;}
-case 81:
-#line 577 "parse.y"
-{ yyval.id = tGEQ; ;
- break;}
-case 82:
-#line 578 "parse.y"
-{ yyval.id = '<'; ;
- break;}
-case 83:
-#line 579 "parse.y"
-{ yyval.id = tLEQ; ;
- break;}
-case 84:
-#line 580 "parse.y"
-{ yyval.id = tLSHFT; ;
- break;}
-case 85:
-#line 581 "parse.y"
-{ yyval.id = tRSHFT; ;
- break;}
-case 86:
-#line 582 "parse.y"
-{ yyval.id = '+'; ;
- break;}
-case 87:
-#line 583 "parse.y"
-{ yyval.id = '-'; ;
- break;}
-case 88:
-#line 584 "parse.y"
-{ yyval.id = '*'; ;
- break;}
-case 89:
-#line 585 "parse.y"
-{ yyval.id = '*'; ;
- break;}
-case 90:
-#line 586 "parse.y"
-{ yyval.id = '/'; ;
- break;}
-case 91:
-#line 587 "parse.y"
-{ yyval.id = '%'; ;
- break;}
-case 92:
-#line 588 "parse.y"
-{ yyval.id = tPOW; ;
- break;}
-case 93:
-#line 589 "parse.y"
-{ yyval.id = '~'; ;
- break;}
-case 94:
-#line 590 "parse.y"
-{ yyval.id = tUPLUS; ;
- break;}
-case 95:
-#line 591 "parse.y"
-{ yyval.id = tUMINUS; ;
- break;}
-case 96:
-#line 592 "parse.y"
-{ yyval.id = tAREF; ;
- break;}
-case 97:
-#line 593 "parse.y"
-{ yyval.id = tASET; ;
- break;}
-case 98:
-#line 594 "parse.y"
-{ yyval.id = '`'; ;
- break;}
-case 139:
-#line 605 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = node_assign(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 140:
-#line 609 "parse.y"
-{yyval.node = assignable(yyvsp[-1].id, 0);;
- break;}
-case 141:
-#line 610 "parse.y"
-{
- if (yyvsp[-2].id == tOROP) {
- yyvsp[-1].node->nd_value = yyvsp[0].node;
- yyval.node = NEW_OP_ASGN_OR(gettable(yyvsp[-3].id), yyvsp[-1].node);
- }
- else if (yyvsp[-2].id == tANDOP) {
- yyvsp[-1].node->nd_value = yyvsp[0].node;
- yyval.node = NEW_OP_ASGN_AND(gettable(yyvsp[-3].id), yyvsp[-1].node);
- }
- else {
- yyval.node = yyvsp[-1].node;
- yyval.node->nd_value = call_op(gettable(yyvsp[-3].id), yyvsp[-2].id, 1, yyvsp[0].node);
- }
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 142:
-#line 626 "parse.y"
-{
- NODE *args = NEW_LIST(yyvsp[0].node);
-
- list_append(yyvsp[-3].node, NEW_NIL());
- list_concat(args, yyvsp[-3].node);
- if (yyvsp[-1].id == tOROP) {
- yyvsp[-1].id = 0;
- }
- else if (yyvsp[-1].id == tANDOP) {
- yyvsp[-1].id = 1;
- }
- yyval.node = NEW_OP_ASGN1(yyvsp[-5].node, yyvsp[-1].id, args);
- fixpos(yyval.node, yyvsp[-5].node);
- ;
- break;}
-case 143:
-#line 641 "parse.y"
-{
- if (yyvsp[-1].id == tOROP) {
- yyvsp[-1].id = 0;
- }
- else if (yyvsp[-1].id == tANDOP) {
- yyvsp[-1].id = 1;
- }
- yyval.node = NEW_OP_ASGN2(yyvsp[-4].node, yyvsp[-2].id, yyvsp[-1].id, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 144:
-#line 652 "parse.y"
-{
- if (yyvsp[-1].id == tOROP) {
- yyvsp[-1].id = 0;
- }
- else if (yyvsp[-1].id == tANDOP) {
- yyvsp[-1].id = 1;
- }
- yyval.node = NEW_OP_ASGN2(yyvsp[-4].node, yyvsp[-2].id, yyvsp[-1].id, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 145:
-#line 663 "parse.y"
-{
- rb_backref_error(yyvsp[-2].node);
- yyval.node = 0;
- ;
- break;}
-case 146:
-#line 668 "parse.y"
-{
- yyval.node = NEW_DOT2(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 147:
-#line 672 "parse.y"
-{
- yyval.node = NEW_DOT3(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 148:
-#line 676 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '+', 1, yyvsp[0].node);
- ;
- break;}
-case 149:
-#line 680 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '-', 1, yyvsp[0].node);
- ;
- break;}
-case 150:
-#line 684 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '*', 1, yyvsp[0].node);
- ;
- break;}
-case 151:
-#line 688 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '/', 1, yyvsp[0].node);
- ;
- break;}
-case 152:
-#line 692 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '%', 1, yyvsp[0].node);
- ;
- break;}
-case 153:
-#line 696 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tPOW, 1, yyvsp[0].node);
- ;
- break;}
-case 154:
-#line 700 "parse.y"
-{
- yyval.node = call_op(yyvsp[0].node, tUPLUS, 0);
- ;
- break;}
-case 155:
-#line 704 "parse.y"
-{
- yyval.node = call_op(yyvsp[0].node, tUMINUS, 0);
- ;
- break;}
-case 156:
-#line 708 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '|', 1, yyvsp[0].node);
- ;
- break;}
-case 157:
-#line 712 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '^', 1, yyvsp[0].node);
- ;
- break;}
-case 158:
-#line 716 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '&', 1, yyvsp[0].node);
- ;
- break;}
-case 159:
-#line 720 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tCMP, 1, yyvsp[0].node);
- ;
- break;}
-case 160:
-#line 724 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '>', 1, yyvsp[0].node);
- ;
- break;}
-case 161:
-#line 728 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tGEQ, 1, yyvsp[0].node);
- ;
- break;}
-case 162:
-#line 732 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, '<', 1, yyvsp[0].node);
- ;
- break;}
-case 163:
-#line 736 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tLEQ, 1, yyvsp[0].node);
- ;
- break;}
-case 164:
-#line 740 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tEQ, 1, yyvsp[0].node);
- ;
- break;}
-case 165:
-#line 744 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tEQQ, 1, yyvsp[0].node);
- ;
- break;}
-case 166:
-#line 748 "parse.y"
-{
- yyval.node = NEW_NOT(call_op(yyvsp[-2].node, tEQ, 1, yyvsp[0].node));
- ;
- break;}
-case 167:
-#line 752 "parse.y"
-{
- yyval.node = match_gen(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 168:
-#line 756 "parse.y"
-{
- yyval.node = NEW_NOT(match_gen(yyvsp[-2].node, yyvsp[0].node));
- ;
- break;}
-case 169:
-#line 760 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_NOT(cond(yyvsp[0].node));
- ;
- break;}
-case 170:
-#line 765 "parse.y"
-{
- yyval.node = call_op(yyvsp[0].node, '~', 0);
- ;
- break;}
-case 171:
-#line 769 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tLSHFT, 1, yyvsp[0].node);
- ;
- break;}
-case 172:
-#line 773 "parse.y"
-{
- yyval.node = call_op(yyvsp[-2].node, tRSHFT, 1, yyvsp[0].node);
- ;
- break;}
-case 173:
-#line 777 "parse.y"
-{
- yyval.node = logop(NODE_AND, yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 174:
-#line 781 "parse.y"
-{
- yyval.node = logop(NODE_OR, yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 175:
-#line 784 "parse.y"
-{in_defined = 1;;
- break;}
-case 176:
-#line 785 "parse.y"
-{
- in_defined = 0;
- yyval.node = NEW_DEFINED(yyvsp[0].node);
- ;
- break;}
-case 177:
-#line 790 "parse.y"
-{
- value_expr(yyvsp[-4].node);
- yyval.node = NEW_IF(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 178:
-#line 796 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 179:
-#line 801 "parse.y"
-{
- if (yyvsp[0].node && nd_type(yyvsp[0].node) == NODE_BLOCK_PASS) {
- rb_compile_error("block argument should not be given");
- }
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 182:
-#line 812 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_LIST(yyvsp[0].node);
- ;
- break;}
-case 183:
-#line 817 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 184:
-#line 821 "parse.y"
-{
- yyval.node = arg_blk_pass(yyvsp[-1].node, yyvsp[0].node);
- ;
- break;}
-case 185:
-#line 825 "parse.y"
-{
- yyval.node = arg_concat(yyvsp[-4].node, yyvsp[-1].node);
- yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 186:
-#line 830 "parse.y"
-{
- yyval.node = NEW_LIST(NEW_HASH(yyvsp[-1].node));
- ;
- break;}
-case 187:
-#line 834 "parse.y"
-{
- yyval.node = NEW_LIST(NEW_HASH(yyvsp[-1].node));
- yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 188:
-#line 839 "parse.y"
-{
- yyval.node = arg_concat(NEW_LIST(NEW_HASH(yyvsp[-4].node)), yyvsp[-1].node);
- yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 189:
-#line 844 "parse.y"
-{
- yyval.node = list_append(yyvsp[-3].node, NEW_HASH(yyvsp[-1].node));
- yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 190:
-#line 849 "parse.y"
-{
- yyval.node = list_append(yyvsp[-3].node, NEW_HASH(yyvsp[-1].node));
- ;
- break;}
-case 191:
-#line 853 "parse.y"
-{
- yyval.node = arg_concat(list_append(yyvsp[-6].node, NEW_HASH(yyvsp[-4].node)), yyvsp[-1].node);
- yyval.node = arg_blk_pass(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 192:
-#line 858 "parse.y"
-{
- value_expr(yyvsp[-1].node);
- yyval.node = arg_blk_pass(NEW_RESTARGS(yyvsp[-1].node), yyvsp[0].node);
- ;
- break;}
-case 194:
-#line 865 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_BLOCK_PASS(yyvsp[0].node);
- ;
- break;}
-case 195:
-#line 871 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 199:
-#line 880 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_LIST(yyvsp[0].node);
- ;
- break;}
-case 200:
-#line 885 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = list_append(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 201:
-#line 891 "parse.y"
-{
- if (yyvsp[0].node &&
- nd_type(yyvsp[0].node) == NODE_ARRAY &&
- yyvsp[0].node->nd_next == 0)
- {
- yyval.node = yyvsp[0].node->nd_head;
- }
- else {
- yyval.node = yyvsp[0].node;
- }
- ;
- break;}
-case 202:
-#line 903 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = arg_concat(yyvsp[-3].node, yyvsp[0].node);
- ;
- break;}
-case 203:
-#line 908 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 204:
-#line 914 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- if (yyvsp[0].node) {
- if (nd_type(yyvsp[0].node) == NODE_ARRAY &&
- yyvsp[0].node->nd_next == 0) {
- yyval.node = yyvsp[0].node->nd_head;
- }
- else if (nd_type(yyvsp[0].node) == NODE_BLOCK_PASS) {
- rb_compile_error("block argument should not be given");
- }
- }
- ;
- break;}
-case 207:
-#line 931 "parse.y"
-{
- yyval.node = NEW_LIT(yyvsp[0].val);
- ;
- break;}
-case 208:
-#line 935 "parse.y"
-{
- value_expr(yyvsp[-2].node);
- yyval.node = NEW_COLON2(yyvsp[-2].node, yyvsp[0].id);
- ;
- break;}
-case 209:
-#line 940 "parse.y"
-{
- yyval.node = NEW_COLON3(yyvsp[0].id);
- ;
- break;}
-case 210:
-#line 944 "parse.y"
-{
- yyval.node = NEW_STR(yyvsp[0].val);
- ;
- break;}
-case 212:
-#line 949 "parse.y"
-{
- yyval.node = NEW_XSTR(yyvsp[0].val);
- ;
- break;}
-case 217:
-#line 957 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = NEW_CALL(yyvsp[-3].node, tAREF, yyvsp[-1].node);
- ;
- break;}
-case 218:
-#line 962 "parse.y"
-{
- if (yyvsp[-1].node == 0)
- yyval.node = NEW_ZARRAY(); /* zero length array*/
- else {
- yyval.node = yyvsp[-1].node;
- }
- ;
- break;}
-case 219:
-#line 970 "parse.y"
-{
- yyval.node = NEW_HASH(yyvsp[-1].node);
- ;
- break;}
-case 220:
-#line 974 "parse.y"
-{
- if (!compile_for_eval && !cur_mid && !in_single)
- yyerror("return appeared outside of method");
- value_expr(yyvsp[-1].node);
- yyval.node = NEW_RETURN(yyvsp[-1].node);
- ;
- break;}
-case 221:
-#line 981 "parse.y"
-{
- if (!compile_for_eval && !cur_mid && !in_single)
- yyerror("return appeared outside of method");
- yyval.node = NEW_RETURN(0);
- ;
- break;}
-case 222:
-#line 987 "parse.y"
-{
- if (!compile_for_eval && !cur_mid && !in_single)
- yyerror("return appeared outside of method");
- yyval.node = NEW_RETURN(0);
- ;
- break;}
-case 223:
-#line 993 "parse.y"
-{
- value_expr(yyvsp[-1].node);
- yyval.node = NEW_YIELD(yyvsp[-1].node);
- ;
- break;}
-case 224:
-#line 998 "parse.y"
-{
- yyval.node = NEW_YIELD(0);
- ;
- break;}
-case 225:
-#line 1002 "parse.y"
-{
- yyval.node = NEW_YIELD(0);
- ;
- break;}
-case 226:
-#line 1005 "parse.y"
-{in_defined = 1;;
- break;}
-case 227:
-#line 1006 "parse.y"
-{
- in_defined = 0;
- yyval.node = NEW_DEFINED(yyvsp[-1].node);
- ;
- break;}
-case 228:
-#line 1011 "parse.y"
-{
- yyval.node = NEW_VCALL(yyvsp[0].id);
- ;
- break;}
-case 229:
-#line 1015 "parse.y"
-{
- yyvsp[0].node->nd_iter = NEW_FCALL(yyvsp[-1].id, 0);
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 231:
-#line 1021 "parse.y"
-{
- if (yyvsp[-1].node && nd_type(yyvsp[-1].node) == NODE_BLOCK_PASS) {
- rb_compile_error("both block arg and actual block given");
- }
- yyvsp[0].node->nd_iter = yyvsp[-1].node;
- yyval.node = yyvsp[0].node;
- fixpos(yyval.node, yyvsp[-1].node);
- ;
- break;}
-case 232:
-#line 1033 "parse.y"
-{
- value_expr(yyvsp[-4].node);
- yyval.node = NEW_IF(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 233:
-#line 1042 "parse.y"
-{
- value_expr(yyvsp[-4].node);
- yyval.node = NEW_UNLESS(cond(yyvsp[-4].node), yyvsp[-2].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 234:
-#line 1050 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = NEW_WHILE(cond(yyvsp[-3].node), yyvsp[-1].node, 1);
- fixpos(yyval.node, yyvsp[-3].node);
- ;
- break;}
-case 235:
-#line 1058 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = NEW_UNTIL(cond(yyvsp[-3].node), yyvsp[-1].node, 1);
- fixpos(yyval.node, yyvsp[-3].node);
- ;
- break;}
-case 236:
-#line 1066 "parse.y"
-{
- value_expr(yyvsp[-2].node);
- yyval.node = NEW_CASE(yyvsp[-2].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-2].node);
- ;
- break;}
-case 237:
-#line 1074 "parse.y"
-{
- value_expr(yyvsp[-5].node);
- yyval.node = NEW_FOR(yyvsp[-5].node, yyvsp[-3].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-5].node);
- ;
- break;}
-case 238:
-#line 1085 "parse.y"
-{
- if (!yyvsp[-3].node && !yyvsp[-2].node && !yyvsp[-1].node)
- yyval.node = NEW_BEGIN(yyvsp[-4].node);
- else {
- if (yyvsp[-3].node) yyvsp[-4].node = NEW_RESCUE(yyvsp[-4].node, yyvsp[-3].node, yyvsp[-2].node);
- else if (yyvsp[-2].node) {
- rb_warn("else without rescue is useless");
- yyvsp[-4].node = block_append(yyvsp[-4].node, yyvsp[-2].node);
- }
- if (yyvsp[-1].node) yyvsp[-4].node = NEW_ENSURE(yyvsp[-4].node, yyvsp[-1].node);
- yyval.node = yyvsp[-4].node;
- }
- fixpos(yyval.node, yyvsp[-4].node);
- ;
- break;}
-case 239:
-#line 1100 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 240:
-#line 1104 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("class definition in method body");
-
- class_nest++;
- cref_push();
- local_push();
- ;
- break;}
-case 241:
-#line 1114 "parse.y"
-{
- yyval.node = NEW_CLASS(yyvsp[-4].id, yyvsp[-1].node, yyvsp[-3].node);
- fixpos(yyval.node, yyvsp[-3].node);
- local_pop();
- cref_pop();
- class_nest--;
- ;
- break;}
-case 242:
-#line 1122 "parse.y"
-{
- class_nest++;
- cref_push();
- local_push();
- ;
- break;}
-case 243:
-#line 1129 "parse.y"
-{
- yyval.node = NEW_SCLASS(yyvsp[-4].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-4].node);
- local_pop();
- cref_pop();
- class_nest--;
- ;
- break;}
-case 244:
-#line 1137 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("module definition in method body");
- class_nest++;
- cref_push();
- local_push();
- ;
- break;}
-case 245:
-#line 1146 "parse.y"
-{
- yyval.node = NEW_MODULE(yyvsp[-3].id, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-1].node);
- local_pop();
- cref_pop();
- class_nest--;
- ;
- break;}
-case 246:
-#line 1154 "parse.y"
-{
- if (cur_mid || in_single)
- yyerror("nested method definition");
- cur_mid = yyvsp[0].id;
- local_push();
- ;
- break;}
-case 247:
-#line 1163 "parse.y"
-{
- /* NOEX_PRIVATE for toplevel */
- yyval.node = NEW_DEFN(yyvsp[-4].id, yyvsp[-2].node, yyvsp[-1].node, class_nest?0:1);
- fixpos(yyval.node, yyvsp[-2].node);
- local_pop();
- cur_mid = 0;
- ;
- break;}
-case 248:
-#line 1170 "parse.y"
-{lex_state = EXPR_FNAME;;
- break;}
-case 249:
-#line 1171 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- in_single++;
- local_push();
- lex_state = EXPR_END; /* force for args */
- ;
- break;}
-case 250:
-#line 1180 "parse.y"
-{
- yyval.node = NEW_DEFS(yyvsp[-7].node, yyvsp[-4].id, yyvsp[-2].node, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-7].node);
- local_pop();
- in_single--;
- ;
- break;}
-case 251:
-#line 1187 "parse.y"
-{
- yyval.node = NEW_BREAK();
- ;
- break;}
-case 252:
-#line 1191 "parse.y"
-{
- yyval.node = NEW_NEXT();
- ;
- break;}
-case 253:
-#line 1195 "parse.y"
-{
- yyval.node = NEW_REDO();
- ;
- break;}
-case 254:
-#line 1199 "parse.y"
-{
- yyval.node = NEW_RETRY();
- ;
- break;}
-case 261:
-#line 1214 "parse.y"
-{
- value_expr(yyvsp[-3].node);
- yyval.node = NEW_IF(cond(yyvsp[-3].node), yyvsp[-1].node, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-3].node);
- ;
- break;}
-case 263:
-#line 1222 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 267:
-#line 1231 "parse.y"
-{
- yyval.node = 0;
- ;
- break;}
-case 268:
-#line 1235 "parse.y"
-{
- yyval.node = 0;
- ;
- break;}
-case 269:
-#line 1239 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 270:
-#line 1244 "parse.y"
-{
- yyval.vars = dyna_push();
- ;
- break;}
-case 271:
-#line 1250 "parse.y"
-{
- yyval.node = NEW_ITER(yyvsp[-2].node, 0, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-2].node?yyvsp[-2].node:yyvsp[-1].node);
- dyna_pop(yyvsp[-3].vars);
- ;
- break;}
-case 272:
-#line 1257 "parse.y"
-{
- yyval.vars = dyna_push();
- ;
- break;}
-case 273:
-#line 1262 "parse.y"
-{
- yyval.node = NEW_ITER(yyvsp[-2].node, 0, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-2].node?yyvsp[-2].node:yyvsp[-1].node);
- dyna_pop(yyvsp[-3].vars);
- ;
- break;}
-case 274:
-#line 1269 "parse.y"
-{
- yyval.node = NEW_VCALL(yyvsp[0].id);
- ;
- break;}
-case 275:
-#line 1273 "parse.y"
-{
- yyval.node = NEW_VCALL(yyvsp[0].id);
- ;
- break;}
-case 276:
-#line 1277 "parse.y"
-{
- yyval.node = NEW_VCALL(yyvsp[0].id);
- ;
- break;}
-case 279:
-#line 1284 "parse.y"
-{
- if (yyvsp[-1].node && nd_type(yyvsp[-1].node) == NODE_BLOCK_PASS) {
- rb_compile_error("both block arg and actual block given");
- }
- yyvsp[0].node->nd_iter = yyvsp[-1].node;
- yyval.node = yyvsp[0].node;
- fixpos(yyval.node, yyvsp[0].node);
- ;
- break;}
-case 280:
-#line 1294 "parse.y"
-{
- yyval.node = new_fcall(yyvsp[-3].id, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-1].node);
- ;
- break;}
-case 281:
-#line 1299 "parse.y"
-{
- value_expr(yyvsp[-5].node);
- yyval.node = new_call(yyvsp[-5].node, yyvsp[-3].id, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-5].node);
- ;
- break;}
-case 282:
-#line 1305 "parse.y"
-{
- value_expr(yyvsp[-2].node);
- yyval.node = new_call(yyvsp[-2].node, yyvsp[0].id, 0);
- fixpos(yyval.node, yyvsp[-2].node);
- ;
- break;}
-case 283:
-#line 1311 "parse.y"
-{
- value_expr(yyvsp[-5].node);
- yyval.node = new_call(yyvsp[-5].node, yyvsp[-3].id, yyvsp[-1].node);
- fixpos(yyval.node, yyvsp[-5].node);
- ;
- break;}
-case 284:
-#line 1317 "parse.y"
-{
- value_expr(yyvsp[-2].node);
- yyval.node = new_call(yyvsp[-2].node, yyvsp[0].id, 0);
- ;
- break;}
-case 285:
-#line 1322 "parse.y"
-{
- if (!compile_for_eval && !cur_mid &&
- !in_single && !in_defined)
- yyerror("super called outside of method");
- yyval.node = NEW_SUPER(yyvsp[-1].node);
- ;
- break;}
-case 286:
-#line 1329 "parse.y"
-{
- if (!compile_for_eval && !cur_mid &&
- !in_single && !in_defined)
- yyerror("super called outside of method");
- yyval.node = NEW_ZSUPER();
- ;
- break;}
-case 289:
-#line 1343 "parse.y"
-{
- yyval.node = NEW_WHEN(yyvsp[-3].node, yyvsp[-1].node, yyvsp[0].node);
- ;
- break;}
-case 291:
-#line 1349 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = list_append(yyvsp[-3].node, NEW_WHEN(yyvsp[0].node, 0, 0));
- ;
- break;}
-case 292:
-#line 1354 "parse.y"
-{
- value_expr(yyvsp[0].node);
- yyval.node = NEW_LIST(NEW_WHEN(yyvsp[0].node, 0, 0));
- ;
- break;}
-case 295:
-#line 1365 "parse.y"
-{
- yyval.node = NEW_RESBODY(yyvsp[-3].node, yyvsp[-1].node, yyvsp[0].node);
- fixpos(yyval.node, yyvsp[-3].node?yyvsp[-3].node:yyvsp[-1].node);
- ;
- break;}
-case 298:
-#line 1373 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 300:
-#line 1379 "parse.y"
-{
- lex_state = EXPR_END;
- yyval.val = INT2FIX(yyvsp[0].id);
- ;
- break;}
-case 311:
-#line 1396 "parse.y"
-{yyval.id = kNIL;;
- break;}
-case 312:
-#line 1397 "parse.y"
-{yyval.id = kSELF;;
- break;}
-case 313:
-#line 1398 "parse.y"
-{yyval.id = kTRUE;;
- break;}
-case 314:
-#line 1399 "parse.y"
-{yyval.id = kFALSE;;
- break;}
-case 315:
-#line 1400 "parse.y"
-{yyval.id = k__FILE__;;
- break;}
-case 316:
-#line 1401 "parse.y"
-{yyval.id = k__LINE__;;
- break;}
-case 317:
-#line 1404 "parse.y"
-{
- yyval.node = gettable(yyvsp[0].id);
- ;
- break;}
-case 320:
-#line 1412 "parse.y"
-{
- yyval.node = 0;
- ;
- break;}
-case 321:
-#line 1416 "parse.y"
-{
- lex_state = EXPR_BEG;
- ;
- break;}
-case 322:
-#line 1420 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 323:
-#line 1423 "parse.y"
-{yyerrok; yyval.node = 0;;
- break;}
-case 324:
-#line 1426 "parse.y"
-{
- yyval.node = yyvsp[-2].node;
- lex_state = EXPR_BEG;
- ;
- break;}
-case 325:
-#line 1431 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 326:
-#line 1436 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(yyvsp[-5].num, yyvsp[-3].node, yyvsp[-1].id), yyvsp[0].node);
- ;
- break;}
-case 327:
-#line 1440 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(yyvsp[-3].num, yyvsp[-1].node, -1), yyvsp[0].node);
- ;
- break;}
-case 328:
-#line 1444 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(yyvsp[-3].num, 0, yyvsp[-1].id), yyvsp[0].node);
- ;
- break;}
-case 329:
-#line 1448 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(yyvsp[-1].num, 0, -1), yyvsp[0].node);
- ;
- break;}
-case 330:
-#line 1452 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(0, yyvsp[-3].node, yyvsp[-1].id), yyvsp[0].node);
- ;
- break;}
-case 331:
-#line 1456 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(0, yyvsp[-1].node, -1), yyvsp[0].node);
- ;
- break;}
-case 332:
-#line 1460 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(0, 0, yyvsp[-1].id), yyvsp[0].node);
- ;
- break;}
-case 333:
-#line 1464 "parse.y"
-{
- yyval.node = block_append(NEW_ARGS(0, 0, -1), yyvsp[0].node);
- ;
- break;}
-case 334:
-#line 1468 "parse.y"
-{
- yyval.node = NEW_ARGS(0, 0, -1);
- ;
- break;}
-case 335:
-#line 1473 "parse.y"
-{
- if (!is_local_id(yyvsp[0].id))
- yyerror("formal argument must be local variable");
- local_cnt(yyvsp[0].id);
- yyval.num = 1;
- ;
- break;}
-case 336:
-#line 1480 "parse.y"
-{
- if (!is_local_id(yyvsp[0].id))
- yyerror("formal argument must be local variable");
- local_cnt(yyvsp[0].id);
- yyval.num += 1;
- ;
- break;}
-case 337:
-#line 1488 "parse.y"
-{
- if (!is_local_id(yyvsp[-2].id))
- yyerror("formal argument must be local variable");
- yyval.node = assignable(yyvsp[-2].id, yyvsp[0].node);
- ;
- break;}
-case 338:
-#line 1495 "parse.y"
-{
- yyval.node = NEW_BLOCK(yyvsp[0].node);
- yyval.node->nd_end = yyval.node;
- ;
- break;}
-case 339:
-#line 1500 "parse.y"
-{
- yyval.node = block_append(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 340:
-#line 1505 "parse.y"
-{
- if (!is_local_id(yyvsp[0].id))
- yyerror("rest argument must be local variable");
- yyval.id = local_cnt(yyvsp[0].id);
- ;
- break;}
-case 341:
-#line 1511 "parse.y"
-{
- yyval.id = -2;
- ;
- break;}
-case 342:
-#line 1516 "parse.y"
-{
- yyval.node = NEW_BLOCK_ARG(yyvsp[0].id);
- ;
- break;}
-case 343:
-#line 1521 "parse.y"
-{
- yyval.node = yyvsp[0].node;
- ;
- break;}
-case 345:
-#line 1527 "parse.y"
-{
- if (nd_type(yyvsp[0].node) == NODE_SELF) {
- yyval.node = NEW_SELF();
- }
- else if (nd_type(yyvsp[0].node) == NODE_NIL) {
- yyerror("Can't define single method for nil.");
- yyval.node = 0;
- }
- else {
- yyval.node = yyvsp[0].node;
- }
- ;
- break;}
-case 346:
-#line 1539 "parse.y"
-{lex_state = EXPR_BEG;;
- break;}
-case 347:
-#line 1540 "parse.y"
-{
- switch (nd_type(yyvsp[-2].node)) {
- case NODE_STR:
- case NODE_DSTR:
- case NODE_XSTR:
- case NODE_DXSTR:
- case NODE_DREGX:
- case NODE_LIT:
- case NODE_ARRAY:
- case NODE_ZARRAY:
- yyerror("can't define single method for literals.");
- default:
- break;
- }
- yyval.node = yyvsp[-2].node;
- ;
- break;}
-case 349:
-#line 1559 "parse.y"
-{
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 350:
-#line 1563 "parse.y"
-{
- if (yyvsp[-1].node->nd_alen%2 != 0) {
- yyerror("odd number list for Hash");
- }
- yyval.node = yyvsp[-1].node;
- ;
- break;}
-case 352:
-#line 1572 "parse.y"
-{
- yyval.node = list_concat(yyvsp[-2].node, yyvsp[0].node);
- ;
- break;}
-case 353:
-#line 1577 "parse.y"
-{
- yyval.node = list_append(NEW_LIST(yyvsp[-2].node), yyvsp[0].node);
- ;
- break;}
-case 373:
-#line 1607 "parse.y"
-{yyerrok;;
- break;}
-case 376:
-#line 1611 "parse.y"
-{yyerrok;;
- break;}
-case 377:
-#line 1614 "parse.y"
-{
- yyval.node = 0;
- ;
- break;}
-}
- /* the action file gets copied in in place of this dollarsign */
-#line 542 "/usr/share/misc/bison.simple"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-#ifdef YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
- *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
-#endif
-
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
-
- goto yynewstate;
-
-yyerrlab: /* here on detecting error */
-
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
-
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
- {
- strcpy(msg, "parse error");
-
- if (count < 5)
- {
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
- yyerror ("parse error; also virtual memory exceeded");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
-
- goto yyerrlab1;
-yyerrlab1: /* here on error raised explicitly by an action */
-
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
- yychar = YYEMPTY;
- }
-
- /* Else will try to reuse lookahead token
- after shifting the error token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
-
-yyerrdefault: /* current state does not do anything special for the error token. */
-
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
-#endif
-
-yyerrpop: /* pop the current state because it cannot handle the error token */
-
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
- yylsp--;
-#endif
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-
-yyerrhandle:
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
-
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
-
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
-#endif
-
- *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- yystate = yyn;
- goto yynewstate;
-
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 0;
-
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 1;
-}
-#line 1617 "parse.y"
-
-#include <ctype.h>
-#include <sys/types.h>
-#include "regex.h"
-#include "util.h"
-#ifndef strdup
-char *strdup();
-#endif
-
-#define is_identchar(c) (((int)(c))!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c)))
-
-static char *tokenbuf = NULL;
-static int tokidx, toksiz = 0;
-
-static NODE *rb_str_extend();
-
-#define LEAVE_BS 1
-
-static VALUE (*lex_gets)(); /* gets function */
-static VALUE lex_input; /* non-nil if File */
-static VALUE lex_lastline; /* gc protect */
-static char *lex_pbeg;
-static char *lex_p;
-static char *lex_pend;
-
-static int
-yyerror(msg)
- char *msg;
-{
- char *p, *pe, *buf;
- int len, i;
-
- rb_compile_error("%s", msg);
- p = lex_p;
- while (lex_pbeg <= p) {
- if (*p == '\n') break;
- p--;
- }
- p++;
-
- pe = lex_p;
- while (pe < lex_pend) {
- if (*pe == '\n') break;
- pe++;
- }
-
- len = pe - p;
- if (len > 4) {
- buf = ALLOCA_N(char, len+2);
- MEMCPY(buf, p, char, len);
- buf[len] = '\0';
- rb_compile_error_append("%s", buf);
-
- i = lex_p - p;
- p = buf; pe = p + len;
-
- while (p < pe) {
- if (*p != '\t') *p = ' ';
- p++;
- }
- buf[i] = '^';
- buf[i+1] = '\0';
- rb_compile_error_append("%s", buf);
- }
-
- return 0;
-}
-
-static int heredoc_end;
-
-int ruby_in_compile = 0;
-int ruby__end__seen;
-
-static NODE*
-yycompile(f)
- char *f;
-{
- int n;
-
- ruby__end__seen = 0;
- ruby_eval_tree = 0;
- heredoc_end = 0;
- ruby_sourcefile = f;
- ruby_in_compile = 1;
- n = yyparse();
- compile_for_eval = 0;
- ruby_in_compile = 0;
- if (n == 0) return ruby_eval_tree;
-
- return 0;
-}
-
-static int lex_gets_ptr;
-
-static VALUE
-lex_get_str(s)
- VALUE s;
-{
- char *beg, *end, *pend;
-
- beg = RSTRING(s)->ptr;
- if (lex_gets_ptr) {
- if (RSTRING(s)->len == lex_gets_ptr) return Qnil;
- beg += lex_gets_ptr;
- }
- pend = RSTRING(s)->ptr + RSTRING(s)->len;
- end = beg;
- while (end < pend) {
- if (*end++ == '\n') break;
- }
- lex_gets_ptr = end - RSTRING(s)->ptr;
- return rb_str_new(beg, end - beg);
-}
-
-NODE*
-rb_compile_string(f, s, line)
- const char *f;
- VALUE s;
- int line;
-{
- lex_gets = lex_get_str;
- lex_gets_ptr = 0;
- lex_input = s;
- lex_pbeg = lex_p = lex_pend = 0;
- ruby_sourceline = line - 1;
- compile_for_eval = 1;
-
- return yycompile(f);
-}
-
-NODE*
-rb_compile_cstr(f, s, len, line)
- const char *f, *s;
- int len, line;
-{
- return rb_compile_string(f, rb_str_new(s, len), line);
-}
-
-NODE*
-rb_compile_file(f, file, start)
- const char *f;
- VALUE file;
- int start;
-{
- lex_gets = rb_io_gets;
- lex_input = file;
- lex_pbeg = lex_p = lex_pend = 0;
- ruby_sourceline = start - 1;
-
- return yycompile(strdup(f));
-}
-
-static int
-nextc()
-{
- int c;
-
- if (lex_p == lex_pend) {
- if (lex_input) {
- VALUE v = (*lex_gets)(lex_input);
-
- if (NIL_P(v)) return -1;
- if (heredoc_end > 0) {
- ruby_sourceline = heredoc_end;
- heredoc_end = 0;
- }
- ruby_sourceline++;
- lex_pbeg = lex_p = RSTRING(v)->ptr;
- lex_pend = lex_p + RSTRING(v)->len;
- if (strncmp(lex_pbeg, "__END__", 7) == 0 && lex_pbeg[7] == '\n') {
- ruby__end__seen = 1;
- lex_lastline = 0;
- return -1;
- }
- lex_lastline = v;
- }
- else {
- lex_lastline = 0;
- return -1;
- }
- }
- c = (unsigned char)*lex_p++;
-
- return c;
-}
-
-static void
-pushback(c)
- int c;
-{
- if (c == -1) return;
- lex_p--;
-}
-
-#define tokfix() (tokenbuf[tokidx]='\0')
-#define tok() tokenbuf
-#define toklen() tokidx
-#define toklast() (tokidx>0?tokenbuf[tokidx-1]:0)
-
-static char*
-newtok()
-{
- tokidx = 0;
- if (!tokenbuf) {
- toksiz = 60;
- tokenbuf = ALLOC_N(char, 60);
- }
- if (toksiz > 4096) {
- toksiz = 60;
- REALLOC_N(tokenbuf, char, 60);
- }
- return tokenbuf;
-}
-
-static void
-tokadd(c)
- char c;
-{
- tokenbuf[tokidx++] = c;
- if (tokidx >= toksiz) {
- toksiz *= 2;
- REALLOC_N(tokenbuf, char, toksiz);
- }
-}
-
-static int
-read_escape()
-{
- int c;
-
- switch (c = nextc()) {
- case '\\': /* Backslash */
- return c;
-
- case 'n': /* newline */
- return '\n';
-
- case 't': /* horizontal tab */
- return '\t';
-
- case 'r': /* carriage-return */
- return '\r';
-
- case 'f': /* form-feed */
- return '\f';
-
- case 'v': /* vertical tab */
- return '\13';
-
- case 'a': /* alarm(bell) */
- return '\007';
-
- case 'e': /* escape */
- return 033;
-
- case '0': case '1': case '2': case '3': /* octal constant */
- case '4': case '5': case '6': case '7':
- {
- char buf[3];
- int i;
-
- pushback(c);
- for (i=0; i<3; i++) {
- c = nextc();
- if (c == -1) goto eof;
- if (c < '0' || '7' < c) {
- pushback(c);
- break;
- }
- buf[i] = c;
- }
- c = scan_oct(buf, i, &i);
- }
- return c;
-
- case 'x': /* hex constant */
- {
- char buf[2];
- int i;
-
- for (i=0; i<2; i++) {
- int cc = nextc();
-
- if (cc == -1) goto eof;
- buf[i] = cc;
- if (!ISXDIGIT(buf[i])) {
- pushback(buf[i]);
- break;
- }
- }
- c = scan_hex(buf, i, &i);
- }
- return c;
-
- case 'b': /* backspace */
- return '\b';
-
- case 's': /* space */
- return ' ';
-
- case 'M':
- if ((c = nextc()) != '-') {
- yyerror("Invalid escape character syntax");
- pushback(c);
- return '\0';
- }
- if ((c = nextc()) == '\\') {
- return read_escape() | 0x80;
- }
- else if (c == -1) goto eof;
- else {
- return ((c & 0xff) | 0x80);
- }
-
- case 'C':
- if ((c = nextc()) != '-') {
- yyerror("Invalid escape character syntax");
- pushback(c);
- return '\0';
- }
- case 'c':
- if ((c = nextc())== '\\') {
- c = read_escape();
- }
- else if (c == '?')
- return 0177;
- else if (c == -1) goto eof;
- return c & 0x9f;
-
- eof:
- case -1:
- yyerror("Invalid escape character syntax");
- return '\0';
-
- default:
- return c;
- }
-}
-
-static int
-parse_regx(term, paren)
- int term;
-{
- register int c;
- char kcode = 0;
- int once = 0;
- int nest = 0;
- int options = 0;
- int in_brack = 0;
- int re_start = ruby_sourceline;
- NODE *list = 0;
-
- newtok();
- while ((c = nextc()) != -1) {
- if ((!in_brack && c == term) || nest > 0) {
- goto regx_end;
- }
-
- switch (c) {
- case '[':
- in_brack = 1;
- break;
- case ']':
- in_brack = 0;
- break;
-
- case '#':
- list = rb_str_extend(list, term);
- if (list == (NODE*)-1) return 0;
- continue;
-
- case '\\':
- switch (c = nextc()) {
- case -1:
- ruby_sourceline = re_start;
- rb_compile_error("unterminated regexp meets end of file");
- return 0;
-
- case '\n':
- break;
-
- case '\\':
- case '^':
- case 's':
- tokadd('\\');
- tokadd(c);
- break;
-
- case '1': case '2': case '3':
- case '4': case '5': case '6':
- case '7': case '8': case '9':
- case '0': case 'x':
- tokadd('\\');
- tokadd(c);
- break;
-
- case 'b':
- if (!in_brack) {
- tokadd('\\');
- tokadd('b');
- break;
- }
- /* fall through */
- default:
- if (paren) {
- if (c == paren) nest++;
- if (c == term) nest--;
- }
- if (c == term) {
- tokadd(c);
- }
- else {
-#if 0
- int c1;
- pushback(c);
- c1 = read_escape();
- if (c1 != c) {
- tokadd(c1);
- }
- else {
- tokadd('\\');
- tokadd(c);
- }
-#else
- tokadd('\\');
- tokadd(c);
-#endif
- }
- }
- continue;
-
- case -1:
- rb_compile_error("unterminated regexp");
- return 0;
-
- default:
- if (ismbchar(c)) {
- int i, len = mbclen(c)-1;
-
- for (i = 0; i < len; i++) {
- tokadd(c);
- c = nextc();
- }
- }
- break;
-
- regx_end:
- for (;;) {
- switch (c = nextc()) {
- case 'i':
- options |= RE_OPTION_IGNORECASE;
- break;
- case 'x':
- options |= RE_OPTION_EXTENDED;
- break;
- case 'p':
- options |= RE_OPTION_POSIXLINE;
- break;
- case 'o':
- once = 1;
- break;
- case 'n':
- kcode = 8;
- break;
- case 'e':
- kcode = 16;
- break;
- case 's':
- kcode = 24;
- break;
- case 'u':
- kcode = 32;
- break;
- default:
- pushback(c);
- goto end_options;
- }
- }
-
- end_options:
- tokfix();
- lex_state = EXPR_END;
- if (list) {
- nd_set_line(list, re_start);
- if (toklen() > 0) {
- VALUE ss = rb_str_new(tok(), toklen());
- list_append(list, NEW_STR(ss));
- }
- nd_set_type(list, once?NODE_DREGX_ONCE:NODE_DREGX);
- list->nd_cflag = options | kcode;
- yylval.node = list;
- return tDREGEXP;
- }
- else {
- yylval.val = rb_reg_new(tok(), toklen(), options | kcode);
- return tREGEXP;
- }
- }
- tokadd(c);
- }
- rb_compile_error("unterminated regexp");
- return 0;
-}
-
-static int parse_qstring _((int,int));
-
-static int
-parse_string(func, term, paren)
- int func, term, paren;
-{
- int c;
- NODE *list = 0;
- int strstart;
- int nest = 0;
-
- if (func == '\'') {
- return parse_qstring(term, paren);
- }
- if (func == 0) { /* read 1 line for heredoc */
- /* -1 for chomp */
- yylval.val = rb_str_new(lex_pbeg, lex_pend - lex_pbeg - 1);
- lex_p = lex_pend;
- return tSTRING;
- }
- strstart = ruby_sourceline;
- newtok();
- while ((c = nextc()) != term || nest > 0) {
- if (c == -1) {
- unterm_str:
- ruby_sourceline = strstart;
- rb_compile_error("unterminated string meets end of file");
- return 0;
- }
- if (ismbchar(c)) {
- int i, len = mbclen(c)-1;
-
- for (i = 0; i < len; i++) {
- tokadd(c);
- c = nextc();
- }
- }
- else if (c == '#') {
- list = rb_str_extend(list, term);
- if (list == (NODE*)-1) goto unterm_str;
- continue;
- }
- else if (c == '\\') {
- c = nextc();
- if (c == '\n')
- continue;
- if (c == term) {
- tokadd(c);
- }
- else {
- pushback(c);
- if (func != '"') tokadd('\\');
- tokadd(read_escape());
- }
- continue;
- }
- if (paren) {
- if (c == paren) nest++;
- if (c == term) {
- nest--;
- if (nest == 0) break;
- }
- }
- tokadd(c);
- }
-
- tokfix();
- lex_state = EXPR_END;
-
- if (list) {
- nd_set_line(list, strstart);
- if (toklen() > 0) {
- VALUE ss = rb_str_new(tok(), toklen());
- list_append(list, NEW_STR(ss));
- }
- yylval.node = list;
- if (func == '`') {
- nd_set_type(list, NODE_DXSTR);
- return tDXSTRING;
- }
- else {
- return tDSTRING;
- }
- }
- else {
- yylval.val = rb_str_new(tok(), toklen());
- return (func == '`') ? tXSTRING : tSTRING;
- }
-}
-
-static int
-parse_qstring(term, paren)
- int term, paren;
-{
- int strstart;
- int c;
- int nest = 0;
-
- strstart = ruby_sourceline;
- newtok();
- while ((c = nextc()) != term || nest > 0) {
- if (c == -1) {
- ruby_sourceline = strstart;
- rb_compile_error("unterminated string meets end of file");
- return 0;
- }
- if (ismbchar(c)) {
- int i, len = mbclen(c)-1;
-
- for (i = 0; i < len; i++) {
- tokadd(c);
- c = nextc();
- }
- }
- else if (c == '\\') {
- c = nextc();
- switch (c) {
- case '\n':
- continue;
-
- case '\\':
- c = '\\';
- break;
-
- case '\'':
- if (term == '\'') {
- c = '\'';
- break;
- }
- /* fall through */
- default:
- tokadd('\\');
- }
- }
- if (paren) {
- if (c == paren) nest++;
- if (c == term) {
- nest--;
- if (nest == 0) break;
- }
- }
- tokadd(c);
- }
-
- tokfix();
- yylval.val = rb_str_new(tok(), toklen());
- lex_state = EXPR_END;
- return tSTRING;
-}
-
-static int
-parse_quotedword(term, paren)
- int term, paren;
-{
- if (parse_qstring(term, paren) == 0) return 0;
- yylval.node = NEW_CALL(NEW_STR(yylval.val), rb_intern("split"), 0);
- return tDSTRING;
-}
-
-static int
-here_document(term, indent)
- char term;
- int indent;
-{
- int c;
- char *eos, *p;
- int len;
- VALUE str;
- volatile VALUE line = 0;
- VALUE lastline_save;
- int offset_save;
- NODE *list = 0;
- int linesave = ruby_sourceline;
-
- newtok();
- switch (term) {
- case '\'':
- case '"':
- case '`':
- while ((c = nextc()) != term) {
- tokadd(c);
- }
- if (term == '\'') term = 0;
- break;
-
- default:
- c = term;
- term = '"';
- if (!is_identchar(c)) {
- rb_warn("use of bare << to mean <<\"\" is deprecated");
- break;
- }
- while (is_identchar(c)) {
- tokadd(c);
- c = nextc();
- }
- pushback(c);
- break;
- }
- tokfix();
- lastline_save = lex_lastline;
- offset_save = lex_p - lex_pbeg;
- eos = strdup(tok());
- len = strlen(eos);
-
- str = rb_str_new(0,0);
- for (;;) {
- lex_lastline = line = (*lex_gets)(lex_input);
- if (NIL_P(line)) {
- error:
- ruby_sourceline = linesave;
- rb_compile_error("can't find string \"%s\" anywhere before EOF", eos);
- free(eos);
- return 0;
- }
- ruby_sourceline++;
- p = RSTRING(line)->ptr;
- if (indent) {
- while (*p && (*p == ' ' || *p == '\t')) {
- p++;
- }
- }
- if (strncmp(eos, p, len) == 0 && p[len] == '\n') {
- break;
- }
-
- lex_pbeg = lex_p = RSTRING(line)->ptr;
- lex_pend = lex_p + RSTRING(line)->len;
-#if 0
- if (indent) {
- while (*lex_p && *lex_p == '\t') {
- lex_p++;
- }
- }
-#endif
- retry:
- switch (parse_string(term, '\n', '\n')) {
- case tSTRING:
- case tXSTRING:
- rb_str_cat(yylval.val, "\n", 1);
- if (!list) {
- rb_str_cat(str, RSTRING(yylval.val)->ptr, RSTRING(yylval.val)->len);
- }
- else {
- list_append(list, NEW_STR(yylval.val));
- }
- break;
- case tDSTRING:
- case tDXSTRING:
- list_append(yylval.node, NEW_STR(rb_str_new2("\n")));
- nd_set_type(yylval.node, NODE_STR);
- if (!list) list = NEW_DSTR(str);
- yylval.node = NEW_LIST(yylval.node);
- yylval.node->nd_next = yylval.node->nd_head->nd_next;
- list_concat(list, yylval.node);
- break;
-
- case 0:
- goto error;
- }
- if (lex_p != lex_pend) {
- goto retry;
- }
- }
- free(eos);
- lex_lastline = lastline_save;
- lex_pbeg = RSTRING(lex_lastline)->ptr;
- lex_pend = lex_pbeg + RSTRING(lex_lastline)->len;
- lex_p = lex_pbeg + offset_save;
-
- lex_state = EXPR_END;
- heredoc_end = ruby_sourceline;
- ruby_sourceline = linesave;
-
- if (list) {
- nd_set_line(list, linesave+1);
- yylval.node = list;
- }
- switch (term) {
- case '\0':
- case '\'':
- case '"':
- if (list) return tDSTRING;
- yylval.val = str;
- return tSTRING;
- case '`':
- if (list) return tDXSTRING;
- return tXSTRING;
- }
- return 0;
-}
-
-#include "lex.c"
-
-static void
-arg_ambiguous()
-{
- rb_warning("ambiguous first argument; make sure");
-}
-
-#ifndef strtod
-double strtod ();
-#endif
-
-static int
-yylex()
-{
- register int c;
- int space_seen = 0;
- struct kwtable *kw;
-
- retry:
- switch (c = nextc()) {
- case '\0': /* NUL */
- case '\004': /* ^D */
- case '\032': /* ^Z */
- case -1: /* end of script. */
- return 0;
-
- /* white spaces */
- case ' ': case '\t': case '\f': case '\r':
- case '\13': /* '\v' */
- space_seen = 1;
- goto retry;
-
- case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
- if (c == -1)
- return 0;
- }
- /* fall through */
- case '\n':
- switch (lex_state) {
- case EXPR_BEG:
- case EXPR_FNAME:
- case EXPR_DOT:
- goto retry;
- default:
- break;
- }
- lex_state = EXPR_BEG;
- return '\n';
-
- case '*':
- if ((c = nextc()) == '*') {
- lex_state = EXPR_BEG;
- if (nextc() == '=') {
- yylval.id = tPOW;
- return tOP_ASGN;
- }
- pushback(c);
- return tPOW;
- }
- if (c == '=') {
- yylval.id = '*';
- lex_state = EXPR_BEG;
- return tOP_ASGN;
- }
- pushback(c);
- if (lex_state == EXPR_ARG && space_seen && !ISSPACE(c)){
- lex_state = EXPR_BEG;
- return tSTAR;
- }
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- lex_state = EXPR_BEG;
- return tSTAR;
- }
- lex_state = EXPR_BEG;
- return '*';
-
- case '!':
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '=') {
- return tNEQ;
- }
- if (c == '~') {
- return tNMATCH;
- }
- pushback(c);
- return '!';
-
- case '=':
- if (lex_p == lex_pbeg + 1) {
- /* skip embedded rd document */
- if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) {
- for (;;) {
- lex_p = lex_pend;
- c = nextc();
- if (c == -1) {
- rb_compile_error("embedded document meets end of file");
- return 0;
- }
- if (c != '=') continue;
- if (strncmp(lex_p, "end", 3) == 0 && ISSPACE(lex_p[3])) {
- break;
- }
- }
- lex_p = lex_pend;
- goto retry;
- }
- }
-
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '=') {
- if ((c = nextc()) == '=') {
- return tEQQ;
- }
- pushback(c);
- return tEQ;
- }
- if (c == '~') {
- return tMATCH;
- }
- else if (c == '>') {
- return tASSOC;
- }
- pushback(c);
- return '=';
-
- case '<':
- c = nextc();
- if (c == '<' &&
- lex_state != EXPR_END && lex_state != EXPR_CLASS &&
- (lex_state != EXPR_ARG || space_seen)) {
- int c2 = nextc();
- int indent = 0;
- if (c2 == '-') {
- indent = 1;
- c2 = nextc();
- }
- if (!ISSPACE(c2) && (strchr("\"'`", c2) || is_identchar(c2))) {
- return here_document(c2, indent);
- }
- pushback(c2);
- }
- lex_state = EXPR_BEG;
- if (c == '=') {
- if ((c = nextc()) == '>') {
- return tCMP;
- }
- pushback(c);
- return tLEQ;
- }
- if (c == '<') {
- if (nextc() == '=') {
- yylval.id = tLSHFT;
- return tOP_ASGN;
- }
- pushback(c);
- return tLSHFT;
- }
- pushback(c);
- return '<';
-
- case '>':
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '=') {
- return tGEQ;
- }
- if (c == '>') {
- if ((c = nextc()) == '=') {
- yylval.id = tRSHFT;
- return tOP_ASGN;
- }
- pushback(c);
- return tRSHFT;
- }
- pushback(c);
- return '>';
-
- case '"':
- return parse_string(c,c,c);
- case '`':
- if (lex_state == EXPR_FNAME) return c;
- if (lex_state == EXPR_DOT) return c;
- return parse_string(c,c,c);
-
- case '\'':
- return parse_qstring(c,0);
-
- case '?':
- if (lex_state == EXPR_END) {
- lex_state = EXPR_BEG;
- return '?';
- }
- c = nextc();
- if (lex_state == EXPR_ARG && ISSPACE(c)){
- pushback(c);
- lex_state = EXPR_BEG;
- return '?';
- }
- if (c == '\\') {
- c = read_escape();
- }
- c &= 0xff;
- yylval.val = INT2FIX(c);
- lex_state = EXPR_END;
- return tINTEGER;
-
- case '&':
- if ((c = nextc()) == '&') {
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '=') {
- yylval.id = tANDOP;
- return tOP_ASGN;
- }
- pushback(c);
- return tANDOP;
- }
- else if (c == '=') {
- yylval.id = '&';
- lex_state = EXPR_BEG;
- return tOP_ASGN;
- }
- pushback(c);
- if (lex_state == EXPR_ARG && space_seen && !ISSPACE(c)){
- lex_state = EXPR_BEG;
- return tAMPER;
- }
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- lex_state = EXPR_BEG;
- return tAMPER;
- }
- lex_state = EXPR_BEG;
- return '&';
-
- case '|':
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '|') {
- if ((c = nextc()) == '=') {
- yylval.id = tOROP;
- return tOP_ASGN;
- }
- pushback(c);
- return tOROP;
- }
- else if (c == '=') {
- yylval.id = '|';
- return tOP_ASGN;
- }
- pushback(c);
- return '|';
-
- case '+':
- c = nextc();
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if (c == '@') {
- return tUPLUS;
- }
- pushback(c);
- return '+';
- }
- if (c == '=') {
- lex_state = EXPR_BEG;
- yylval.id = '+';
- return tOP_ASGN;
- }
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID ||
- (lex_state == EXPR_ARG && space_seen && !ISSPACE(c))) {
- if (ISDIGIT(c)) {
- goto start_num;
- }
- pushback(c);
- lex_state = EXPR_BEG;
- return tUPLUS;
- }
- lex_state = EXPR_BEG;
- pushback(c);
- return '+';
-
- case '-':
- c = nextc();
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if (c == '@') {
- return tUMINUS;
- }
- pushback(c);
- return '-';
- }
- if (c == '=') {
- lex_state = EXPR_BEG;
- yylval.id = '-';
- return tOP_ASGN;
- }
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID ||
- (lex_state == EXPR_ARG && space_seen && !ISSPACE(c))) {
- if (ISDIGIT(c)) {
- pushback(c);
- c = '-';
- goto start_num;
- }
- lex_state = EXPR_BEG;
- pushback(c);
- return tUMINUS;
- }
- lex_state = EXPR_BEG;
- pushback(c);
- return '-';
-
- case '.':
- lex_state = EXPR_BEG;
- if ((c = nextc()) == '.') {
- if ((c = nextc()) == '.') {
- return tDOT3;
- }
- pushback(c);
- return tDOT2;
- }
- pushback(c);
- if (!ISDIGIT(c)) {
- lex_state = EXPR_DOT;
- return '.';
- }
- c = '.';
- /* fall through */
-
- start_num:
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- {
- int is_float, seen_point, seen_e;
-
- is_float = seen_point = seen_e = 0;
- lex_state = EXPR_END;
- newtok();
- if (c == '-' || c == '+') {
- tokadd(c);
- c = nextc();
- }
- if (c == '0') {
- c = nextc();
- if (c == 'x' || c == 'X') {
- /* hexadecimal */
- c = nextc();
- if (!ISXDIGIT(c)) {
- yyerror("hexadecimal number without hex-digits");
- }
- do {
- if (c == '_') continue;
- if (!ISXDIGIT(c)) break;
- tokadd(c);
- } while (c = nextc());
- pushback(c);
- tokfix();
- yylval.val = rb_str2inum(tok(), 16);
- return tINTEGER;
- }
- if (c == 'b' || c == 'B') {
- /* binary */
- c = nextc();
- if (c != '0' && c != '1') {
- yyerror("numeric constant with no digits");
- }
- do {
- if (c == '_') continue;
- if (c != '0'&& c != '1') break;
- tokadd(c);
- } while (c = nextc());
- pushback(c);
- tokfix();
- yylval.val = rb_str2inum(tok(), 2);
- return tINTEGER;
- }
- if (c >= '0' && c <= '7' || c == '_') {
- /* octal */
- do {
- if (c == '_') continue;
- if (c < '0' || c > '7') break;
- tokadd(c);
- } while (c = nextc());
- pushback(c);
- tokfix();
- yylval.val = rb_str2inum(tok(), 8);
- return tINTEGER;
- }
- if (c > '7' && c <= '9') {
- yyerror("Illegal octal digit");
- }
- else if (c == '.') {
- tokadd('0');
- }
- else {
- pushback(c);
- yylval.val = INT2FIX(0);
- return tINTEGER;
- }
- }
-
- for (;;) {
- switch (c) {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- tokadd(c);
- break;
-
- case '.':
- if (seen_point || seen_e) {
- goto decode_num;
- }
- else {
- int c0 = nextc();
- if (!ISDIGIT(c0)) {
- pushback(c0);
- goto decode_num;
- }
- c = c0;
- }
- tokadd('.');
- tokadd(c);
- is_float++;
- seen_point++;
- break;
-
- case 'e':
- case 'E':
- if (seen_e) {
- goto decode_num;
- }
- tokadd(c);
- seen_e++;
- is_float++;
- if ((c = nextc()) == '-' || c == '+')
- tokadd(c);
- else
- continue;
- break;
-
- case '_': /* `_' in decimal just ignored */
- break;
-
- default:
- goto decode_num;
- }
- c = nextc();
- }
-
- decode_num:
- pushback(c);
- tokfix();
- if (is_float) {
- double d = strtod(tok(), 0);
- if (errno == ERANGE) {
- rb_warn("Float %s out of range", tok());
- errno = 0;
- }
- yylval.val = rb_float_new(d);
- return tFLOAT;
- }
- yylval.val = rb_str2inum(tok(), 10);
- return tINTEGER;
- }
-
- case ']':
- case '}':
- case ')':
- lex_state = EXPR_END;
- return c;
-
- case ':':
- c = nextc();
- if (c == ':') {
- if (lex_state == EXPR_BEG) {
- lex_state = EXPR_BEG;
- return tCOLON3;
- }
- if (lex_state == EXPR_ARG && space_seen) {
- lex_state = EXPR_BEG;
- return tCOLON3;
- }
- lex_state = EXPR_DOT;
- return tCOLON2;
- }
- pushback(c);
- if (lex_state == EXPR_END || ISSPACE(c)) {
- lex_state = EXPR_BEG;
- return ':';
- }
- lex_state = EXPR_FNAME;
- return tSYMBEG;
-
- case '/':
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- return parse_regx('/', '/');
- }
- if ((c = nextc()) == '=') {
- lex_state = EXPR_BEG;
- yylval.id = '/';
- return tOP_ASGN;
- }
- if (lex_state == EXPR_ARG) {
- if (space_seen && !ISSPACE(c)) {
- pushback(c);
- arg_ambiguous();
- return parse_regx('/', '/');
- }
- }
- lex_state = EXPR_BEG;
- pushback(c);
- return '/';
-
- case '^':
- lex_state = EXPR_BEG;
- if (nextc() == '=') {
- yylval.id = '^';
- return tOP_ASGN;
- }
- pushback(c);
- return c;
-
- case ',':
- case ';':
- lex_state = EXPR_BEG;
- return c;
-
- case '~':
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if ((c = nextc()) != '@') {
- pushback(c);
- }
- }
- lex_state = EXPR_BEG;
- return '~';
-
- case '(':
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- c = tLPAREN;
- lex_state = EXPR_BEG;
- }
- else {
- lex_state = EXPR_BEG;
- }
- return c;
-
- case '[':
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if ((c = nextc()) == ']') {
- if ((c = nextc()) == '=') {
- return tASET;
- }
- pushback(c);
- return tAREF;
- }
- pushback(c);
- return '[';
- }
- else if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- c = tLBRACK;
- }
- else if (lex_state == EXPR_ARG && space_seen) {
- c = tLBRACK;
- }
- lex_state = EXPR_BEG;
- return c;
-
- case '{':
- if (lex_state != EXPR_END && lex_state != EXPR_ARG)
- c = tLBRACE;
- lex_state = EXPR_BEG;
- return c;
-
- case '\\':
- c = nextc();
- if (c == '\r') {
- c = nextc();
- if (c != '\n') pushback(c);
- }
- if (c == '\n') {
- space_seen = 1;
- goto retry; /* skip \\n */
- }
- pushback(c);
- return '\\';
-
- case '%':
- if (lex_state == EXPR_BEG || lex_state == EXPR_MID) {
- int term;
- int paren;
-
- c = nextc();
- quotation:
- if (!ISALNUM(c)) {
- term = c;
- c = 'Q';
- }
- else {
- term = nextc();
- }
- if (c == -1 || term == -1) {
- rb_compile_error("unterminated quoted string meets end of file");
- return 0;
- }
- paren = 0;
- if (term == '(') term = ')';
- else if (term == '[') term = ']';
- else if (term == '{') term = '}';
- else if (term == '<') term = '>';
-
- switch (c) {
- case 'Q':
- return parse_string('"', term, paren);
-
- case 'q':
- return parse_qstring(term, paren);
-
- case 'w':
- return parse_quotedword(term, paren);
-
- case 'x':
- return parse_string('`', term, paren);
-
- case 'r':
- return parse_regx(term, paren);
-
- default:
- yyerror("unknown type of %string");
- return 0;
- }
- }
- if ((c = nextc()) == '=') {
- yylval.id = '%';
- return tOP_ASGN;
- }
- if (lex_state == EXPR_ARG && space_seen && !ISSPACE(c)) {
- goto quotation;
- }
- lex_state = EXPR_BEG;
- pushback(c);
- return '%';
-
- case '$':
- lex_state = EXPR_END;
- newtok();
- c = nextc();
- switch (c) {
- case '~': /* $~: match-data */
- /* fall through */
- case '_': /* $_: last read line string */
- local_cnt(c);
- /* fall through */
- case '*': /* $*: argv */
- case '$': /* $$: pid */
- case '?': /* $?: last status */
- case '!': /* $!: error string */
- case '@': /* $@: error position */
- case '/': /* $/: input record separator */
- case '\\': /* $\: output record separator */
- case ';': /* $;: field separator */
- case ',': /* $,: output field separator */
- case '.': /* $.: last read line number */
- case '=': /* $=: ignorecase */
- case ':': /* $:: load path */
- case '<': /* $<: reading filename */
- case '>': /* $>: default output handle */
- case '\"': /* $": already loaded files */
- tokadd('$');
- tokadd(c);
- tokfix();
- yylval.id = rb_intern(tok());
- return tGVAR;
-
- case '-':
- tokadd('$');
- tokadd(c);
- c = nextc();
- tokadd(c);
- tokfix();
- yylval.id = rb_intern(tok());
- return tGVAR;
-
- case '&': /* $&: last match */
- case '`': /* $`: string before last match */
- case '\'': /* $': string after last match */
- case '+': /* $+: string matches last paren. */
- yylval.node = NEW_BACK_REF(c);
- return tBACK_REF;
-
- case '1': case '2': case '3':
- case '4': case '5': case '6':
- case '7': case '8': case '9':
- while (ISDIGIT(c)) {
- tokadd(c);
- c = nextc();
- }
- pushback(c);
- tokfix();
- yylval.node = NEW_NTH_REF(atoi(tok()));
- return tNTH_REF;
-
- default:
- if (!is_identchar(c)) {
- pushback(c);
- return '$';
- }
- case '0':
- tokadd('$');
- }
- break;
-
- case '@':
- c = nextc();
- if (!is_identchar(c)) {
- pushback(c);
- return '@';
- }
- newtok();
- tokadd('@');
- break;
-
- default:
- if (c != '_' && !ISALPHA(c) && !ismbchar(c)) {
- rb_compile_error("Invalid char '%c' in expression", c);
- goto retry;
- }
-
- newtok();
- break;
- }
-
- while (is_identchar(c)) {
- tokadd(c);
- if (ismbchar(c)) {
- int i, len = mbclen(c)-1;
-
- tokadd(c);
- for (i = 0; i < len; i++) {
- c = nextc();
- tokadd(c);
- }
- }
- c = nextc();
- }
- if ((c == '!' || c == '?') && is_identchar(tok()[0])) {
- tokadd(c);
- if (c == '!') {
- c = nextc();
- if (c == '=') {
- rb_warn("identifier! immediately followed by `='");
- }
- pushback(c);
- }
- }
- else {
- pushback(c);
- }
- tokfix();
-
- {
- int result;
-
- switch (tok()[0]) {
- case '$':
- lex_state = EXPR_END;
- result = tGVAR;
- break;
- case '@':
- lex_state = EXPR_END;
- result = tIVAR;
- break;
- default:
- if (lex_state != EXPR_DOT) {
- /* See if it is a reserved word. */
- kw = rb_reserved_word(tok(), toklen());
- if (kw) {
- enum lex_state state = lex_state;
- lex_state = kw->state;
- if (state == EXPR_FNAME) {
- yylval.id = rb_intern(kw->name);
- }
- return kw->id[state != EXPR_BEG];
- }
- }
-
- if (ISUPPER(tok()[0])) {
- result = tCONSTANT;
- }
- else if (toklast() == '!' || toklast() == '?') {
- result = tFID;
- } else {
- result = tIDENTIFIER;
- if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
- if ((c = nextc()) == '=') {
- tokadd(c);
- }
- else {
- pushback(c);
- }
- }
- }
- if (lex_state == EXPR_BEG ||
- lex_state == EXPR_DOT ||
- lex_state == EXPR_ARG){
- lex_state = EXPR_ARG;
- }
- else {
- lex_state = EXPR_END;
- }
- }
- tokfix();
- yylval.id = rb_intern(tok());
- return result;
- }
-}
-
-static NODE*
-rb_str_extend(list, term)
- NODE *list;
- char term;
-{
- int c;
- int brace = -1;
- VALUE ss;
- NODE *node;
- int nest;
-
- c = nextc();
- switch (c) {
- case '$':
- case '@':
- case '{':
- break;
- default:
- tokadd('#');
- pushback(c);
- return list;
- }
-
- ss = rb_str_new(tok(), toklen());
- if (list == 0) {
- list = NEW_DSTR(ss);
- }
- else if (toklen() > 0) {
- list_append(list, NEW_STR(ss));
- }
- newtok();
-
- switch (c) {
- case '$':
- tokadd('$');
- c = nextc();
- if (c == -1) return (NODE*)-1;
- switch (c) {
- case '1': case '2': case '3':
- case '4': case '5': case '6':
- case '7': case '8': case '9':
- while (ISDIGIT(c)) {
- tokadd(c);
- c = nextc();
- }
- pushback(c);
- goto fetch_id;
-
- case '&': case '+':
- case '_': case '~':
- case '*': case '$': case '?':
- case '!': case '@': case ',':
- case '.': case '=': case ':':
- case '<': case '>': case '\\':
- refetch:
- tokadd(c);
- goto fetch_id;
-
- default:
- if (c == term) {
- list_append(list, NEW_STR(rb_str_new2("#$")));
- pushback(c);
- newtok();
- return list;
- }
- switch (c) {
- case '\"':
- case '/':
- case '\'':
- case '`':
- goto refetch;
- }
- if (!is_identchar(c)) {
- yyerror("bad global variable in string");
- newtok();
- return list;
- }
- }
- /* through */
-
- case '@':
- tokadd(c);
- c = nextc();
- while (is_identchar(c)) {
- tokadd(c);
- if (ismbchar(c)) {
- int i, len = mbclen(c)-1;
-
- tokadd(c);
- for (i = 0; i < len; i++) {
- c = nextc();
- tokadd(c);
- }
- }
- c = nextc();
- }
- pushback(c);
- break;
-
- case '{':
- if (c == '{') brace = '}';
- nest = 0;
- do {
- loop_again:
- c = nextc();
- switch (c) {
- case -1:
- if (nest > 0) {
- yyerror("bad substitution in string");
- newtok();
- return list;
- }
- return (NODE*)-1;
- case '}':
- if (c == brace) {
- if (nest == 0) break;
- nest--;
- }
- tokadd(c);
- goto loop_again;
- case '\\':
- c = read_escape();
- tokadd(c);
- goto loop_again;
- case '{':
- if (brace != -1) nest++;
- case '\"':
- case '/':
- case '`':
- if (c == term) {
- pushback(c);
- list_append(list, NEW_STR(rb_str_new2("#")));
- rb_warning("bad substitution in string");
- tokfix();
- list_append(list, NEW_STR(rb_str_new(tok(), toklen())));
- newtok();
- return list;
- }
- default:
- tokadd(c);
- break;
- }
- } while (c != brace);
- }
-
- fetch_id:
- tokfix();
- node = NEW_EVSTR(tok(),toklen());
- list_append(list, node);
- newtok();
-
- return list;
-}
-
-NODE*
-rb_node_newnode(type, a0, a1, a2)
- enum node_type type;
- NODE *a0, *a1, *a2;
-{
- NODE *n = (NODE*)rb_newobj();
-
- n->flags |= T_NODE;
- nd_set_type(n, type);
- nd_set_line(n, ruby_sourceline);
- n->nd_file = ruby_sourcefile;
-
- n->u1.node = a0;
- n->u2.node = a1;
- n->u3.node = a2;
-
- return n;
-}
-
-static enum node_type
-nodetype(node) /* for debug */
- NODE *node;
-{
- return (enum node_type)nd_type(node);
-}
-
-static int
-nodeline(node)
- NODE *node;
-{
- return nd_line(node);
-}
-
-static NODE*
-newline_node(node)
- NODE *node;
-{
- NODE *nl = 0;
- if (node) {
- nl = NEW_NEWLINE(node);
- fixpos(nl, node);
- nl->nd_nth = nd_line(node);
- }
- return nl;
-}
-
-static void
-fixpos(node, orig)
- NODE *node, *orig;
-{
- if (!node) return;
- if (!orig) return;
- node->nd_file = orig->nd_file;
- nd_set_line(node, nd_line(orig));
-}
-
-static NODE*
-block_append(head, tail)
- NODE *head, *tail;
-{
- NODE *end;
-
- if (tail == 0) return head;
- if (head == 0) return tail;
-
- if (nd_type(head) != NODE_BLOCK) {
- end = NEW_BLOCK(head);
- end->nd_end = end;
- fixpos(end, head);
- head = end;
- }
- else {
- end = head->nd_end;
- }
-
- if (RTEST(ruby_verbose)) {
- NODE *nd = end->nd_head;
- newline:
- switch (nd_type(nd)) {
- case NODE_RETURN:
- case NODE_BREAK:
- case NODE_NEXT:
- case NODE_REDO:
- case NODE_RETRY:
- rb_warning("statement not reached");
- break;
-
- case NODE_NEWLINE:
- nd = nd->nd_next;
- goto newline;
-
- default:
- break;
- }
- }
-
- if (nd_type(tail) != NODE_BLOCK) {
- tail = NEW_BLOCK(tail);
- tail->nd_end = tail;
- }
- end->nd_next = tail;
- head->nd_end = tail->nd_end;
- return head;
-}
-
-static NODE*
-list_append(head, tail)
- NODE *head, *tail;
-{
- NODE *last;
-
- if (head == 0) return NEW_LIST(tail);
-
- last = head;
- while (last->nd_next) {
- last = last->nd_next;
- }
-
- last->nd_next = NEW_LIST(tail);
- head->nd_alen += 1;
- return head;
-}
-
-static NODE*
-list_concat(head, tail)
- NODE *head, *tail;
-{
- NODE *last;
-
- last = head;
- while (last->nd_next) {
- last = last->nd_next;
- }
-
- last->nd_next = tail;
- head->nd_alen += tail->nd_alen;
-
- return head;
-}
-
-static NODE *
-call_op(recv, id, narg, arg1)
- NODE *recv;
- ID id;
- int narg;
- NODE *arg1;
-{
- value_expr(recv);
- if (narg == 1) {
- value_expr(arg1);
- }
-
- return NEW_CALL(recv, id, narg==1?NEW_LIST(arg1):0);
-}
-
-static NODE*
-match_gen(node1, node2)
- NODE *node1;
- NODE *node2;
-{
- local_cnt('~');
-
- switch (nd_type(node1)) {
- case NODE_DREGX:
- case NODE_DREGX_ONCE:
- return NEW_MATCH2(node1, node2);
-
- case NODE_LIT:
- if (TYPE(node1->nd_lit) == T_REGEXP) {
- return NEW_MATCH2(node1, node2);
- }
- }
-
- switch (nd_type(node2)) {
- case NODE_DREGX:
- case NODE_DREGX_ONCE:
- return NEW_MATCH3(node2, node1);
-
- case NODE_LIT:
- if (TYPE(node2->nd_lit) == T_REGEXP) {
- return NEW_MATCH3(node2, node1);
- }
- }
-
- return NEW_CALL(node1, tMATCH, NEW_LIST(node2));
-}
-
-static NODE*
-gettable(id)
- ID id;
-{
- if (id == kSELF) {
- return NEW_SELF();
- }
- else if (id == kNIL) {
- return NEW_NIL();
- }
- else if (id == kTRUE) {
- return NEW_TRUE();
- }
- else if (id == kFALSE) {
- return NEW_FALSE();
- }
- else if (id == k__FILE__) {
- return NEW_STR(rb_str_new2(ruby_sourcefile));
- }
- else if (id == k__LINE__) {
- return NEW_LIT(INT2FIX(ruby_sourceline));
- }
- else if (is_local_id(id)) {
- if (dyna_in_block() && rb_dvar_defined(id)) return NEW_DVAR(id);
- if (local_id(id)) return NEW_LVAR(id);
- /* method call without arguments */
- return NEW_VCALL(id);
- }
- else if (is_global_id(id)) {
- return NEW_GVAR(id);
- }
- else if (is_instance_id(id)) {
- return NEW_IVAR(id);
- }
- else if (is_const_id(id)) {
- return NEW_CVAR(id);
- }
- rb_bug("invalid id for gettable");
- return 0;
-}
-
-static NODE*
-assignable(id, val)
- ID id;
- NODE *val;
-{
- NODE *lhs = 0;
-
- value_expr(val);
- if (id == kSELF) {
- yyerror("Can't change the value of self");
- }
- else if (id == kNIL) {
- yyerror("Can't assign to nil");
- }
- else if (id == kTRUE) {
- yyerror("Can't assign to true");
- }
- else if (id == kFALSE) {
- yyerror("Can't assign to false");
- }
- else if (id == k__FILE__) {
- yyerror("Can't assign to __FILE__");
- }
- else if (id == k__LINE__) {
- yyerror("Can't assign to __LINE__");
- }
- else if (is_local_id(id)) {
- if (rb_dvar_defined(id)) {
- lhs = NEW_DASGN(id, val);
- }
- else if (local_id(id) || !dyna_in_block()) {
- lhs = NEW_LASGN(id, val);
- }
- else{
- rb_dvar_push(id, 0);
- lhs = NEW_DASGN_PUSH(id, val);
- }
- }
- else if (is_global_id(id)) {
- lhs = NEW_GASGN(id, val);
- }
- else if (is_instance_id(id)) {
- lhs = NEW_IASGN(id, val);
- }
- else if (is_const_id(id)) {
- if (cur_mid || in_single)
- yyerror("dynamic constant assignment");
- lhs = NEW_CASGN(id, val);
- }
- else {
- rb_bug("bad id for variable");
- }
- return lhs;
-}
-
-static NODE *
-aryset(recv, idx)
- NODE *recv, *idx;
-{
- value_expr(recv);
-
- return NEW_CALL(recv, tASET, idx);
-}
-
-ID
-rb_id_attrset(id)
- ID id;
-{
- id &= ~ID_SCOPE_MASK;
- id |= ID_ATTRSET;
- return id;
-}
-
-static NODE *
-attrset(recv, id)
- NODE *recv;
- ID id;
-{
- value_expr(recv);
-
- return NEW_CALL(recv, rb_id_attrset(id), 0);
-}
-
-static void
-rb_backref_error(node)
- NODE *node;
-{
- switch (nd_type(node)) {
- case NODE_NTH_REF:
- rb_compile_error("Can't set variable $%d", node->nd_nth);
- break;
- case NODE_BACK_REF:
- rb_compile_error("Can't set variable $%c", node->nd_nth);
- break;
- }
-}
-
-static NODE *
-arg_concat(node1, node2)
- NODE *node1;
- NODE *node2;
-{
- return NEW_ARGSCAT(node1, node2);
-}
-
-static NODE *
-arg_add(node1, node2)
- NODE *node1;
- NODE *node2;
-{
- if (!node1) return NEW_LIST(node2);
- if (nd_type(node1) == NODE_ARRAY) {
- return list_append(node1, node2);
- }
- else {
- return NEW_ARGSCAT(node1, node2);
- }
-}
-
-static NODE*
-node_assign(lhs, rhs)
- NODE *lhs, *rhs;
-{
- if (!lhs) return 0;
-
- value_expr(rhs);
- switch (nd_type(lhs)) {
- case NODE_GASGN:
- case NODE_IASGN:
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_DASGN_PUSH:
- case NODE_CASGN:
- case NODE_MASGN:
- lhs->nd_value = rhs;
- break;
-
- case NODE_CALL:
- lhs->nd_args = arg_add(lhs->nd_args, rhs);
- break;
-
- default:
- /* should not happen */
- break;
- }
-
- if (rhs) fixpos(lhs, rhs);
- return lhs;
-}
-
-static int
-value_expr(node)
- NODE *node;
-{
- if (node == 0) return Qtrue;
-
- switch (nd_type(node)) {
- case NODE_RETURN:
- case NODE_BREAK:
- case NODE_NEXT:
- case NODE_REDO:
- case NODE_RETRY:
- case NODE_WHILE:
- case NODE_UNTIL:
- case NODE_CLASS:
- case NODE_MODULE:
- case NODE_DEFN:
- case NODE_DEFS:
- yyerror("void value expression");
- return Qfalse;
- break;
-
- case NODE_BLOCK:
- while (node->nd_next) {
- node = node->nd_next;
- }
- return value_expr(node->nd_head);
-
- case NODE_IF:
- return value_expr(node->nd_body) && value_expr(node->nd_else);
-
- case NODE_NEWLINE:
- return value_expr(node->nd_next);
-
- default:
- return Qtrue;
- }
-}
-
-static void
-void_expr(node)
- NODE *node;
-{
- char *useless = 0;
-
- if (!ruby_verbose) return;
- if (!node) return;
-
- again:
- switch (nd_type(node)) {
- case NODE_NEWLINE:
- node = node->nd_next;
- goto again;
-
- case NODE_CALL:
- switch (node->nd_mid) {
- case '+':
- case '-':
- case '*':
- case '/':
- case '%':
- case tPOW:
- case tUPLUS:
- case tUMINUS:
- case '|':
- case '^':
- case '&':
- case tCMP:
- case '>':
- case tGEQ:
- case '<':
- case tLEQ:
- case tEQ:
- case tNEQ:
- case tAREF:
- case tRSHFT:
- case tCOLON2:
- case tCOLON3:
- useless = rb_id2name(node->nd_mid);
- break;
- }
- break;
-
- case NODE_LVAR:
- case NODE_DVAR:
- case NODE_GVAR:
- case NODE_IVAR:
- case NODE_NTH_REF:
- case NODE_BACK_REF:
- useless = "a variable";
- break;
- case NODE_CVAR:
- case NODE_CREF:
- useless = "a constant";
- break;
- case NODE_LIT:
- case NODE_STR:
- case NODE_DSTR:
- case NODE_DREGX:
- case NODE_DREGX_ONCE:
- useless = "a literal";
- break;
- case NODE_COLON2:
- case NODE_COLON3:
- useless = "::";
- break;
- case NODE_DOT2:
- useless = "..";
- break;
- case NODE_DOT3:
- useless = "...";
- break;
- case NODE_SELF:
- useless = "self";
- break;
- case NODE_NIL:
- useless = "nil";
- break;
- case NODE_TRUE:
- useless = "true";
- break;
- case NODE_FALSE:
- useless = "false";
- break;
- case NODE_DEFINED:
- useless = "defined?";
- break;
- }
-
- if (useless) {
- int line = ruby_sourceline;
-
- ruby_sourceline = nd_line(node);
- rb_warn("useless use of %s in void context", useless);
- ruby_sourceline = line;
- }
-}
-
-static void
-void_stmts(node)
- NODE *node;
-{
- if (!ruby_verbose) return;
- if (!node) return;
- if (nd_type(node) != NODE_BLOCK) return;
-
- for (;;) {
- if (!node->nd_next) return;
- void_expr(node->nd_head);
- node = node->nd_next;
- }
-}
-
-static NODE *cond2();
-
-static int
-assign_in_cond(node)
- NODE *node;
-{
- switch (nd_type(node)) {
- case NODE_MASGN:
- yyerror("multiple assignment in conditional");
- return 1;
-
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_GASGN:
- case NODE_IASGN:
- case NODE_CASGN:
- break;
-
- case NODE_NEWLINE:
- default:
- return 0;
- }
-
- switch (nd_type(node->nd_value)) {
- case NODE_LIT:
- case NODE_STR:
- case NODE_DSTR:
- case NODE_XSTR:
- case NODE_DXSTR:
- case NODE_EVSTR:
- case NODE_DREGX:
- case NODE_NIL:
- case NODE_TRUE:
- case NODE_FALSE:
- /* reports always */
- rb_warn("found = in conditional, should be ==");
- return 1;
-
- default:
- break;
- }
- if (assign_in_cond(node->nd_value) == 0) {
- rb_warning("assignment in condition");
- }
- return 1;
-}
-
-static NODE*
-cond0(node)
- NODE *node;
-{
- enum node_type type = nd_type(node);
-
- assign_in_cond(node);
- switch (type) {
- case NODE_DREGX:
- case NODE_DREGX_ONCE:
- local_cnt('_');
- local_cnt('~');
- return NEW_MATCH2(node, NEW_GVAR(rb_intern("$_")));
-
- case NODE_DOT2:
- case NODE_DOT3:
- node->nd_beg = cond2(node->nd_beg);
- node->nd_end = cond2(node->nd_end);
- if (type == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
- else if (type == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
- node->nd_cnt = local_append(0);
- return node;
-
- case NODE_LIT:
- if (TYPE(node->nd_lit) == T_REGEXP) {
- local_cnt('_');
- local_cnt('~');
- return NEW_MATCH(node);
- }
- if (TYPE(node->nd_lit) == T_STRING) {
- local_cnt('_');
- local_cnt('~');
- return NEW_MATCH(rb_reg_new(RSTRING(node)->ptr,RSTRING(node)->len,0));
- }
- default:
- return node;
- }
-}
-
-static NODE*
-cond(node)
- NODE *node;
-{
- if (node == 0) return 0;
- if (nd_type(node) == NODE_NEWLINE){
- node->nd_next = cond0(node->nd_next);
- return node;
- }
- return cond0(node);
-}
-
-static NODE*
-cond2(node)
- NODE *node;
-{
- enum node_type type;
-
- node = cond(node);
- type = nd_type(node);
- if (type == NODE_NEWLINE) node = node->nd_next;
- if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
- return call_op(node,tEQ,1,NEW_GVAR(rb_intern("$.")));
- }
- return node;
-}
-
-static NODE*
-logop(type, left, right)
- enum node_type type;
- NODE *left, *right;
-{
- value_expr(left);
- return rb_node_newnode(type, cond(left), cond(right), 0);
-}
-
-static NODE *
-arg_blk_pass(node1, node2)
- NODE *node1;
- NODE *node2;
-{
- if (node2) {
- node2->nd_head = node1;
- return node2;
- }
- return node1;
-}
-
-static NODE*
-new_call(r,m,a)
- NODE *r;
- ID m;
- NODE *a;
-{
- if (a && nd_type(a) == NODE_BLOCK_PASS) {
- a->nd_iter = NEW_CALL(r,m,a->nd_head);
- return a;
- }
- return NEW_CALL(r,m,a);
-}
-
-static NODE*
-new_fcall(m,a)
- ID m;
- NODE *a;
-{
- if (a && nd_type(a) == NODE_BLOCK_PASS) {
- a->nd_iter = NEW_FCALL(m,a->nd_head);
- return a;
- }
- return NEW_FCALL(m,a);
-}
-
-static struct local_vars {
- ID *tbl;
- int nofree;
- int cnt;
- int dlev;
- struct local_vars *prev;
-} *lvtbl;
-
-static void
-local_push()
-{
- struct local_vars *local;
-
- local = ALLOC(struct local_vars);
- local->prev = lvtbl;
- local->nofree = 0;
- local->cnt = 0;
- local->tbl = 0;
- local->dlev = 0;
- lvtbl = local;
-}
-
-static void
-local_pop()
-{
- struct local_vars *local = lvtbl->prev;
-
- if (lvtbl->tbl) {
- if (!lvtbl->nofree) free(lvtbl->tbl);
- else lvtbl->tbl[0] = lvtbl->cnt;
- }
- free(lvtbl);
- lvtbl = local;
-}
-
-static ID*
-local_tbl()
-{
- lvtbl->nofree = 1;
- return lvtbl->tbl;
-}
-
-static int
-local_append(id)
- ID id;
-{
- if (lvtbl->tbl == 0) {
- lvtbl->tbl = ALLOC_N(ID, 4);
- lvtbl->tbl[0] = 0;
- lvtbl->tbl[1] = '_';
- lvtbl->tbl[2] = '~';
- lvtbl->cnt = 2;
- if (id == '_') return 0;
- if (id == '~') return 1;
- }
- else {
- REALLOC_N(lvtbl->tbl, ID, lvtbl->cnt+2);
- }
-
- lvtbl->tbl[lvtbl->cnt+1] = id;
- return lvtbl->cnt++;
-}
-
-static int
-local_cnt(id)
- ID id;
-{
- int cnt, max;
-
- if (id == 0) return lvtbl->cnt;
-
- for (cnt=1, max=lvtbl->cnt+1; cnt<max ;cnt++) {
- if (lvtbl->tbl[cnt] == id) return cnt-1;
- }
- return local_append(id);
-}
-
-static int
-local_id(id)
- ID id;
-{
- int i, max;
-
- if (lvtbl == 0) return Qfalse;
- for (i=3, max=lvtbl->cnt+1; i<max; i++) {
- if (lvtbl->tbl[i] == id) return Qtrue;
- }
- return Qfalse;
-}
-
-static void
-top_local_init()
-{
- local_push();
- lvtbl->cnt = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
- if (lvtbl->cnt > 0) {
- lvtbl->tbl = ALLOC_N(ID, lvtbl->cnt+3);
- MEMCPY(lvtbl->tbl, ruby_scope->local_tbl, ID, lvtbl->cnt+1);
- }
- else {
- lvtbl->tbl = 0;
- }
- if (ruby_dyna_vars)
- lvtbl->dlev = 1;
- else
- lvtbl->dlev = 0;
-}
-
-static void
-top_local_setup()
-{
- int len = lvtbl->cnt;
- int i;
-
- if (len > 0) {
- i = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
-
- if (i < len) {
- if (i == 0 || ruby_scope->flag == SCOPE_ALLOCA) {
- VALUE *vars = ALLOC_N(VALUE, len+1);
- if (ruby_scope->local_vars) {
- *vars++ = ruby_scope->local_vars[-1];
- MEMCPY(vars, ruby_scope->local_vars, VALUE, i);
- rb_mem_clear(vars+i, len-i);
- }
- else {
- *vars++ = 0;
- rb_mem_clear(vars, len);
- }
- ruby_scope->local_vars = vars;
- ruby_scope->flag |= SCOPE_MALLOC;
- }
- else {
- VALUE *vars = ruby_scope->local_vars-1;
- REALLOC_N(vars, VALUE, len+1);
- ruby_scope->local_vars = vars+1;
- rb_mem_clear(ruby_scope->local_vars+i, len-i);
- }
- if (ruby_scope->local_tbl && ruby_scope->local_vars[-1] == 0) {
- free(ruby_scope->local_tbl);
- }
- ruby_scope->local_vars[-1] = 0;
- ruby_scope->local_tbl = local_tbl();
- }
- }
- local_pop();
-}
-
-static struct RVarmap*
-dyna_push()
-{
- lvtbl->dlev++;
- return ruby_dyna_vars;
-}
-
-static void
-dyna_pop(vars)
- struct RVarmap* vars;
-{
- lvtbl->dlev--;
- ruby_dyna_vars = vars;
-}
-
-static int
-dyna_in_block()
-{
- return (lvtbl->dlev > 0);
-}
-
-static void
-cref_pop()
-{
- cur_cref = cur_cref->nd_next;
-}
-
-void
-rb_parser_append_print()
-{
- ruby_eval_tree =
- block_append(ruby_eval_tree,
- NEW_FCALL(rb_intern("print"),
- NEW_ARRAY(NEW_GVAR(rb_intern("$_")))));
-}
-
-void
-rb_parser_while_loop(chop, split)
- int chop, split;
-{
- if (split) {
- ruby_eval_tree =
- block_append(NEW_GASGN(rb_intern("$F"),
- NEW_CALL(NEW_GVAR(rb_intern("$_")),
- rb_intern("split"), 0)),
- ruby_eval_tree);
- }
- if (chop) {
- ruby_eval_tree =
- block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")),
- rb_intern("chop!"), 0), ruby_eval_tree);
- }
- ruby_eval_tree = NEW_OPT_N(ruby_eval_tree);
-}
-
-static struct {
- ID token;
- char *name;
-} op_tbl[] = {
- tDOT2, "..",
- tDOT3, "...",
- '+', "+",
- '-', "-",
- '+', "+(binary)",
- '-', "-(binary)",
- '*', "*",
- '/', "/",
- '%', "%",
- tPOW, "**",
- tUPLUS, "+@",
- tUMINUS, "-@",
- tUPLUS, "+(unary)",
- tUMINUS, "-(unary)",
- '|', "|",
- '^', "^",
- '&', "&",
- tCMP, "<=>",
- '>', ">",
- tGEQ, ">=",
- '<', "<",
- tLEQ, "<=",
- tEQ, "==",
- tEQQ, "===",
- tNEQ, "!=",
- tMATCH, "=~",
- tNMATCH, "!~",
- '!', "!",
- '~', "~",
- '!', "!(unary)",
- '~', "~(unary)",
- '!', "!@",
- '~', "~@",
- tAREF, "[]",
- tASET, "[]=",
- tLSHFT, "<<",
- tRSHFT, ">>",
- tCOLON2, "::",
- tCOLON3, "::",
- '`', "`",
- 0, 0,
-};
-
-static st_table *sym_tbl;
-static st_table *sym_rev_tbl;
-
-void
-Init_sym()
-{
- sym_tbl = st_init_strtable_with_size(200);
- sym_rev_tbl = st_init_numtable_with_size(200);
- rb_global_variable((VALUE*)&cur_cref);
- rb_global_variable((VALUE*)&lex_lastline);
-}
-
-ID
-rb_intern(name)
- const char *name;
-{
- static ID last_id = LAST_TOKEN;
- int id;
- int last;
-
- if (st_lookup(sym_tbl, name, &id))
- return id;
-
- id = 0;
- switch (name[0]) {
- case '$':
- id |= ID_GLOBAL;
- break;
- case '@':
- id |= ID_INSTANCE;
- break;
- default:
- if (name[0] != '_' && !ISALPHA(name[0]) && !ismbchar(name[0])) {
- /* operator */
- int i;
-
- for (i=0; op_tbl[i].token; i++) {
- if (*op_tbl[i].name == *name &&
- strcmp(op_tbl[i].name, name) == 0) {
- id = op_tbl[i].token;
- goto id_regist;
- }
- }
- }
-
- last = strlen(name)-1;
- if (name[last] == '=') {
- /* attribute assignment */
- char *buf = ALLOCA_N(char,last+1);
-
- strncpy(buf, name, last);
- buf[last] = '\0';
- id = rb_intern(buf);
- if (id > LAST_TOKEN) {
- id = rb_id_attrset(id);
- goto id_regist;
- }
- id |= ID_ATTRSET;
- }
- else if (ISUPPER(name[0])) {
- id = ID_CONST;
- }
- else {
- id = ID_LOCAL;
- }
- break;
- }
- id |= ++last_id << ID_SCOPE_SHIFT;
- id_regist:
- name = strdup(name);
- st_add_direct(sym_tbl, name, id);
- st_add_direct(sym_rev_tbl, id, name);
- return id;
-}
-
-char *
-rb_id2name(id)
- ID id;
-{
- char *name;
-
- if (id < LAST_TOKEN) {
- int i = 0;
-
- for (i=0; op_tbl[i].token; i++) {
- if (op_tbl[i].token == id)
- return op_tbl[i].name;
- }
- }
-
- if (st_lookup(sym_rev_tbl, id, &name))
- return name;
-
- if (is_attrset_id(id)) {
- char *res;
- ID id2;
-
- id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
- res = rb_id2name(id2);
-
- if (res) {
- char *buf = ALLOCA_N(char, strlen(res)+2);
-
- strcpy(buf, res);
- strcat(buf, "=");
- rb_intern(buf);
- return rb_id2name(id);
- }
- }
- return 0;
-}
-
-int
-rb_is_const_id(id)
- ID id;
-{
- if (is_const_id(id)) return Qtrue;
- return Qfalse;
-}
-
-int
-rb_is_instance_id(id)
- ID id;
-{
- if (is_instance_id(id)) return Qtrue;
- return Qfalse;
-}
-
-static void
-special_local_set(c, val)
- char c;
- VALUE val;
-{
- int cnt;
-
- top_local_init();
- cnt = local_cnt(c);
- top_local_setup();
- ruby_scope->local_vars[cnt] = val;
-}
-
-VALUE
-rb_backref_get()
-{
- if (ruby_scope->local_vars) {
- return ruby_scope->local_vars[1];
- }
- return Qnil;
-}
-
-void
-rb_backref_set(val)
- VALUE val;
-{
- if (ruby_scope->local_vars) {
- ruby_scope->local_vars[1] = val;
- }
- else {
- special_local_set('~', val);
- }
-}
-
-VALUE
-rb_lastline_get()
-{
- if (ruby_scope->local_vars) {
- return ruby_scope->local_vars[0];
- }
- return Qnil;
-}
-
-void
-rb_lastline_set(val)
- VALUE val;
-{
- if (ruby_scope->local_vars) {
- ruby_scope->local_vars[0] = val;
- }
- else {
- special_local_set('_', val);
- }
-}
diff --git a/parse.y b/parse.y
index ce97bdf605..7272692ad4 100644
--- a/parse.y
+++ b/parse.y
@@ -48,6 +48,7 @@ static enum lex_state {
EXPR_BEG, /* ignore newline, +/- is a sign. */
EXPR_MID, /* newline significant, +/- is a sign. */
EXPR_END, /* newline significant, +/- is a operator. */
+ EXPR_PAREN, /* almost like EXPR_END, `do' works as `{'. */
EXPR_ARG, /* newline significant, +/- is a operator. */
EXPR_FNAME, /* ignore newline, no reserved words. */
EXPR_DOT, /* right after `.' or `::', no reserved words. */
@@ -139,6 +140,7 @@ static void top_local_setup();
kRETRY
kIN
kDO
+ kDO2
kRETURN
kYIELD
kSUPER
@@ -1264,6 +1266,19 @@ brace_block : '{'
fixpos($$, $3?$3:$4);
dyna_pop($<vars>2);
}
+ | kDO2
+ {
+ $<vars>$ = dyna_push();
+ }
+ opt_block_var
+ compstmt
+ kEND
+ {
+ $$ = NEW_ITER($3, 0, $4);
+ fixpos($$, $3?$3:$4);
+ dyna_pop($<vars>2);
+ }
+
generic_call : tIDENTIFIER
{
@@ -1290,12 +1305,12 @@ block_call : generic_call do_block
fixpos($$, $2);
}
-method_call : operation '(' opt_call_args ')'
+method_call : operation '(' opt_call_args close_paren
{
$$ = new_fcall($1, $3);
fixpos($$, $3);
}
- | primary '.' operation2 '(' opt_call_args ')'
+ | primary '.' operation2 '(' opt_call_args close_paren
{
value_expr($1);
$$ = new_call($1, $3, $5);
@@ -1307,7 +1322,7 @@ method_call : operation '(' opt_call_args ')'
$$ = new_call($1, $3, 0);
fixpos($$, $1);
}
- | primary tCOLON2 operation2 '(' opt_call_args ')'
+ | primary tCOLON2 operation2 '(' opt_call_args close_paren
{
value_expr($1);
$$ = new_call($1, $3, $5);
@@ -1318,7 +1333,7 @@ method_call : operation '(' opt_call_args ')'
value_expr($1);
$$ = new_call($1, $3, 0);
}
- | kSUPER '(' opt_call_args ')'
+ | kSUPER '(' opt_call_args close_paren
{
if (!compile_for_eval && !cur_mid &&
!in_single && !in_defined)
@@ -1333,6 +1348,10 @@ method_call : operation '(' opt_call_args ')'
$$ = NEW_ZSUPER();
}
+close_paren : ')'
+ {
+ lex_state = EXPR_PAREN;
+ }
stmt_rhs : block_call
| command_call
@@ -1701,6 +1720,9 @@ yycompile(f)
n = yyparse();
compile_for_eval = 0;
ruby_in_compile = 0;
+ class_nest = 0;
+ in_single = 0;
+ cur_mid = 0;
if (n == 0) return ruby_eval_tree;
return 0;
@@ -1909,7 +1931,7 @@ read_escape()
return c;
case 'b': /* backspace */
- return '\b';
+ return '\010';
case 's': /* space */
return ' ';
@@ -2540,7 +2562,8 @@ yylex()
case '<':
c = nextc();
if (c == '<' &&
- lex_state != EXPR_END && lex_state != EXPR_CLASS &&
+ lex_state != EXPR_END && lex_state != EXPR_PAREN &&
+ lex_state != EXPR_CLASS &&
(lex_state != EXPR_ARG || space_seen)) {
int c2 = nextc();
int indent = 0;
@@ -2599,7 +2622,7 @@ yylex()
return parse_qstring(c,0);
case '?':
- if (lex_state == EXPR_END) {
+ if (lex_state == EXPR_END || lex_state == EXPR_PAREN) {
lex_state = EXPR_BEG;
return '?';
}
@@ -2891,7 +2914,7 @@ yylex()
return tCOLON2;
}
pushback(c);
- if (lex_state == EXPR_END || ISSPACE(c)) {
+ if (lex_state == EXPR_END || lex_state == EXPR_PAREN || ISSPACE(c)) {
lex_state = EXPR_BEG;
return ':';
}
@@ -2973,7 +2996,9 @@ yylex()
return c;
case '{':
- if (lex_state != EXPR_END && lex_state != EXPR_ARG)
+ if (lex_state != EXPR_END &&
+ lex_state != EXPR_PAREN &&
+ lex_state != EXPR_ARG)
c = tLBRACE;
lex_state = EXPR_BEG;
return c;
@@ -3186,6 +3211,9 @@ yylex()
if (state == EXPR_FNAME) {
yylval.id = rb_intern(kw->name);
}
+ if (state == EXPR_PAREN && kw->id[0] == kDO) {
+ return kDO2;
+ }
return kw->id[state != EXPR_BEG];
}
}
diff --git a/regex.c b/regex.c
index d9784315f1..ba5e115f99 100644
--- a/regex.c
+++ b/regex.c
@@ -442,7 +442,6 @@ re_set_syntax(syntax)
do { \
if (current_mbctype == MBCTYPE_UTF8) { \
int n = mbclen(c) - 1; \
- int c1; \
c &= (1<<(BYTEWIDTH-2-n)) - 1; \
while (n--) { \
c = c << 6 | *p++ & ((1<<6)-1); \
@@ -1074,6 +1073,9 @@ read_backslash(c)
case 'a':
return '\007';
+ case 'b':
+ return '\010';
+
case 'e':
return '\033';
}
@@ -3597,8 +3599,7 @@ re_match(bufp, string_arg, size, pos, regs)
not = is_in_list(c, p);
if (!not && cc != c) {
- part = 1;
- not = is_in_list(cc, p);
+ part = not = is_in_list(cc, p);
}
if (*(p - 1) == (unsigned char)charset_not) {
not = !not;
diff --git a/regex.h b/regex.h
index 6af3ace12d..3e0ebd26a7 100644
--- a/regex.h
+++ b/regex.h
@@ -83,7 +83,6 @@ extern const unsigned char *re_mbctab;
#if defined(__STDC__)
void re_mbcinit (int);
#else
-extern unsigned char *re_mbctab;
void re_mbcinit ();
#endif
diff --git a/ruby.h b/ruby.h
index e904f9fe65..86494a69ef 100644
--- a/ruby.h
+++ b/ruby.h
@@ -19,12 +19,6 @@ extern "C" {
#include "config.h"
#include "defines.h"
-#if 0
-#ifndef RUBY_RENAME
-#include "rename2.h"
-#endif
-#endif
-
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
@@ -78,7 +72,7 @@ extern "C" {
#endif
#if defined(__CYGWIN32__)
-#if defined(DLLIMPORT)
+#if defined(USEIMPORTLIB)
#include "import.h"
#else
#if !defined(__CYGWIN__)
@@ -181,7 +175,7 @@ void rb_secure _((int));
long rb_num2long _((VALUE));
unsigned long rb_num2ulong _((VALUE));
-#define NUM2LONG(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2long((VALUE)x))
+#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x))
#define NUM2ULONG(x) rb_num2ulong((VALUE)x)
#if SIZEOF_INT < SIZEOF_LONG
int rb_num2int _((VALUE));
@@ -205,8 +199,8 @@ char *rb_str2cstr _((VALUE,int*));
#define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING(x)->len>=1))?\
- RSTRING(x)->ptr[0]:(char)NUM2INT(x))
-#define CHR2FIX(x) INT2FIX((int)x)
+ RSTRING(x)->ptr[0]:(char)(NUM2INT(x)&0xff))
+#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
VALUE rb_newobj _((void));
#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
diff --git a/rubyio.h b/rubyio.h
index 8bb75b6972..dadc4d1433 100644
--- a/rubyio.h
+++ b/rubyio.h
@@ -50,6 +50,7 @@ typedef struct OpenFile {
FILE *rb_fopen _((const char*, const char*));
FILE *rb_fdopen _((int, const char*));
+int rb_getc _((FILE*));
int rb_io_mode_flags _((const char*));
void rb_io_check_writable _((OpenFile*));
void rb_io_check_readable _((OpenFile*));
diff --git a/sample/README b/sample/README
index 90ac0c7220..1bdc85f32b 100644
--- a/sample/README
+++ b/sample/README
@@ -5,6 +5,8 @@ cbreak.rb no echo done by ioctl
clnt.rb socket client
dbmtest.rb test for dbm
dir.rb directory access
+dualstack-fetch.rb IPv6 demo
+dualstack-httpd.rb IPv6 demo
dstore.rb object database on dbm
eval.rb simple evaluator
export.rb method access example
@@ -40,6 +42,7 @@ rbc.rb interactive ruby, to be removed by irb
rcs.awk random character stereogram (AWK)
rcs.rb random character stereogram (Ruby)
rcs.dat data for random character stereogram
+rd2html.rb rd (Ruby Document) to HTML translator
regx.rb regular expression tester
ruby-mode.el ruby mode for emacs
rubydb2x.el ruby debugger support for emacs 19.2x or before
@@ -48,13 +51,6 @@ sieve.rb sieve of Eratosthenes
svr.rb socket server
test.rb test suite used by `make test'
time.rb /usr/bin/time clone
-tkbiff.rb mail notifier using Tk
-tkbrowse.rb directory browser using Tk
-tkdialog.rb dialog example
-tkfrom.rb scan mail spool using Tk
-tkhello.rb simple Tk example
-tkline.rb simple Tk example
-tktimer.rb stopwatch
trojan.rb simple tool to find file that may be trojan horse.
tsvr.rb socket server using thread
uumerge.rb merge files and uudecode them
diff --git a/string.c b/string.c
index 4fe1bd5e42..6c094848ef 100644
--- a/string.c
+++ b/string.c
@@ -2439,9 +2439,17 @@ rb_str_oct(str)
{
int base = 8;
- if (RSTRING(str)->len > 2 && RSTRING(str)->ptr[0] == '0' &&
- (RSTRING(str)->ptr[1] == 'x' || RSTRING(str)->ptr[1] == 'X')) {
- base = 16;
+ if (RSTRING(str)->len > 2 && RSTRING(str)->ptr[0] == '0') {
+ switch (RSTRING(str)->ptr[1]) {
+ case 'x':
+ case 'X':
+ base = 16;
+ break;
+ case 'b':
+ case 'B':
+ base = 2;
+ break;
+ }
}
return rb_str2inum(RSTRING(str)->ptr, base);
}
diff --git a/variable.c b/variable.c
index 70360a9f31..0edb280da2 100644
--- a/variable.c
+++ b/variable.c
@@ -1179,11 +1179,10 @@ rb_const_set(klass, id, val)
RCLASS(klass)->iv_tbl = st_init_numtable();
}
else if (st_lookup(RCLASS(klass)->iv_tbl, id, 0)) {
- rb_raise(rb_eNameError, "already initialized constant %s",
- rb_id2name(id));
+ rb_warn("already initialized constant %s", rb_id2name(id));
}
- st_add_direct(RCLASS(klass)->iv_tbl, id, val);
+ st_insert(RCLASS(klass)->iv_tbl, id, val);
}
void
diff --git a/version.c b/version.c
index 28970cd4fe..57039d5cfe 100644
--- a/version.c
+++ b/version.c
@@ -18,20 +18,29 @@
void
Init_version()
{
- rb_define_global_const("VERSION", rb_str_new2(RUBY_VERSION));
- rb_define_global_const("RELEASE_DATE", rb_str_new2(RUBY_RELEASE_DATE));
- rb_define_global_const("PLATFORM", rb_str_new2(RUBY_PLATFORM));
+ VALUE v = rb_str_new2(RUBY_VERSION);
+ VALUE d = rb_str_new2(RUBY_RELEASE_DATE);
+ VALUE p = rb_str_new2(RUBY_PLATFORM);
+
+ rb_define_global_const("RUBY_VERSION", v);
+ rb_define_global_const("RUBY_RELEASE_DATE", d);
+ rb_define_global_const("RUBY_PLATFORM", p);
+
+ /* obsolete constants */
+ rb_define_global_const("VERSION", v);
+ rb_define_global_const("RELEASE_DATE", d);
+ rb_define_global_const("PLATFORM", p);
}
void
ruby_show_version()
{
- fprintf(stderr, "ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
+ printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
}
void
ruby_show_copyright()
{
- fprintf(stderr, "ruby - Copyright (C) 1993-1999 Yukihiro Matsumoto\n");
+ printf("ruby - Copyright (C) 1993-1999 Yukihiro Matsumoto\n");
exit(0);
}
diff --git a/version.h b/version.h
index b0b6fbc137..379236b7f5 100644
--- a/version.h
+++ b/version.h
@@ -1,3 +1,4 @@
#define RUBY_VERSION "1.3.4"
-#define RUBY_RELEASE_DATE "1999-06-01"
-#define RUBY_RELEASE_CODE 19990601
+#define RUBY_RELEASE_DATE "1999-06-04"
+#define RUBY_VERSION_CODE 134
+#define RUBY_RELEASE_CODE 19990604