git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-07 06:59:46 +00:00
Родитель a509e67c5a
Коммит 6fc752bf7d
11 изменённых файлов: 111 добавлений и 78 удалений

Просмотреть файл

@ -1,7 +1,41 @@
Mon Sep 4 12:58:31 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
Wed Sep 6 17:06:59 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* stable version 1.6.0 released.
Thu Sep 7 14:17:51 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_cat): should work even for concatenating same
string.
Wed Sep 6 17:06:38 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* variable.c (rb_cvar_declare): should check superclass's class
variable first.
Wed Sep 6 10:42:02 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* misc/ruby-mode.el (ruby-calculate-indent): shift continuing line
if previous line ends with modifier keyword.
* misc/ruby-mode.el (ruby-parse-region): should not give up if
modifiers are at the end of line.
* misc/ruby-mode.el (ruby-expr-beg): indented wrongly if modified
statement was size 1.
Wed Sep 6 10:41:19 2000 Kenichi Komiya <kom@mail1.accsnet.ne.jp>
* misc/ruby-mode.el (ruby-parse-region): modifier was not handled
well on emacs19.
Tue Sep 5 17:10:12 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_to_s): fixed zone string UTC for utc time object.
Tue Sep 5 00:26:06 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* regex.c (re_search): range worked wrongly on bm_search().
Mon Sep 4 13:40:40 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* configure.in: renamed libruby.a to libruby.{cygwin,mingw32}.a

1
ToDo
Просмотреть файл

@ -91,6 +91,7 @@ Standard Libraries
* introduce Boolean class; super of TrueClass, FalseClass
* Process::waitall [ruby-talk:4557]
* synchronized method - synchronized{...}, synchronized :foo, :bar
* move Time::times to Process.
Extension Libraries

Просмотреть файл

@ -51,7 +51,14 @@ class CGI
@dbman = dbman::new(self, option)
request.instance_eval do
@output_hidden = {session_key => id}
@output_cookies = [Cookie::new(session_key,id)]
@output_cookies = [
Cookie::new(session_key => id,
"path" => if ENV["SCRIPT_NAME"] then
File::dirname(ENV["SCRIPT_NAME"])
else
""
end)
]
end
ObjectSpace::define_finalizer(self, Session::callback(@dbman))
end

Просмотреть файл

@ -32,7 +32,7 @@
# finalize all dependants connected by dependency R_*(obj, dependtant).
# finalize_by_dependant(dependant, method = :finalize)
# finalize the dependant connected by dependency R_method(*, dependtant).
# fainalize_all_by_dependant(dependant)
# finalize_all_by_dependant(dependant)
# finalize all dependants connected by dependency R_*(*, dependant).
# finalize_all
# finalize all dependency registered to the Finalizer.
@ -138,7 +138,7 @@ module Finalizer
end
# finalize all dependants connected by dependency R_*(*, dependtant)
def fainalize_all_by_dependant(dependant)
def finalize_all_by_dependant(dependant)
for id in @dependency.keys
finalize_all_dependency(id, dependant)
end
@ -190,7 +190,7 @@ module Finalizer
module_function :finalize_dependency
module_function :finalize_all_dependency
module_function :finalize_by_dependant
module_function :fainalize_all_by_dependant
module_function :finalize_all_by_dependant
module_function :finalize_all
module_function :safe

Просмотреть файл

@ -37,6 +37,10 @@
"and\\|or\\|not"
)
(defconst ruby-block-hanging-re
(concat ruby-modifier-re "\\|" ruby-block-op-re)
)
(defconst ruby-block-end-re "end")
(defconst ruby-delimiter
@ -224,30 +228,30 @@ The variable ruby-indent-level controls the amount of indentation.
(defun ruby-expr-beg (&optional option)
(save-excursion
(if (looking-at "\\?")
(progn
(or (bolp) (forward-char -1))
(not (looking-at "\\sw")))
(store-match-data nil)
(skip-chars-backward " \t")
(store-match-data nil)
(skip-chars-backward " \t")
(cond
((bolp) t)
((looking-at "\\?")
(or (bolp) (forward-char -1))
(or (bolp)
(looking-at ruby-operator-re)
(looking-at "[\\[({]")
(not (looking-at "\\sw")))
(t
(forward-char -1)
(or (looking-at ruby-operator-re)
(looking-at "[\\[({,;]")
(and (not (eq option 'modifier))
(looking-at "[!?]"))
(and (looking-at ruby-symbol-re)
(skip-chars-backward ruby-symbol-chars)
(if (and (not (eq option 'modifier)) (bolp))
t
(if (or (looking-at ruby-block-beg-re)
(looking-at ruby-block-op-re)
(looking-at ruby-block-mid-re))
(progn
(goto-char (match-end 0))
(looking-at "\\>"))
(and (not (eq option 'expr-arg))
(looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]")))))))))
(cond
((or (looking-at ruby-block-beg-re)
(looking-at ruby-block-op-re)
(looking-at ruby-block-mid-re))
(goto-char (match-end 0))
(looking-at "\\>"))
(t
(and (not (eq option 'expr-arg))
(looking-at "[a-zA-Z][a-zA-z0-9_]* +/[^ \t]"))))))))))
(defun ruby-parse-region (start end)
(let ((indent-point end)
@ -375,11 +379,12 @@ The variable ruby-indent-level controls the amount of indentation.
(setq depth (1+ depth))))
(goto-char (match-end 0)))
((looking-at ruby-block-beg-re)
(and
(or (not (looking-at "do\\>[^_]"))
(save-excursion
(back-to-indentation)
(not (looking-at ruby-non-block-do-re))))
(and
(save-match-data
(or (not (looking-at "do\\>[^_]"))
(save-excursion
(back-to-indentation)
(not (looking-at ruby-non-block-do-re)))))
(or (bolp)
(progn
(forward-char -1)
@ -392,42 +397,9 @@ The variable ruby-indent-level controls the amount of indentation.
(not (eq ?! w))
(not (eq ?? w))
(skip-chars-forward " \t")
(if (not (eolp))
(progn
(goto-char (match-beginning 0))
(if (looking-at ruby-modifier-re)
(ruby-expr-beg 'modifier)
t))
t)
(goto-char pnt)
(setq nest (cons (cons nil pnt) nest))
(setq depth (1+ depth)))
(goto-char pnt))
((looking-at ruby-block-beg-re)
(and
(or (not (looking-at "do\\>[^_]"))
(save-excursion
(back-to-indentation)
(not (looking-at ruby-non-block-do-re))))
(or (bolp)
(progn
(forward-char -1)
(setq w (char-after (point)))
(not (or (eq ?_ w)
(eq ?. w)))))
(goto-char pnt)
(setq w (char-after (point)))
(not (eq ?_ w))
(not (eq ?! w))
(not (eq ?? w))
(skip-chars-forward " \t")
(if (not (eolp))
(progn
(goto-char (match-beginning 0))
(if (looking-at ruby-modifier-re)
(ruby-expr-beg 'modifier)
t))
t)
(goto-char (match-beginning 0))
(or (not (looking-at ruby-modifier-re))
(ruby-expr-beg 'modifier))
(goto-char pnt)
(setq nest (cons (cons nil pnt) nest))
(setq depth (1+ depth)))
@ -560,7 +532,8 @@ The variable ruby-indent-level controls the amount of indentation.
(and
(or (and (looking-at ruby-symbol-re)
(skip-chars-backward ruby-symbol-chars)
(looking-at ruby-block-op-re)
(looking-at ruby-block-hanging-re)
(not (eq (point) (nth 3 state)))
(save-excursion
(goto-char (match-end 0))
(not (looking-at "[a-z_]"))))

1
node.h
Просмотреть файл

@ -101,7 +101,6 @@ enum node_type {
NODE_SCLASS,
NODE_COLON2,
NODE_COLON3,
NODE_CNAME,
NODE_CREF,
NODE_DOT2,
NODE_DOT3,

Просмотреть файл

@ -3137,7 +3137,7 @@ re_search(bufp, string, size, startpos, range, regs)
/* If the search isn't to be a backwards one, don't waste time in a
search for a pattern that must be anchored. */
if (bufp->used>0) {
if (bufp->used > 0) {
switch ((enum regexpcode)bufp->buffer[0]) {
case begbuf:
begbuf_match:
@ -3196,6 +3196,7 @@ re_search(bufp, string, size, startpos, range, regs)
if (range > 0 && (bufp->options & RE_OPTIMIZE_EXACTN)) {
startpos += pos;
range -= pos;
if (range < 0) return -1;
}
}

Просмотреть файл

@ -427,10 +427,18 @@ rb_str_cat(str, ptr, len)
long len;
{
if (len > 0) {
int poffset = -1;
rb_str_modify(str);
if (RSTRING(str)->ptr <= ptr &&
ptr < RSTRING(str)->ptr + RSTRING(str)->len) {
poffset = ptr - RSTRING(str)->ptr;
}
REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + len + 1);
if (ptr)
if (ptr) {
if (poffset >= 0) ptr = RSTRING(str)->ptr + poffset;
memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
}
RSTRING(str)->len += len;
RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */
}

7
time.c
Просмотреть файл

@ -633,13 +633,10 @@ time_to_s(time)
if (tobj->tm_got == 0) {
time_get_tm(time, tobj->gmt);
}
#ifndef HAVE_TM_ZONE
if (tobj->gmt == 1) {
len = strftime(buf, 128, "%a %b %d %H:%M:%S GMT %Y", &tobj->tm);
len = strftime(buf, 128, "%a %b %d %H:%M:%S UTC %Y", &tobj->tm);
}
else
#endif
{
else {
len = strftime(buf, 128, "%a %b %d %H:%M:%S %Z %Y", &tobj->tm);
}
return rb_str_new(buf, len);

Просмотреть файл

@ -1332,11 +1332,11 @@ rb_cvar_set(klass, id, val)
{
VALUE tmp;
if (!OBJ_TAINTED(klass) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify class variable");
tmp = klass;
while (tmp) {
if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) {
if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify class variable");
st_insert(RCLASS(tmp)->iv_tbl,id,val);
return;
}
@ -1353,6 +1353,19 @@ rb_cvar_declare(klass, id, val)
ID id;
VALUE val;
{
VALUE tmp;
tmp = klass;
while (tmp) {
if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) {
if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify class variable");
st_insert(RCLASS(tmp)->iv_tbl,id,val);
return;
}
tmp = RCLASS(tmp)->super;
}
mod_av_set(klass, id, val, "class variable", Qfalse);
}

Просмотреть файл

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.0"
#define RUBY_RELEASE_DATE "2000-09-04"
#define RUBY_RELEASE_DATE "2000-09-07"
#define RUBY_VERSION_CODE 160
#define RUBY_RELEASE_CODE 20000904
#define RUBY_RELEASE_CODE 20000907