2000-05-01 13:42:38 +04:00
|
|
|
/**********************************************************************
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
parse.y -
|
|
|
|
|
2004-09-12 19:23:41 +04:00
|
|
|
$Author$
|
1998-01-16 15:13:05 +03:00
|
|
|
created at: Fri May 28 18:02:42 JST 1993
|
|
|
|
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2000-05-01 13:42:38 +04:00
|
|
|
**********************************************************************/
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
%{
|
|
|
|
|
|
|
|
#define YYDEBUG 1
|
2005-10-08 13:58:25 +04:00
|
|
|
#define YYERROR_VERBOSE 1
|
|
|
|
#define YYSTACK_USE_ALLOCA 0
|
2002-05-29 09:20:39 +04:00
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
#include "ruby/ruby.h"
|
|
|
|
#include "ruby/st.h"
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
#include "ruby/encoding.h"
|
* include/ruby/node.h, node.h: move node.h from include path.
This change stop to install node.h beacuase of saving ABI
(node.h will be changed. Extensions should not depends on
this file).
* blockinlining.c, class.c, compile.c, debug.h, enum.c,
gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
vm.c, vm_core.h, vm_dump.c: ditto.
* ext/ripper/depend: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 23:52:31 +04:00
|
|
|
#include "node.h"
|
2008-10-17 14:46:23 +04:00
|
|
|
#include "parse.h"
|
2007-12-18 14:26:24 +03:00
|
|
|
#include "id.h"
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
#include "regenc.h"
|
1998-01-16 15:13:05 +03:00
|
|
|
#include <stdio.h>
|
1999-08-13 09:45:20 +04:00
|
|
|
#include <errno.h>
|
2001-05-16 13:05:54 +04:00
|
|
|
#include <ctype.h>
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
|
|
|
|
|
2005-10-08 13:58:25 +04:00
|
|
|
#define YYMALLOC(size) rb_parser_malloc(parser, size)
|
|
|
|
#define YYREALLOC(ptr, size) rb_parser_realloc(parser, ptr, size)
|
|
|
|
#define YYCALLOC(nelem, size) rb_parser_calloc(parser, nelem, size)
|
|
|
|
#define YYFREE(ptr) rb_parser_free(parser, ptr)
|
|
|
|
#define malloc YYMALLOC
|
|
|
|
#define realloc YYREALLOC
|
|
|
|
#define calloc YYCALLOC
|
|
|
|
#define free YYFREE
|
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
#ifndef RIPPER
|
|
|
|
static ID register_symid(ID, const char *, long, rb_encoding *);
|
|
|
|
#define REGISTER_SYMID(id, name) register_symid(id, name, strlen(name), enc)
|
|
|
|
#include "id.c"
|
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-12-24 11:53:56 +03:00
|
|
|
#define is_notop_id(id) ((id)>tLAST_TOKEN)
|
1999-11-17 10:30:37 +03:00
|
|
|
#define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
|
|
|
|
#define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
|
|
|
|
#define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
|
|
|
|
#define is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET)
|
1999-12-14 09:50:43 +03:00
|
|
|
#define is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST)
|
2000-03-23 11:37:35 +03:00
|
|
|
#define is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS)
|
2002-10-23 14:17:30 +04:00
|
|
|
#define is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-09-13 13:36:28 +04:00
|
|
|
#define is_asgn_or_id(id) ((is_notop_id(id)) && \
|
|
|
|
(((id)&ID_SCOPE_MASK) == ID_GLOBAL || \
|
|
|
|
((id)&ID_SCOPE_MASK) == ID_INSTANCE || \
|
|
|
|
((id)&ID_SCOPE_MASK) == ID_CLASS))
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
enum lex_state_e {
|
1998-01-16 15:13:05 +03:00
|
|
|
EXPR_BEG, /* ignore newline, +/- is a sign. */
|
2008-12-13 02:59:36 +03:00
|
|
|
EXPR_END, /* newline significant, +/- is an operator. */
|
2007-04-20 13:38:16 +04:00
|
|
|
EXPR_ENDARG, /* ditto, and unbound braces. */
|
2008-12-13 02:59:36 +03:00
|
|
|
EXPR_ARG, /* newline significant, +/- is an operator. */
|
|
|
|
EXPR_CMDARG, /* newline significant, +/- is an operator. */
|
|
|
|
EXPR_MID, /* newline significant, +/- is an operator. */
|
1999-08-13 09:45:20 +04:00
|
|
|
EXPR_FNAME, /* ignore newline, no reserved words. */
|
|
|
|
EXPR_DOT, /* right after `.' or `::', no reserved words. */
|
1999-01-20 07:59:39 +03:00
|
|
|
EXPR_CLASS, /* immediate after `class', no here document. */
|
2008-07-01 12:27:58 +04:00
|
|
|
EXPR_VALUE /* alike EXPR_BEG but label is disallowed. */
|
2004-09-12 19:21:49 +04:00
|
|
|
};
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-03-11 07:27:11 +03:00
|
|
|
typedef VALUE stack_type;
|
2001-01-29 08:10:42 +03:00
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
# define BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1))
|
2005-01-05 11:00:50 +03:00
|
|
|
# define BITSTACK_POP(stack) (stack = stack >> 1)
|
2004-09-17 13:24:13 +04:00
|
|
|
# define BITSTACK_LEXPOP(stack) (stack = (stack >> 1) | (stack & 1))
|
|
|
|
# define BITSTACK_SET_P(stack) (stack&1)
|
2003-10-23 08:44:04 +04:00
|
|
|
|
|
|
|
#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, n)
|
|
|
|
#define COND_POP() BITSTACK_POP(cond_stack)
|
|
|
|
#define COND_LEXPOP() BITSTACK_LEXPOP(cond_stack)
|
|
|
|
#define COND_P() BITSTACK_SET_P(cond_stack)
|
2000-09-04 12:24:09 +04:00
|
|
|
|
2003-10-23 08:44:04 +04:00
|
|
|
#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, n)
|
|
|
|
#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
|
|
|
|
#define CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack)
|
|
|
|
#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
|
2001-01-26 08:02:19 +03:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
struct vtable {
|
2004-10-02 15:34:13 +04:00
|
|
|
ID *tbl;
|
2006-12-31 18:02:22 +03:00
|
|
|
int pos;
|
|
|
|
int capa;
|
|
|
|
struct vtable *prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct local_vars {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
struct vtable *args;
|
|
|
|
struct vtable *vars;
|
2004-10-02 15:34:13 +04:00
|
|
|
struct local_vars *prev;
|
|
|
|
};
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
#define DVARS_INHERIT ((void*)1)
|
|
|
|
#define DVARS_TOPSCOPE NULL
|
|
|
|
#define DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl))
|
2007-05-10 10:08:20 +04:00
|
|
|
#define POINTER_P(val) ((VALUE)(val) & ~(VALUE)3)
|
2006-12-31 18:02:22 +03:00
|
|
|
|
|
|
|
static int
|
2007-05-10 10:08:20 +04:00
|
|
|
vtable_size(const struct vtable *tbl)
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
|
|
|
if (POINTER_P(tbl)) {
|
|
|
|
return tbl->pos;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define VTBL_DEBUG 0
|
|
|
|
|
|
|
|
static struct vtable *
|
|
|
|
vtable_alloc(struct vtable *prev)
|
|
|
|
{
|
|
|
|
struct vtable *tbl = ALLOC(struct vtable);
|
|
|
|
tbl->pos = 0;
|
|
|
|
tbl->capa = 8;
|
|
|
|
tbl->tbl = ALLOC_N(ID, tbl->capa);
|
|
|
|
tbl->prev = prev;
|
* compile.c (iseq_compile_each), gc.c (assign_heap_slot),
(gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
(thread_start_func_2, blocking_region_begin, blocking_region_end),
(rb_thread_kill), thread_pthread.c (native_thread_create),
(ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
(vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
(vm_call0): use void pointer for %p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 07:33:55 +03:00
|
|
|
if (VTBL_DEBUG) printf("vtable_alloc: %p\n", (void *)tbl);
|
2006-12-31 18:02:22 +03:00
|
|
|
return tbl;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
vtable_free(struct vtable *tbl)
|
|
|
|
{
|
* compile.c (iseq_compile_each), gc.c (assign_heap_slot),
(gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
(thread_start_func_2, blocking_region_begin, blocking_region_end),
(rb_thread_kill), thread_pthread.c (native_thread_create),
(ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
(vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
(vm_call0): use void pointer for %p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 07:33:55 +03:00
|
|
|
if (VTBL_DEBUG)printf("vtable_free: %p\n", (void *)tbl);
|
2006-12-31 18:02:22 +03:00
|
|
|
if (POINTER_P(tbl)) {
|
|
|
|
if (tbl->tbl) {
|
|
|
|
xfree(tbl->tbl);
|
|
|
|
}
|
2008-07-30 17:19:34 +04:00
|
|
|
xfree(tbl);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
vtable_add(struct vtable *tbl, ID id)
|
|
|
|
{
|
|
|
|
if (!POINTER_P(tbl)) {
|
* compile.c (iseq_compile_each), gc.c (assign_heap_slot),
(gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
(thread_start_func_2, blocking_region_begin, blocking_region_end),
(rb_thread_kill), thread_pthread.c (native_thread_create),
(ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
(vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
(vm_call0): use void pointer for %p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 07:33:55 +03:00
|
|
|
rb_bug("vtable_add: vtable is not allocated (%p)", (void *)tbl);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
* compile.c (iseq_compile_each), gc.c (assign_heap_slot),
(gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add),
proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all),
(thread_start_func_2, blocking_region_begin, blocking_region_end),
(rb_thread_kill), thread_pthread.c (native_thread_create),
(ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c
(vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state),
(vm_call0): use void pointer for %p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 07:33:55 +03:00
|
|
|
if (VTBL_DEBUG) printf("vtable_add: %p, %s\n", (void *)tbl, rb_id2name(id));
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
if (tbl->pos == tbl->capa) {
|
|
|
|
tbl->capa = tbl->capa * 2;
|
|
|
|
REALLOC_N(tbl->tbl, ID, tbl->capa);
|
|
|
|
}
|
|
|
|
tbl->tbl[tbl->pos++] = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2007-05-10 10:08:20 +04:00
|
|
|
vtable_included(const struct vtable * tbl, ID id)
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (POINTER_P(tbl)) {
|
|
|
|
for (i = 0; i < tbl->pos; i++) {
|
|
|
|
if (tbl->tbl[i] == id) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
2008-08-30 11:29:41 +04:00
|
|
|
typedef struct token_info {
|
2008-08-30 13:17:47 +04:00
|
|
|
const char *token;
|
2008-08-30 11:29:41 +04:00
|
|
|
int linenum;
|
|
|
|
int column;
|
|
|
|
int nonspc;
|
|
|
|
struct token_info *next;
|
|
|
|
} token_info;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
#endif
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
/*
|
|
|
|
Structure of Lexer Buffer:
|
|
|
|
|
2004-09-20 07:03:12 +04:00
|
|
|
lex_pbeg tokp lex_p lex_pend
|
|
|
|
| | | |
|
|
|
|
|-----------+--------------+------------|
|
|
|
|
|<------------>|
|
|
|
|
token
|
2004-09-17 13:24:13 +04:00
|
|
|
*/
|
|
|
|
struct parser_params {
|
2007-12-25 15:34:21 +03:00
|
|
|
int is_ripper;
|
2005-11-29 17:57:18 +03:00
|
|
|
NODE *heap;
|
|
|
|
|
2008-08-14 12:46:23 +04:00
|
|
|
YYSTYPE *parser_yylval;
|
2004-09-17 13:24:13 +04:00
|
|
|
VALUE eofp;
|
|
|
|
|
|
|
|
NODE *parser_lex_strterm;
|
|
|
|
enum lex_state_e parser_lex_state;
|
|
|
|
stack_type parser_cond_stack;
|
|
|
|
stack_type parser_cmdarg_stack;
|
|
|
|
int parser_class_nest;
|
2005-08-12 12:13:28 +04:00
|
|
|
int parser_paren_nest;
|
|
|
|
int parser_lpar_beg;
|
2004-09-17 13:24:13 +04:00
|
|
|
int parser_in_single;
|
|
|
|
int parser_in_def;
|
|
|
|
int parser_compile_for_eval;
|
|
|
|
VALUE parser_cur_mid;
|
|
|
|
int parser_in_defined;
|
|
|
|
char *parser_tokenbuf;
|
|
|
|
int parser_tokidx;
|
|
|
|
int parser_toksiz;
|
|
|
|
VALUE parser_lex_input;
|
|
|
|
VALUE parser_lex_lastline;
|
2007-11-09 17:33:18 +03:00
|
|
|
VALUE parser_lex_nextline;
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *parser_lex_pbeg;
|
|
|
|
const char *parser_lex_p;
|
|
|
|
const char *parser_lex_pend;
|
2004-09-17 13:24:13 +04:00
|
|
|
int parser_heredoc_end;
|
|
|
|
int parser_command_start;
|
2008-08-04 11:48:52 +04:00
|
|
|
NODE *parser_deferred_nodes;
|
2009-05-27 18:00:40 +04:00
|
|
|
long parser_lex_gets_ptr;
|
2005-09-25 04:39:22 +04:00
|
|
|
VALUE (*parser_lex_gets)(struct parser_params*,VALUE);
|
2004-10-02 15:34:13 +04:00
|
|
|
struct local_vars *parser_lvtbl;
|
2005-07-13 17:44:21 +04:00
|
|
|
int parser_ruby__end__seen;
|
2005-11-30 17:52:30 +03:00
|
|
|
int line_count;
|
|
|
|
int has_shebang;
|
2007-12-25 15:34:21 +03:00
|
|
|
char *parser_ruby_sourcefile; /* current source file */
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
int parser_ruby_sourceline; /* current line no. */
|
2007-09-15 18:36:33 +04:00
|
|
|
rb_encoding *enc;
|
2007-11-08 01:55:27 +03:00
|
|
|
rb_encoding *utf8;
|
2005-11-30 17:52:30 +03:00
|
|
|
|
2007-11-13 15:41:41 +03:00
|
|
|
int parser_yydebug;
|
|
|
|
|
2004-12-29 23:41:04 +03:00
|
|
|
#ifndef RIPPER
|
|
|
|
/* Ruby core only */
|
|
|
|
NODE *parser_eval_tree_begin;
|
|
|
|
NODE *parser_eval_tree;
|
2005-07-13 17:44:21 +04:00
|
|
|
VALUE debug_lines;
|
2008-07-01 20:55:30 +04:00
|
|
|
VALUE coverage;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
int nerr;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
token_info *parser_token_info;
|
2004-12-29 23:41:04 +03:00
|
|
|
#else
|
|
|
|
/* Ripper only */
|
2007-12-25 15:34:21 +03:00
|
|
|
VALUE parser_ruby_sourcefile_string;
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *tokp;
|
2004-09-20 09:40:23 +04:00
|
|
|
VALUE delayed;
|
2004-09-20 11:59:30 +04:00
|
|
|
int delayed_line;
|
|
|
|
int delayed_col;
|
2004-12-29 23:41:04 +03:00
|
|
|
|
|
|
|
VALUE value;
|
|
|
|
VALUE result;
|
|
|
|
VALUE parsing_thread;
|
|
|
|
int toplevel_p;
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
#define UTF8_ENC() (parser->utf8 ? parser->utf8 : \
|
2007-12-21 09:59:48 +03:00
|
|
|
(parser->utf8 = rb_utf8_encoding()))
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
#define STR_NEW(p,n) rb_enc_str_new((p),(n),parser->enc)
|
2008-09-20 03:09:33 +04:00
|
|
|
#define STR_NEW0() rb_enc_str_new(0,0,parser->enc)
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),parser->enc)
|
2008-01-24 14:43:40 +03:00
|
|
|
#define STR_NEW3(p,n,e,func) parser_str_new((p),(n),(e),(func),parser->enc)
|
2007-11-27 05:21:17 +03:00
|
|
|
#define ENC_SINGLE(cr) ((cr)==ENC_CODERANGE_7BIT)
|
2008-09-20 03:09:33 +04:00
|
|
|
#define TOK_INTERN(mb) rb_intern3(tok(), toklen(), parser->enc)
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
|
2005-10-08 13:58:25 +04:00
|
|
|
#ifdef YYMALLOC
|
|
|
|
void *rb_parser_malloc(struct parser_params *, size_t);
|
|
|
|
void *rb_parser_realloc(struct parser_params *, void *, size_t);
|
|
|
|
void *rb_parser_calloc(struct parser_params *, size_t, size_t);
|
|
|
|
void rb_parser_free(struct parser_params *, void *);
|
|
|
|
#endif
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static int parser_yyerror(struct parser_params*, const char*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define yyerror(msg) parser_yyerror(parser, msg)
|
|
|
|
|
2007-11-13 15:41:41 +03:00
|
|
|
#define YYLEX_PARAM parser
|
2004-09-17 13:24:13 +04:00
|
|
|
|
|
|
|
#define lex_strterm (parser->parser_lex_strterm)
|
|
|
|
#define lex_state (parser->parser_lex_state)
|
|
|
|
#define cond_stack (parser->parser_cond_stack)
|
|
|
|
#define cmdarg_stack (parser->parser_cmdarg_stack)
|
|
|
|
#define class_nest (parser->parser_class_nest)
|
2005-08-12 12:13:28 +04:00
|
|
|
#define paren_nest (parser->parser_paren_nest)
|
|
|
|
#define lpar_beg (parser->parser_lpar_beg)
|
2004-09-17 13:24:13 +04:00
|
|
|
#define in_single (parser->parser_in_single)
|
|
|
|
#define in_def (parser->parser_in_def)
|
|
|
|
#define compile_for_eval (parser->parser_compile_for_eval)
|
|
|
|
#define cur_mid (parser->parser_cur_mid)
|
|
|
|
#define in_defined (parser->parser_in_defined)
|
|
|
|
#define tokenbuf (parser->parser_tokenbuf)
|
|
|
|
#define tokidx (parser->parser_tokidx)
|
|
|
|
#define toksiz (parser->parser_toksiz)
|
|
|
|
#define lex_input (parser->parser_lex_input)
|
|
|
|
#define lex_lastline (parser->parser_lex_lastline)
|
2007-11-09 17:33:18 +03:00
|
|
|
#define lex_nextline (parser->parser_lex_nextline)
|
2004-09-17 13:24:13 +04:00
|
|
|
#define lex_pbeg (parser->parser_lex_pbeg)
|
|
|
|
#define lex_p (parser->parser_lex_p)
|
|
|
|
#define lex_pend (parser->parser_lex_pend)
|
|
|
|
#define heredoc_end (parser->parser_heredoc_end)
|
|
|
|
#define command_start (parser->parser_command_start)
|
2008-08-04 11:48:52 +04:00
|
|
|
#define deferred_nodes (parser->parser_deferred_nodes)
|
2004-09-17 13:24:13 +04:00
|
|
|
#define lex_gets_ptr (parser->parser_lex_gets_ptr)
|
|
|
|
#define lex_gets (parser->parser_lex_gets)
|
2004-10-02 15:34:13 +04:00
|
|
|
#define lvtbl (parser->parser_lvtbl)
|
2004-09-17 13:24:13 +04:00
|
|
|
#define ruby__end__seen (parser->parser_ruby__end__seen)
|
|
|
|
#define ruby_sourceline (parser->parser_ruby_sourceline)
|
|
|
|
#define ruby_sourcefile (parser->parser_ruby_sourcefile)
|
2007-11-13 15:41:41 +03:00
|
|
|
#define yydebug (parser->parser_yydebug)
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
#ifdef RIPPER
|
2005-07-13 17:44:21 +04:00
|
|
|
#else
|
2007-12-25 15:34:21 +03:00
|
|
|
#define ruby_eval_tree (parser->parser_eval_tree)
|
|
|
|
#define ruby_eval_tree_begin (parser->parser_eval_tree_begin)
|
2005-07-13 17:44:21 +04:00
|
|
|
#define ruby_debug_lines (parser->debug_lines)
|
2008-07-01 20:55:30 +04:00
|
|
|
#define ruby_coverage (parser->coverage)
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static int yylex(void*, void*);
|
2004-09-17 13:24:13 +04:00
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifndef RIPPER
|
2005-10-18 21:35:18 +04:00
|
|
|
#define yyparse ruby_yyparse
|
2004-09-17 13:24:13 +04:00
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE);
|
|
|
|
#define rb_node_newnode(type, a1, a2, a3) node_newnode(parser, type, a1, a2, a3)
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *cond_gen(struct parser_params*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define cond(node) cond_gen(parser, node)
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define logop(type,node1,node2) logop_gen(parser, type, node1, node2)
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *newline_node(NODE*);
|
|
|
|
static void fixpos(NODE*,NODE*);
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static int value_expr_gen(struct parser_params*,NODE*);
|
|
|
|
static void void_expr_gen(struct parser_params*,NODE*);
|
|
|
|
static NODE *remove_begin(NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define value_expr(node) value_expr_gen(parser, (node) = remove_begin(node))
|
2007-11-29 10:59:12 +03:00
|
|
|
#define void_expr0(node) void_expr_gen(parser, (node))
|
|
|
|
#define void_expr(node) void_expr0((node) = remove_begin(node))
|
2005-09-25 04:39:22 +04:00
|
|
|
static void void_stmts_gen(struct parser_params*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define void_stmts(node) void_stmts_gen(parser, node)
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static void reduce_nodes_gen(struct parser_params*,NODE**);
|
|
|
|
#define reduce_nodes(n) reduce_nodes_gen(parser,n)
|
|
|
|
static void block_dup_check_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define block_dup_check(n1,n2) block_dup_check_gen(parser,n1,n2)
|
|
|
|
|
|
|
|
static NODE *block_append_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define block_append(h,t) block_append_gen(parser,h,t)
|
|
|
|
static NODE *list_append_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define list_append(l,i) list_append_gen(parser,l,i)
|
|
|
|
static NODE *list_concat_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define list_concat(h,t) list_concat_gen(parser,h,t)
|
|
|
|
static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define arg_append(h,t) arg_append_gen(parser,h,t)
|
|
|
|
static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define arg_concat(h,t) arg_concat_gen(parser,h,t)
|
|
|
|
static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*);
|
|
|
|
#define literal_concat(h,t) literal_concat_gen(parser,h,t)
|
|
|
|
static NODE *new_evstr_gen(struct parser_params*,NODE*);
|
|
|
|
#define new_evstr(n) new_evstr_gen(parser,n)
|
|
|
|
static NODE *evstr2dstr_gen(struct parser_params*,NODE*);
|
|
|
|
#define evstr2dstr(n) evstr2dstr_gen(parser,n)
|
2008-02-12 10:18:49 +03:00
|
|
|
static NODE *splat_array(NODE*);
|
2005-09-25 04:39:22 +04:00
|
|
|
|
2007-08-09 11:04:56 +04:00
|
|
|
static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*);
|
|
|
|
#define call_bin_op(recv,id,arg1) call_bin_op_gen(parser, recv,id,arg1)
|
|
|
|
static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID);
|
|
|
|
#define call_uni_op(recv,id) call_uni_op_gen(parser, recv,id)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
static NODE *new_args_gen(struct parser_params*,NODE*,NODE*,ID,NODE*,ID);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
#define new_args(f,o,r,p,b) new_args_gen(parser, f,o,r,p,b)
|
2005-07-28 11:16:22 +04:00
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *negate_lit(NODE*);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static NODE *ret_args_gen(struct parser_params*,NODE*);
|
|
|
|
#define ret_args(node) ret_args_gen(parser, node)
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *arg_blk_pass(NODE*,NODE*);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static NODE *new_yield_gen(struct parser_params*,NODE*);
|
|
|
|
#define new_yield(node) new_yield_gen(parser, node)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *gettable_gen(struct parser_params*,ID);
|
2004-10-02 15:34:13 +04:00
|
|
|
#define gettable(id) gettable_gen(parser,id)
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *assignable_gen(struct parser_params*,ID,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define assignable(id,node) assignable_gen(parser, id, node)
|
2009-10-02 15:37:44 +04:00
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *aryset_gen(struct parser_params*,NODE*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define aryset(node1,node2) aryset_gen(parser, node1, node2)
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *attrset_gen(struct parser_params*,NODE*,ID);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define attrset(node,id) attrset_gen(parser, node, id)
|
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static void rb_backref_error_gen(struct parser_params*,NODE*);
|
|
|
|
#define rb_backref_error(n) rb_backref_error_gen(parser,n)
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define node_assign(node1, node2) node_assign_gen(parser, node1, node2)
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *match_op_gen(struct parser_params*,NODE*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
#define match_op(node1,node2) match_op_gen(parser, node1, node2)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
static ID *local_tbl_gen(struct parser_params*);
|
|
|
|
#define local_tbl() local_tbl_gen(parser)
|
|
|
|
|
|
|
|
static void fixup_nodes(NODE **);
|
|
|
|
|
|
|
|
extern int rb_dvar_defined(ID);
|
|
|
|
extern int rb_local_defined(ID);
|
|
|
|
extern int rb_parse_in_eval(void);
|
|
|
|
extern int rb_parse_in_main(void);
|
|
|
|
|
|
|
|
static VALUE reg_compile_gen(struct parser_params*, VALUE, int);
|
|
|
|
#define reg_compile(str,options) reg_compile_gen(parser, str, options)
|
|
|
|
static void reg_fragment_setenc_gen(struct parser_params*, VALUE, int);
|
|
|
|
#define reg_fragment_setenc(str,options) reg_fragment_setenc_gen(parser, str, options)
|
|
|
|
static void reg_fragment_check_gen(struct parser_params*, VALUE, int);
|
|
|
|
#define reg_fragment_check(str,options) reg_fragment_check_gen(parser, str, options)
|
|
|
|
static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match);
|
|
|
|
#define reg_named_capture_assign(regexp,match) reg_named_capture_assign_gen(parser,regexp,match)
|
|
|
|
|
|
|
|
#define get_id(id) (id)
|
|
|
|
#define get_value(val) (val)
|
|
|
|
#else
|
|
|
|
#define remove_begin(node) (node)
|
|
|
|
#define rb_dvar_defined(id) 0
|
|
|
|
#define rb_local_defined(id) 0
|
|
|
|
static ID ripper_get_id(VALUE);
|
|
|
|
#define get_id(id) ripper_get_id(id)
|
|
|
|
static VALUE ripper_get_value(VALUE);
|
|
|
|
#define get_value(val) ripper_get_value(val)
|
|
|
|
static VALUE assignable_gen(struct parser_params*,VALUE);
|
|
|
|
#define assignable(lhs,node) assignable_gen(parser, lhs)
|
|
|
|
#endif /* !RIPPER */
|
|
|
|
|
|
|
|
static ID formal_argument_gen(struct parser_params*, ID);
|
|
|
|
#define formal_argument(id) formal_argument_gen(parser, id)
|
|
|
|
static ID shadowing_lvar_gen(struct parser_params*,ID);
|
|
|
|
#define shadowing_lvar(name) shadowing_lvar_gen(parser, name)
|
|
|
|
static void new_bv_gen(struct parser_params*,ID);
|
|
|
|
#define new_bv(id) new_bv_gen(parser, id)
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static void local_push_gen(struct parser_params*,int);
|
2004-10-02 15:34:13 +04:00
|
|
|
#define local_push(top) local_push_gen(parser,top)
|
2005-09-25 04:39:22 +04:00
|
|
|
static void local_pop_gen(struct parser_params*);
|
2004-10-02 15:34:13 +04:00
|
|
|
#define local_pop() local_pop_gen(parser)
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
static int local_var_gen(struct parser_params*, ID);
|
|
|
|
#define local_var(id) local_var_gen(parser, id);
|
|
|
|
static int arg_var_gen(struct parser_params*, ID);
|
|
|
|
#define arg_var(id) arg_var_gen(parser, id)
|
2005-09-25 04:39:22 +04:00
|
|
|
static int local_id_gen(struct parser_params*, ID);
|
2004-10-02 15:34:13 +04:00
|
|
|
#define local_id(id) local_id_gen(parser, id)
|
2007-05-11 10:26:06 +04:00
|
|
|
static ID internal_id_gen(struct parser_params*);
|
|
|
|
#define internal_id() internal_id_gen(parser)
|
2004-10-02 15:34:13 +04:00
|
|
|
|
2009-12-01 06:01:15 +03:00
|
|
|
static const struct vtable *dyna_push_gen(struct parser_params *);
|
|
|
|
#define dyna_push() dyna_push_gen(parser)
|
|
|
|
static void dyna_pop_gen(struct parser_params*, const struct vtable *);
|
2009-12-01 00:16:31 +03:00
|
|
|
#define dyna_pop(node) dyna_pop_gen(parser, node)
|
2005-09-25 04:39:22 +04:00
|
|
|
static int dyna_in_block_gen(struct parser_params*);
|
2006-12-31 18:02:22 +03:00
|
|
|
#define dyna_in_block() dyna_in_block_gen(parser)
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
#define dyna_var(id) local_var(id)
|
2006-12-31 18:02:22 +03:00
|
|
|
static int dvar_defined_gen(struct parser_params*,ID);
|
|
|
|
#define dvar_defined(id) dvar_defined_gen(parser, id)
|
|
|
|
static int dvar_curr_gen(struct parser_params*,ID);
|
|
|
|
#define dvar_curr(id) dvar_curr_gen(parser, id)
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static int lvar_defined_gen(struct parser_params*, ID);
|
2004-10-02 15:34:13 +04:00
|
|
|
#define lvar_defined(id) lvar_defined_gen(parser, id)
|
2001-05-30 13:12:34 +04:00
|
|
|
|
2005-08-22 18:53:51 +04:00
|
|
|
#define RE_OPTION_ONCE (1<<16)
|
2007-10-19 11:41:03 +04:00
|
|
|
#define RE_OPTION_ENCODING_SHIFT 8
|
|
|
|
#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
|
|
|
|
#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
|
2008-01-24 14:43:40 +03:00
|
|
|
#define RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE)
|
2007-10-19 11:41:03 +04:00
|
|
|
#define RE_OPTION_MASK 0xff
|
2008-01-24 14:43:40 +03:00
|
|
|
#define RE_OPTION_ARG_ENCODING_NONE 32
|
2002-06-24 11:20:42 +04:00
|
|
|
|
|
|
|
#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */
|
|
|
|
#define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */
|
2004-04-23 09:52:18 +04:00
|
|
|
#define SIGN_EXTEND(x,n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1))
|
2002-06-26 12:01:00 +04:00
|
|
|
#define nd_func u1.id
|
2003-07-11 20:22:01 +04:00
|
|
|
#if SIZEOF_SHORT == 2
|
|
|
|
#define nd_term(node) ((signed short)(node)->u2.id)
|
|
|
|
#else
|
|
|
|
#define nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2)
|
|
|
|
#endif
|
|
|
|
#define nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2)
|
2004-09-12 19:21:49 +04:00
|
|
|
#define nd_nest u3.cnt
|
|
|
|
|
|
|
|
/****** Ripper *******/
|
|
|
|
|
|
|
|
#ifdef RIPPER
|
|
|
|
#define RIPPER_VERSION "0.1.0"
|
|
|
|
|
|
|
|
#include "eventids1.c"
|
|
|
|
#include "eventids2.c"
|
|
|
|
static ID ripper_id_gets;
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static VALUE ripper_dispatch0(struct parser_params*,ID);
|
|
|
|
static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
|
|
|
|
static VALUE ripper_dispatch2(struct parser_params*,ID,VALUE,VALUE);
|
|
|
|
static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
|
|
|
|
static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
|
|
|
|
static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
#define dispatch0(n) ripper_dispatch0(parser, TOKEN_PASTE(ripper_id_, n))
|
|
|
|
#define dispatch1(n,a) ripper_dispatch1(parser, TOKEN_PASTE(ripper_id_, n), a)
|
|
|
|
#define dispatch2(n,a,b) ripper_dispatch2(parser, TOKEN_PASTE(ripper_id_, n), a, b)
|
|
|
|
#define dispatch3(n,a,b,c) ripper_dispatch3(parser, TOKEN_PASTE(ripper_id_, n), a, b, c)
|
|
|
|
#define dispatch4(n,a,b,c,d) ripper_dispatch4(parser, TOKEN_PASTE(ripper_id_, n), a, b, c, d)
|
|
|
|
#define dispatch5(n,a,b,c,d,e) ripper_dispatch5(parser, TOKEN_PASTE(ripper_id_, n), a, b, c, d, e)
|
|
|
|
|
|
|
|
#define yyparse ripper_yyparse
|
|
|
|
|
2009-10-20 10:38:03 +04:00
|
|
|
#define ripper_intern(s) ID2SYM(rb_intern(s))
|
2005-09-25 04:39:22 +04:00
|
|
|
static VALUE ripper_id2sym(ID);
|
2008-08-14 12:57:07 +04:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define ripper_id2sym(id) ((id) < 256 && rb_ispunct(id) ? \
|
|
|
|
ID2SYM(id) : ripper_id2sym(id))
|
|
|
|
#endif
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2007-09-17 16:02:35 +04:00
|
|
|
#define arg_new() dispatch0(args_new)
|
|
|
|
#define arg_add(l,a) dispatch2(args_add, l, a)
|
|
|
|
#define arg_add_star(l,a) dispatch2(args_add_star, l, a)
|
|
|
|
#define arg_add_block(l,b) dispatch2(args_add_block, l, b)
|
|
|
|
#define arg_add_optblock(l,b) ((b)==Qundef? l : dispatch2(args_add_block, l, b))
|
2004-09-12 19:21:49 +04:00
|
|
|
#define bare_assoc(v) dispatch1(bare_assoc_hash, v)
|
|
|
|
#define arg_add_assocs(l,b) arg_add(l, bare_assoc(b))
|
|
|
|
|
2007-09-17 16:02:35 +04:00
|
|
|
#define args2mrhs(a) dispatch1(mrhs_new_from_args, a)
|
2004-09-12 19:21:49 +04:00
|
|
|
#define mrhs_new() dispatch0(mrhs_new)
|
|
|
|
#define mrhs_add(l,a) dispatch2(mrhs_add, l, a)
|
|
|
|
#define mrhs_add_star(l,a) dispatch2(mrhs_add_star, l, a)
|
|
|
|
|
|
|
|
#define mlhs_new() dispatch0(mlhs_new)
|
|
|
|
#define mlhs_add(l,a) dispatch2(mlhs_add, l, a)
|
|
|
|
#define mlhs_add_star(l,a) dispatch2(mlhs_add_star, l, a)
|
|
|
|
|
2007-09-17 16:02:35 +04:00
|
|
|
#define params_new(pars, opts, rest, pars2, blk) \
|
|
|
|
dispatch5(params, pars, opts, rest, pars2, blk)
|
|
|
|
|
|
|
|
#define blockvar_new(p,v) dispatch2(block_var, p, v)
|
|
|
|
#define blockvar_add_star(l,a) dispatch2(block_var_add_star, l, a)
|
|
|
|
#define blockvar_add_block(l,a) dispatch2(block_var_add_block, l, a)
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
#define method_optarg(m,a) ((a)==Qundef ? m : dispatch2(method_add_arg,m,a))
|
|
|
|
#define method_arg(m,a) dispatch2(method_add_arg,m,a)
|
2007-09-17 16:02:35 +04:00
|
|
|
#define method_add_block(m,b) dispatch2(method_add_block, m, b)
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#define escape_Qundef(x) ((x)==Qundef ? Qnil : (x))
|
* array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.
* eval.c (rb_exec_recursive): new function.
* array.c (rb_ary_join): use rb_exec_recursive().
* array.c (rb_ary_inspect, rb_ary_hash): ditto.
* file.c (rb_file_join): ditto.
* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.
* io.c (rb_io_puts): ditto.
* object.c (rb_obj_inspect): ditto
* struct.c (rb_struct_inspect): ditto.
* lib/set.rb (SortedSet::setup): a hack to shut up warning.
[ruby-talk:132866]
* lib/time.rb (Time::strptime): add new function. inspired by
[ruby-talk:132815].
* lib/parsedate.rb (ParseDate::strptime): ditto.
* regparse.c: move st_*_strend() functions from st.c. fixed some
potential memory leaks.
* exception error messages updated. [ruby-core:04497]
* ext/socket/socket.c (Init_socket): add bunch of Socket
constants. Patch from Sam Roberts <sroberts@uniserve.com>.
[ruby-core:04409]
* array.c (rb_ary_s_create): no need for negative argc check.
[ruby-core:04463]
* array.c (rb_ary_unshift_m): ditto.
* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
of StandardError class, not Exception class. [ruby-core:04429]
* parse.y (fcall_gen): lvar(arg) will be evaluated as
lvar.call(arg) when lvar is a defined local variable. [new]
* object.c (rb_class_initialize): call inherited method before
calling initializing block.
* eval.c (rb_thread_start_1): initialize newly pushed frame.
* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
fixed: [ruby-core:04444]
* eval.c (is_defined): NODE_IASGN is an assignment.
* ext/readline/readline.c (Readline.readline): use rl_outstream
and rl_instream. [ruby-dev:25699]
* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
[ruby-dev:25675]
* misc/ruby-mode.el: [ruby-core:04415]
* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
* lib/rdoc/generators/ri_generator.rb: ditto.
* struct.c (make_struct): fixed: [ruby-core:04402]
* ext/curses/curses.c (window_color_set): [ruby-core:04393]
* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
[ruby-talk:130092]
* object.c: [ruby-doc:818]
* parse.y (open_args): fix too verbose warnings for the space
before argument parentheses. [ruby-dev:25492]
* parse.y (parser_yylex): ditto.
* parse.y (parser_yylex): the first expression in the parentheses
should not be a command. [ruby-dev:25492]
* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
* object.c (Init_Object): remove Object#type. [ruby-core:04335]
* st.c (st_foreach): report success/failure by return value.
[ruby-Bugs-1396]
* parse.y: forgot to initialize parser struct. [ruby-dev:25492]
* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
[ruby-talk:127711]
* document updates - [ruby-core:04296], [ruby-core:04301],
[ruby-core:04302], [ruby-core:04307]
* dir.c (rb_push_glob): should work for NUL delimited patterns.
* dir.c (rb_glob2): should aware of offset in the pattern.
* string.c (rb_str_new4): should propagate taintedness.
* env.h: rename member names in struct FRAME; last_func -> callee,
orig_func -> this_func, last_class -> this_class.
* struct.c (rb_struct_set): use original method name, not callee
name, to retrieve member slot. [ruby-core:04268]
* time.c (time_strftime): protect from format modification from GC
finalizers.
* object.c (Init_Object): remove rb_obj_id_obsolete()
* eval.c (rb_mod_define_method): incomplete subclass check.
[ruby-dev:25464]
* gc.c (rb_data_object_alloc): klass may be NULL.
[ruby-list:40498]
* bignum.c (rb_big_rand): should return positive random number.
[ruby-dev:25401]
* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
random bignums. [ruby-dev:25396]
* variable.c (rb_autoload): [ruby-dev:25373]
* eval.c (svalue_to_avalue): [ruby-dev:25366]
* string.c (rb_str_justify): [ruby-dev:25367]
* io.c (rb_f_select): [ruby-dev:25312]
* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]
* struct.c (make_struct): [ruby-dev:25249]
* dir.c (dir_open_dir): new function. [ruby-dev:25242]
* io.c (rb_f_open): add type check for return value from to_open.
* lib/pstore.rb (PStore#transaction): Use the empty content when a
file is not found. [ruby-dev:24561]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 09:47:45 +03:00
|
|
|
|
2005-03-09 12:29:52 +03:00
|
|
|
#define FIXME 0
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif /* RIPPER */
|
|
|
|
|
|
|
|
#ifndef RIPPER
|
2004-10-31 08:22:58 +03:00
|
|
|
# define ifndef_ripper(x) x
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
2004-10-31 08:22:58 +03:00
|
|
|
# define ifndef_ripper(x)
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RIPPER
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
# define rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt)
|
|
|
|
# define rb_warnI(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
|
|
|
|
# define rb_warnS(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
|
|
|
|
# define rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt)
|
|
|
|
# define rb_warningS(fmt,a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt, a)
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
|
|
|
# define rb_warn0(fmt) ripper_warn0(parser, fmt)
|
|
|
|
# define rb_warnI(fmt,a) ripper_warnI(parser, fmt, a)
|
|
|
|
# define rb_warnS(fmt,a) ripper_warnS(parser, fmt, a)
|
|
|
|
# define rb_warning0(fmt) ripper_warning0(parser, fmt)
|
2005-07-28 06:33:28 +04:00
|
|
|
# define rb_warningS(fmt,a) ripper_warningS(parser, fmt, a)
|
2005-09-25 04:39:22 +04:00
|
|
|
static void ripper_warn0(struct parser_params*, const char*);
|
|
|
|
static void ripper_warnI(struct parser_params*, const char*, int);
|
2008-05-17 06:39:43 +04:00
|
|
|
#if 0
|
2005-09-25 04:39:22 +04:00
|
|
|
static void ripper_warnS(struct parser_params*, const char*, const char*);
|
2008-05-17 06:39:43 +04:00
|
|
|
#endif
|
2005-09-25 04:39:22 +04:00
|
|
|
static void ripper_warning0(struct parser_params*, const char*);
|
|
|
|
static void ripper_warningS(struct parser_params*, const char*, const char*);
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
#ifdef RIPPER
|
2005-09-25 04:39:22 +04:00
|
|
|
static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
|
2004-09-17 13:24:13 +04:00
|
|
|
# define rb_compile_error ripper_compile_error
|
|
|
|
# define compile_error ripper_compile_error
|
|
|
|
# define PARSER_ARG parser,
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
# define compile_error parser->nerr++,rb_compile_error
|
|
|
|
# define PARSER_ARG ruby_sourcefile, ruby_sourceline,
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
2002-06-24 11:20:42 +04:00
|
|
|
|
2003-12-03 10:55:54 +03:00
|
|
|
/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150,
|
|
|
|
for instance). This is too low for Ruby to parse some files, such as
|
|
|
|
date/format.rb, therefore bump the value up to at least Bison's default. */
|
|
|
|
#ifdef OLD_YACC
|
|
|
|
#ifndef YYMAXDEPTH
|
|
|
|
#define YYMAXDEPTH 10000
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2008-08-30 11:29:41 +04:00
|
|
|
#ifndef RIPPER
|
2008-08-30 13:16:38 +04:00
|
|
|
static void token_info_push(struct parser_params*, const char *token);
|
|
|
|
static void token_info_pop(struct parser_params*, const char *token);
|
2009-10-13 13:23:19 +04:00
|
|
|
#define token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, token) : (void)0)
|
|
|
|
#define token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, token) : (void)0)
|
|
|
|
#else
|
|
|
|
#define token_info_push(token) /* nothing */
|
|
|
|
#define token_info_pop(token) /* nothing */
|
2008-08-30 11:29:41 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
%}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
%pure_parser
|
2007-11-13 15:41:41 +03:00
|
|
|
%parse-param {struct parser_params *parser}
|
2004-09-12 19:21:49 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
%union {
|
2004-09-12 19:21:49 +04:00
|
|
|
VALUE val;
|
1998-01-16 15:13:05 +03:00
|
|
|
NODE *node;
|
|
|
|
ID id;
|
|
|
|
int num;
|
2009-12-01 06:01:15 +03:00
|
|
|
const struct vtable *vars;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
|
|
|
%token
|
|
|
|
/*%
|
|
|
|
%token <val>
|
|
|
|
%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
keyword_class
|
2006-06-26 18:15:49 +04:00
|
|
|
keyword_module
|
|
|
|
keyword_def
|
|
|
|
keyword_undef
|
|
|
|
keyword_begin
|
|
|
|
keyword_rescue
|
|
|
|
keyword_ensure
|
|
|
|
keyword_end
|
|
|
|
keyword_if
|
|
|
|
keyword_unless
|
|
|
|
keyword_then
|
|
|
|
keyword_elsif
|
|
|
|
keyword_else
|
|
|
|
keyword_case
|
|
|
|
keyword_when
|
|
|
|
keyword_while
|
|
|
|
keyword_until
|
|
|
|
keyword_for
|
|
|
|
keyword_break
|
|
|
|
keyword_next
|
|
|
|
keyword_redo
|
|
|
|
keyword_retry
|
|
|
|
keyword_in
|
|
|
|
keyword_do
|
|
|
|
keyword_do_cond
|
|
|
|
keyword_do_block
|
|
|
|
keyword_do_LAMBDA
|
|
|
|
keyword_return
|
|
|
|
keyword_yield
|
|
|
|
keyword_super
|
|
|
|
keyword_self
|
|
|
|
keyword_nil
|
|
|
|
keyword_true
|
|
|
|
keyword_false
|
|
|
|
keyword_and
|
|
|
|
keyword_or
|
|
|
|
keyword_not
|
|
|
|
modifier_if
|
|
|
|
modifier_unless
|
|
|
|
modifier_while
|
|
|
|
modifier_until
|
|
|
|
modifier_rescue
|
|
|
|
keyword_alias
|
|
|
|
keyword_defined
|
|
|
|
keyword_BEGIN
|
|
|
|
keyword_END
|
|
|
|
keyword__LINE__
|
|
|
|
keyword__FILE__
|
2007-12-21 06:22:22 +03:00
|
|
|
keyword__ENCODING__
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-03-20 19:45:41 +03:00
|
|
|
%token <id> tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tLABEL
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%token <node> tINTEGER tFLOAT tSTRING_CONTENT tCHAR
|
2002-06-26 12:01:00 +04:00
|
|
|
%token <node> tNTH_REF tBACK_REF
|
2002-06-24 11:20:42 +04:00
|
|
|
%token <num> tREGEXP_END
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
%type <node> singleton strings string string1 xstring regexp
|
|
|
|
%type <node> string_contents xstring_contents string_content
|
2002-06-26 12:01:00 +04:00
|
|
|
%type <node> words qwords word_list qword_list word
|
2003-03-03 08:17:39 +03:00
|
|
|
%type <node> literal numeric dsym cpath
|
2010-01-18 19:43:29 +03:00
|
|
|
%type <node> top_compstmt top_stmts top_stmt
|
2002-03-26 09:18:51 +03:00
|
|
|
%type <node> bodystmt compstmt stmts stmt expr arg primary command command_call method_call
|
2002-06-28 18:42:46 +04:00
|
|
|
%type <node> expr_value arg_value primary_value
|
2002-03-26 09:18:51 +03:00
|
|
|
%type <node> if_tail opt_else case_body cases opt_rescue exc_list exc_var opt_ensure
|
2008-06-21 11:29:05 +04:00
|
|
|
%type <node> args call_args opt_call_args
|
|
|
|
%type <node> paren_args opt_paren_args
|
2002-02-13 12:01:11 +03:00
|
|
|
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
|
2003-01-01 06:24:29 +03:00
|
|
|
%type <node> mrhs superclass block_call block_command
|
2008-09-06 22:39:36 +04:00
|
|
|
%type <node> f_block_optarg f_block_opt
|
2007-08-09 09:01:37 +04:00
|
|
|
%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs
|
2006-10-06 02:32:04 +04:00
|
|
|
%type <node> assoc_list assocs assoc undef_list backref string_dvar for_var
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
%type <node> block_param opt_block_param block_param_def f_opt
|
|
|
|
%type <node> bv_decls opt_bv_decl bvar
|
|
|
|
%type <node> lambda f_larglist lambda_body
|
2004-10-30 10:56:18 +04:00
|
|
|
%type <node> brace_block cmd_brace_block do_block lhs none fitem
|
2007-07-04 13:32:45 +04:00
|
|
|
%type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post mlhs_inner
|
2004-10-30 10:56:18 +04:00
|
|
|
%type <id> fsym variable sym symbol operation operation2 operation3
|
2007-10-29 12:42:18 +03:00
|
|
|
%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
|
|
|
/*%
|
|
|
|
%type <val> program reswords then do dot_or_colon
|
|
|
|
%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
%token tUPLUS /* unary+ */
|
|
|
|
%token tUMINUS /* unary- */
|
1999-01-20 07:59:39 +03:00
|
|
|
%token tPOW /* ** */
|
2007-05-02 00:44:25 +04:00
|
|
|
%token tCMP /* <=> */
|
|
|
|
%token tEQ /* == */
|
|
|
|
%token tEQQ /* === */
|
|
|
|
%token tNEQ /* != */
|
|
|
|
%token tGEQ /* >= */
|
|
|
|
%token tLEQ /* <= */
|
1999-01-20 07:59:39 +03:00
|
|
|
%token tANDOP tOROP /* && and || */
|
|
|
|
%token tMATCH tNMATCH /* =~ and !~ */
|
|
|
|
%token tDOT2 tDOT3 /* .. and ... */
|
|
|
|
%token tAREF tASET /* [] and []= */
|
|
|
|
%token tLSHFT tRSHFT /* << and >> */
|
|
|
|
%token tCOLON2 /* :: */
|
|
|
|
%token tCOLON3 /* :: at EXPR_BEG */
|
|
|
|
%token <id> tOP_ASGN /* +=, -= etc. */
|
|
|
|
%token tASSOC /* => */
|
|
|
|
%token tLPAREN /* ( */
|
2001-05-30 13:12:34 +04:00
|
|
|
%token tLPAREN_ARG /* ( */
|
2001-03-13 08:45:13 +03:00
|
|
|
%token tRPAREN /* ) */
|
1999-01-20 07:59:39 +03:00
|
|
|
%token tLBRACK /* [ */
|
|
|
|
%token tLBRACE /* { */
|
2001-05-30 13:12:34 +04:00
|
|
|
%token tLBRACE_ARG /* { */
|
1999-01-20 07:59:39 +03:00
|
|
|
%token tSTAR /* * */
|
|
|
|
%token tAMPER /* & */
|
2005-07-27 11:27:19 +04:00
|
|
|
%token tLAMBDA /* -> */
|
2004-05-17 11:25:36 +04:00
|
|
|
%token tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG tWORDS_BEG tQWORDS_BEG
|
2005-08-12 12:13:28 +04:00
|
|
|
%token tSTRING_DBEG tSTRING_DVAR tSTRING_END tLAMBEG
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* precedence table
|
|
|
|
*/
|
|
|
|
|
2002-12-24 11:53:56 +03:00
|
|
|
%nonassoc tLOWEST
|
2002-12-20 11:33:17 +03:00
|
|
|
%nonassoc tLBRACE_ARG
|
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
%nonassoc modifier_if modifier_unless modifier_while modifier_until
|
|
|
|
%left keyword_or keyword_and
|
|
|
|
%right keyword_not
|
|
|
|
%nonassoc keyword_defined
|
1999-01-20 07:59:39 +03:00
|
|
|
%right '=' tOP_ASGN
|
2006-06-26 18:15:49 +04:00
|
|
|
%left modifier_rescue
|
1999-01-20 07:59:39 +03:00
|
|
|
%right '?' ':'
|
|
|
|
%nonassoc tDOT2 tDOT3
|
|
|
|
%left tOROP
|
|
|
|
%left tANDOP
|
|
|
|
%nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
|
|
|
|
%left '>' tGEQ '<' tLEQ
|
1998-01-16 15:13:05 +03:00
|
|
|
%left '|' '^'
|
|
|
|
%left '&'
|
1999-01-20 07:59:39 +03:00
|
|
|
%left tLSHFT tRSHFT
|
1998-01-16 15:13:05 +03:00
|
|
|
%left '+' '-'
|
|
|
|
%left '*' '/' '%'
|
2003-01-24 12:18:04 +03:00
|
|
|
%right tUMINUS_NUM tUMINUS
|
1999-01-20 07:59:39 +03:00
|
|
|
%right tPOW
|
2003-01-24 12:18:04 +03:00
|
|
|
%right '!' '~' tUPLUS
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
%nonassoc idNULL
|
|
|
|
%nonassoc idRespond_to
|
|
|
|
%nonassoc idIFUNC
|
|
|
|
%nonassoc idCFUNC
|
|
|
|
%nonassoc id_core_set_method_alias
|
|
|
|
%nonassoc id_core_set_variable_alias
|
|
|
|
%nonassoc id_core_undef_method
|
|
|
|
%nonassoc id_core_define_method
|
|
|
|
%nonassoc id_core_define_singleton_method
|
|
|
|
%nonassoc id_core_set_postexe
|
|
|
|
|
2002-12-24 11:53:56 +03:00
|
|
|
%token tLAST_TOKEN
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
%%
|
|
|
|
program : {
|
|
|
|
lex_state = EXPR_BEG;
|
2007-07-13 06:09:40 +04:00
|
|
|
/*%%%*/
|
2009-05-17 09:23:10 +04:00
|
|
|
$<num>$ = compile_for_eval || rb_parse_in_main();
|
|
|
|
local_push($<num>$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
local_push(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2010-01-18 19:43:29 +03:00
|
|
|
top_compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-05-17 09:23:10 +04:00
|
|
|
if ($2 && !$<num>1) {
|
2007-05-02 00:44:25 +04:00
|
|
|
/* last expression should not be void */
|
1999-08-13 09:45:20 +04:00
|
|
|
if (nd_type($2) != NODE_BLOCK) void_expr($2);
|
|
|
|
else {
|
|
|
|
NODE *node = $2;
|
|
|
|
while (node->nd_next) {
|
|
|
|
node = node->nd_next;
|
|
|
|
}
|
|
|
|
void_expr(node->nd_head);
|
|
|
|
}
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
ruby_eval_tree = NEW_SCOPE(0, block_append(ruby_eval_tree, $2));
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%
|
|
|
|
$$ = $2;
|
|
|
|
parser->result = dispatch1(program, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
|
|
|
|
2010-01-18 19:43:29 +03:00
|
|
|
top_compstmt : top_stmts opt_terms
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
void_stmts($1);
|
|
|
|
fixup_nodes(&deferred_nodes);
|
|
|
|
/*%
|
|
|
|
%*/
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
top_stmts : none
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_BEGIN(0);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch2(stmts_add, dispatch0(stmts_new),
|
|
|
|
dispatch0(void_stmt));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| top_stmt
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = newline_node($1);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch2(stmts_add, dispatch0(stmts_new), $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| top_stmts terms top_stmt
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = block_append($1, newline_node($3));
|
|
|
|
/*%
|
|
|
|
$$ = dispatch2(stmts_add, $1, $3);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| error top_stmt
|
|
|
|
{
|
|
|
|
$$ = remove_begin($2);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
top_stmt : stmt
|
|
|
|
| keyword_BEGIN
|
|
|
|
{
|
|
|
|
if (in_def || in_single) {
|
|
|
|
yyerror("BEGIN in method");
|
|
|
|
}
|
|
|
|
/*%%%*/
|
|
|
|
/* local_push(0); */
|
|
|
|
/*%
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
'{' top_compstmt '}'
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
|
|
|
|
$4);
|
|
|
|
/* NEW_PREEXE($4)); */
|
|
|
|
/* local_pop(); */
|
|
|
|
$$ = NEW_BEGIN(0);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(BEGIN, $4);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt : compstmt
|
|
|
|
opt_rescue
|
|
|
|
opt_else
|
|
|
|
opt_ensure
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = $1;
|
2002-03-26 09:18:51 +03:00
|
|
|
if ($2) {
|
|
|
|
$$ = NEW_RESCUE($1, $2, $3);
|
|
|
|
}
|
|
|
|
else if ($3) {
|
2007-05-02 01:45:48 +04:00
|
|
|
rb_warn0("else without rescue is useless");
|
2002-05-20 20:22:23 +04:00
|
|
|
$$ = block_append($$, $3);
|
2002-03-26 09:18:51 +03:00
|
|
|
}
|
|
|
|
if ($4) {
|
2004-02-03 05:23:20 +03:00
|
|
|
if ($$) {
|
|
|
|
$$ = NEW_ENSURE($$, $4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = block_append($4, NEW_NIL());
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
}
|
|
|
|
fixpos($$, $1);
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = dispatch4(bodystmt,
|
2007-05-02 00:44:25 +04:00
|
|
|
escape_Qundef($1),
|
|
|
|
escape_Qundef($2),
|
|
|
|
escape_Qundef($3),
|
|
|
|
escape_Qundef($4));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-03-26 09:18:51 +03:00
|
|
|
}
|
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt : stmts opt_terms
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
void_stmts($1);
|
2008-08-04 11:48:52 +04:00
|
|
|
fixup_nodes(&deferred_nodes);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
%*/
|
2007-11-29 10:59:12 +03:00
|
|
|
$$ = $1;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
stmts : none
|
2007-06-29 17:00:27 +04:00
|
|
|
{
|
2007-06-29 18:38:10 +04:00
|
|
|
/*%%%*/
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2007-06-29 18:38:10 +04:00
|
|
|
/*%
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch2(stmts_add, dispatch0(stmts_new),
|
2007-05-02 00:44:25 +04:00
|
|
|
dispatch0(void_stmt));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2007-06-29 18:38:10 +04:00
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
| stmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-11-30 21:34:34 +03:00
|
|
|
$$ = newline_node($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(stmts_add, dispatch0(stmts_new), $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
| stmts terms stmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-11-30 21:34:34 +03:00
|
|
|
$$ = block_append($1, newline_node($3));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(stmts_add, $1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
| error stmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-10-02 15:34:13 +04:00
|
|
|
$$ = remove_begin($2);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_ALIAS($2, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(alias, $2, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_alias tGVAR tGVAR
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_VALIAS($2, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(var_alias, $2, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_alias tGVAR tBACK_REF
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 04:29:17 +03:00
|
|
|
char buf[2];
|
|
|
|
buf[0] = '$';
|
|
|
|
buf[1] = (char)$3->nd_nth;
|
|
|
|
$$ = NEW_VALIAS($2, rb_intern2(buf, 2));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(var_alias, $2, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_alias tGVAR tNTH_REF
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
yyerror("can't make alias for the number variables");
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(var_alias, $2, $3);
|
|
|
|
$$ = dispatch1(alias_error, $$);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_undef undef_list
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(undef, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| stmt modifier_if expr_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-11-29 10:59:12 +03:00
|
|
|
$$ = NEW_IF(cond($3), remove_begin($1), 0);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(if_mod, $3, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| stmt modifier_unless expr_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-11-29 10:59:12 +03:00
|
|
|
$$ = NEW_UNLESS(cond($3), remove_begin($1), 0);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(unless_mod, $3, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| stmt modifier_while expr_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-03-13 08:45:13 +03:00
|
|
|
if ($1 && nd_type($1) == NODE_BEGIN) {
|
|
|
|
$$ = NEW_WHILE(cond($3), $1->nd_body, 0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else {
|
2001-03-13 08:45:13 +03:00
|
|
|
$$ = NEW_WHILE(cond($3), $1, 1);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(while_mod, $3, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| stmt modifier_until expr_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-03-13 08:45:13 +03:00
|
|
|
if ($1 && nd_type($1) == NODE_BEGIN) {
|
|
|
|
$$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else {
|
2001-03-13 08:45:13 +03:00
|
|
|
$$ = NEW_UNTIL(cond($3), $1, 1);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(until_mod, $3, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| stmt modifier_rescue stmt
|
2003-03-03 08:17:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-11-29 10:59:12 +03:00
|
|
|
NODE *resq = NEW_RESBODY(0, remove_begin($3), 0);
|
|
|
|
$$ = NEW_RESCUE(remove_begin($1), resq, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(rescue_mod, $3, $1);
|
|
|
|
%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_END '{' compstmt '}'
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2003-10-06 11:03:20 +04:00
|
|
|
if (in_def || in_single) {
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
rb_warn0("END in method; use at_exit");
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_POSTEXE(NEW_NODE(
|
|
|
|
NODE_SCOPE, 0 /* tbl */, $3 /* body */, 0 /* args */));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(END, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2001-01-20 17:02:28 +03:00
|
|
|
| lhs '=' command_call
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr($3);
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = node_assign($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(assign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2001-01-20 17:02:28 +03:00
|
|
|
| mlhs '=' command_call
|
2000-08-31 09:29:54 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-08-31 09:29:54 +04:00
|
|
|
value_expr($3);
|
2007-08-23 11:10:56 +04:00
|
|
|
$1->nd_value = $3;
|
2000-08-31 09:29:54 +04:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(massign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-08-31 09:29:54 +04:00
|
|
|
}
|
2002-02-13 12:01:11 +03:00
|
|
|
| var_lhs tOP_ASGN command_call
|
2001-10-30 11:43:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($3);
|
2002-02-13 12:01:11 +03:00
|
|
|
if ($1) {
|
2002-02-14 11:47:58 +03:00
|
|
|
ID vid = $1->nd_vid;
|
2001-11-08 09:43:14 +03:00
|
|
|
if ($2 == tOROP) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_OR(gettable(vid), $1);
|
2002-09-13 13:36:28 +04:00
|
|
|
if (is_asgn_or_id(vid)) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$$->nd_aid = vid;
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2001-11-08 09:43:14 +03:00
|
|
|
else if ($2 == tANDOP) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_AND(gettable(vid), $1);
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
|
|
|
else {
|
2002-02-13 12:01:11 +03:00
|
|
|
$$ = $1;
|
2007-08-09 11:04:56 +04:00
|
|
|
$$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
|
|
|
else {
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $2, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2006-06-10 20:09:12 +04:00
|
|
|
| primary_value '[' opt_call_args rbracket tOP_ASGN command_call
|
2001-10-30 11:43:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-02-12 22:15:46 +03:00
|
|
|
NODE *args;
|
2001-10-30 11:43:28 +03:00
|
|
|
|
2008-02-12 22:15:46 +03:00
|
|
|
value_expr($6);
|
|
|
|
if (!$3) $3 = NEW_ZARRAY();
|
2009-09-18 11:15:06 +04:00
|
|
|
args = arg_concat($3, $6);
|
2001-10-30 11:43:28 +03:00
|
|
|
if ($5 == tOROP) {
|
|
|
|
$5 = 0;
|
|
|
|
}
|
|
|
|
else if ($5 == tANDOP) {
|
|
|
|
$5 = 1;
|
|
|
|
}
|
|
|
|
$$ = NEW_OP_ASGN1($1, $5, args);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2005-09-05 17:29:01 +04:00
|
|
|
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $$, $5, $6);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tIDENTIFIER tOP_ASGN command_call
|
2001-10-30 11:43:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
2001-10-30 11:43:28 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch3(opassign, $$, $4, $5);
|
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tCONSTANT tOP_ASGN command_call
|
2001-10-30 11:43:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
2001-10-30 11:43:28 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch3(opassign, $$, $4, $5);
|
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2009-01-15 08:23:51 +03:00
|
|
|
| primary_value tCOLON2 tCONSTANT tOP_ASGN command_call
|
|
|
|
{
|
|
|
|
yyerror("constant re-assignment");
|
|
|
|
$$ = 0;
|
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call
|
2001-10-30 11:43:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
2001-10-30 11:43:28 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(field, $1, ripper_intern("::"), $3);
|
|
|
|
$$ = dispatch3(opassign, $$, $4, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
|
|
|
| backref tOP_ASGN command_call
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_backref_error($1);
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(assign, dispatch1(var_field, $1), $3);
|
|
|
|
$$ = dispatch1(assign_error, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-10-30 11:43:28 +03:00
|
|
|
}
|
2003-01-01 06:24:29 +03:00
|
|
|
| lhs '=' mrhs
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr($3);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = node_assign($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(assign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-01-01 06:24:29 +03:00
|
|
|
}
|
|
|
|
| mlhs '=' arg_value
|
2000-12-05 12:36:54 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2006-11-06 13:27:59 +03:00
|
|
|
$1->nd_value = $3;
|
2003-01-01 06:24:29 +03:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2008-12-16 10:41:54 +03:00
|
|
|
$$ = dispatch2(massign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-12-05 12:36:54 +03:00
|
|
|
}
|
2001-05-07 13:26:29 +04:00
|
|
|
| mlhs '=' mrhs
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(massign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2001-05-07 13:26:29 +04:00
|
|
|
| expr
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-05-07 13:26:29 +04:00
|
|
|
|
2002-11-14 09:18:59 +03:00
|
|
|
expr : command_call
|
2006-06-26 18:15:49 +04:00
|
|
|
| expr keyword_and expr
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = logop(NODE_AND, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("and"), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| expr keyword_or expr
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = logop(NODE_OR, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("or"), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-12-03 16:54:42 +03:00
|
|
|
| keyword_not opt_nl expr
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-12-03 16:54:42 +03:00
|
|
|
$$ = call_uni_op(cond($3), '!');
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2008-12-03 16:54:42 +03:00
|
|
|
$$ = dispatch2(unary, ripper_intern("not"), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| '!' command_call
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-12-12 06:45:36 +03:00
|
|
|
$$ = call_uni_op(cond($2), '!');
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-12-09 19:39:49 +03:00
|
|
|
$$ = dispatch2(unary, ripper_id2sym('!'), $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-02-18 12:52:48 +03:00
|
|
|
expr_value : expr
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-07-05 05:13:10 +04:00
|
|
|
value_expr($1);
|
2002-02-18 12:52:48 +03:00
|
|
|
$$ = $1;
|
2007-07-23 13:13:44 +04:00
|
|
|
if (!$$) $$ = NEW_NIL();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-02-18 12:52:48 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2002-02-18 12:52:48 +03:00
|
|
|
|
2001-01-20 17:02:28 +03:00
|
|
|
command_call : command
|
2001-01-26 08:02:19 +03:00
|
|
|
| block_command
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-01-20 17:02:28 +03:00
|
|
|
|
2001-01-26 08:02:19 +03:00
|
|
|
block_command : block_call
|
2002-06-28 18:42:46 +04:00
|
|
|
| block_call '.' operation2 command_args
|
2001-01-20 17:02:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
|
|
|
|
$$ = method_arg($$, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
2002-06-28 18:42:46 +04:00
|
|
|
| block_call tCOLON2 operation2 command_args
|
2001-01-20 17:02:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(call, $1, ripper_intern("::"), $3);
|
|
|
|
$$ = method_arg($$, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-01-20 17:02:28 +03:00
|
|
|
|
2002-12-20 11:33:17 +03:00
|
|
|
cmd_brace_block : tLBRACE_ARG
|
|
|
|
{
|
2009-12-01 06:01:15 +03:00
|
|
|
$<vars>1 = dyna_push();
|
|
|
|
/*%%%*/
|
|
|
|
$<num>$ = ruby_sourceline;
|
|
|
|
/*%
|
|
|
|
%*/
|
2002-12-20 11:33:17 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
opt_block_param
|
2002-12-20 11:33:17 +03:00
|
|
|
compstmt
|
|
|
|
'}'
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ITER($3,$4);
|
2009-12-01 06:01:15 +03:00
|
|
|
nd_set_line($$, $<num>2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = dispatch2(brace_block, escape_Qundef($3), $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
dyna_pop($<vars>1);
|
2002-12-20 11:33:17 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-12-24 11:53:56 +03:00
|
|
|
command : operation command_args %prec tLOWEST
|
2002-12-20 11:33:17 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_FCALL($1, $2);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(command, $1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
|
|
|
}
|
2002-12-20 11:33:17 +03:00
|
|
|
| operation command_args cmd_brace_block
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
block_dup_check($2,$3);
|
2007-12-21 21:02:19 +03:00
|
|
|
$3->nd_iter = NEW_FCALL($1, $2);
|
|
|
|
$$ = $3;
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(command, $1, $2);
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
|
|
|
}
|
2002-12-24 11:53:56 +03:00
|
|
|
| primary_value '.' operation2 command_args %prec tLOWEST
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-12-20 11:33:17 +03:00
|
|
|
| primary_value '.' operation2 command_args cmd_brace_block
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
block_dup_check($4,$5);
|
2007-12-21 21:02:19 +03:00
|
|
|
$5->nd_iter = NEW_CALL($1, $3, $4);
|
|
|
|
$$ = $5;
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($$, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-12-20 11:33:17 +03:00
|
|
|
}
|
2002-12-24 11:53:56 +03:00
|
|
|
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
|
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-12-20 11:33:17 +03:00
|
|
|
| primary_value tCOLON2 operation2 command_args cmd_brace_block
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
block_dup_check($4,$5);
|
2007-12-21 21:02:19 +03:00
|
|
|
$5->nd_iter = NEW_CALL($1, $3, $4);
|
|
|
|
$$ = $5;
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($$, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-12-20 11:33:17 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_super command_args
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_SUPER($2);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(super, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_yield command_args
|
2000-09-12 09:37:38 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-06-20 11:11:44 +04:00
|
|
|
$$ = new_yield($2);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(yield, $2);
|
|
|
|
%*/
|
2000-09-12 09:37:38 +04:00
|
|
|
}
|
2009-01-15 09:06:47 +03:00
|
|
|
| keyword_return call_args
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_RETURN(ret_args($2));
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(return, $2);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| keyword_break call_args
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_BREAK(ret_args($2));
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(break, $2);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| keyword_next call_args
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_NEXT(ret_args($2));
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(next, $2);
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2000-09-12 09:37:38 +04:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
mlhs : mlhs_basic
|
2007-07-04 13:32:45 +04:00
|
|
|
| tLPAREN mlhs_inner rparen
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = $2;
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(mlhs_paren, $2);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
mlhs_inner : mlhs_basic
|
|
|
|
| tLPAREN mlhs_inner rparen
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = NEW_MASGN(NEW_LIST($2), 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(mlhs_paren, $2);
|
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
mlhs_basic : mlhs_head
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-03-09 12:04:36 +03:00
|
|
|
$$ = NEW_MASGN($1, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2004-09-27 10:02:27 +04:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-03-09 12:04:36 +03:00
|
|
|
| mlhs_head mlhs_item
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-03-09 12:04:36 +03:00
|
|
|
$$ = NEW_MASGN(list_append($1,$2), 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add($1, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-03-09 12:04:36 +03:00
|
|
|
| mlhs_head tSTAR mlhs_node
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-03-09 12:04:36 +03:00
|
|
|
$$ = NEW_MASGN($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star($1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| mlhs_head tSTAR mlhs_node ',' mlhs_post
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_MASGN($1, NEW_POSTARG($3,$5));
|
|
|
|
/*%
|
2009-10-20 10:07:39 +04:00
|
|
|
$1 = mlhs_add_star($1, $3);
|
|
|
|
$$ = mlhs_add($1, $5);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
2000-03-09 12:04:36 +03:00
|
|
|
| mlhs_head tSTAR
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-03-09 12:04:36 +03:00
|
|
|
$$ = NEW_MASGN($1, -1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star($1, Qnil);
|
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| mlhs_head tSTAR ',' mlhs_post
|
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-08-15 08:52:56 +04:00
|
|
|
$$ = NEW_MASGN($1, NEW_POSTARG(-1, $4));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star($1, Qnil);
|
|
|
|
%*/
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| tSTAR mlhs_node
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_MASGN(0, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star(mlhs_new(), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| tSTAR mlhs_node ',' mlhs_post
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_MASGN(0, NEW_POSTARG($2,$4));
|
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star(mlhs_new(), $2);
|
|
|
|
%*/
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| tSTAR
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = NEW_MASGN(0, -1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star(mlhs_new(), Qnil);
|
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2007-07-05 13:45:27 +04:00
|
|
|
| tSTAR ',' mlhs_post
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-08-15 08:52:56 +04:00
|
|
|
$$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add_star(mlhs_new(), Qnil);
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
mlhs_item : mlhs_node
|
2007-07-04 13:32:45 +04:00
|
|
|
| tLPAREN mlhs_inner rparen
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(mlhs_paren, $2);
|
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
mlhs_head : mlhs_item ','
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_LIST($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add(mlhs_new(), $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-03-09 12:04:36 +03:00
|
|
|
| mlhs_head mlhs_item ','
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-03-09 12:04:36 +03:00
|
|
|
$$ = list_append($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add($1, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
mlhs_post : mlhs_item
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_LIST($1);
|
|
|
|
/*%
|
|
|
|
$$ = mlhs_add(mlhs_new(), $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| mlhs_post ',' mlhs_item
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = list_append($1, $3);
|
|
|
|
/*%
|
|
|
|
$$ = mlhs_add($1, $3);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
mlhs_node : variable
|
|
|
|
{
|
|
|
|
$$ = assignable($1, 0);
|
|
|
|
}
|
2006-06-10 20:09:12 +04:00
|
|
|
| primary_value '[' opt_call_args rbracket
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = aryset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2005-09-05 17:29:01 +04:00
|
|
|
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tIDENTIFIER
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 tIDENTIFIER
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_field, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tCONSTANT
|
2000-05-09 08:53:16 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-05-09 08:53:16 +04:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
|
|
|
%*/
|
2000-05-09 08:53:16 +04:00
|
|
|
}
|
2003-03-03 08:17:39 +03:00
|
|
|
| primary_value tCOLON2 tCONSTANT
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
if (in_def || in_single)
|
|
|
|
yyerror("dynamic constant assignment");
|
|
|
|
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
if (in_def || in_single)
|
|
|
|
yyerror("dynamic constant assignment");
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_field, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
}
|
2003-08-14 21:20:14 +04:00
|
|
|
| tCOLON3 tCONSTANT
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
if (in_def || in_single)
|
|
|
|
yyerror("dynamic constant assignment");
|
|
|
|
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(top_const_field, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| backref
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_backref_error($1);
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_field, $1);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(assign_error, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
lhs : variable
|
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = assignable($1, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
if (!$$) $$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = dispatch1(var_field, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-10 20:09:12 +04:00
|
|
|
| primary_value '[' opt_call_args rbracket
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = aryset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2005-09-05 17:29:01 +04:00
|
|
|
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tIDENTIFIER
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 tIDENTIFIER
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(field, $1, ripper_intern("::"), $3);
|
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tCONSTANT
|
2000-05-09 08:53:16 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-05-09 08:53:16 +04:00
|
|
|
$$ = attrset($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
|
|
|
%*/
|
2000-05-09 08:53:16 +04:00
|
|
|
}
|
2003-03-03 08:17:39 +03:00
|
|
|
| primary_value tCOLON2 tCONSTANT
|
2003-02-20 06:35:44 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-02-20 06:35:44 +03:00
|
|
|
if (in_def || in_single)
|
|
|
|
yyerror("dynamic constant assignment");
|
|
|
|
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_field, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
if (in_def || in_single) {
|
|
|
|
$$ = dispatch1(assign_error, $$);
|
|
|
|
}
|
|
|
|
%*/
|
2003-02-20 06:35:44 +03:00
|
|
|
}
|
2003-08-14 21:20:14 +04:00
|
|
|
| tCOLON3 tCONSTANT
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
if (in_def || in_single)
|
|
|
|
yyerror("dynamic constant assignment");
|
|
|
|
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(top_const_field, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
if (in_def || in_single) {
|
|
|
|
$$ = dispatch1(assign_error, $$);
|
|
|
|
}
|
|
|
|
%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
}
|
2003-03-03 08:17:39 +03:00
|
|
|
| backref
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_backref_error($1);
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(assign_error, $1);
|
|
|
|
%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
}
|
2003-02-20 06:35:44 +03:00
|
|
|
;
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
cname : tIDENTIFIER
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
yyerror("class/module name must be CONSTANT");
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(class_name_error, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| tCONSTANT
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2003-02-20 06:35:44 +03:00
|
|
|
cpath : tCOLON3 cname
|
2003-02-19 12:27:49 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-02-19 12:27:49 +03:00
|
|
|
$$ = NEW_COLON3($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(top_const_ref, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-02-19 12:27:49 +03:00
|
|
|
}
|
|
|
|
| cname
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-02-20 06:35:44 +03:00
|
|
|
$$ = NEW_COLON2(0, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(const_ref, $1);
|
|
|
|
%*/
|
2003-02-19 12:27:49 +03:00
|
|
|
}
|
2003-02-20 06:35:44 +03:00
|
|
|
| primary_value tCOLON2 cname
|
2003-02-19 12:27:49 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-02-19 12:27:49 +03:00
|
|
|
$$ = NEW_COLON2($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_ref, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-02-19 12:27:49 +03:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
fname : tIDENTIFIER
|
|
|
|
| tCONSTANT
|
|
|
|
| tFID
|
1998-01-16 15:13:05 +03:00
|
|
|
| op
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
lex_state = EXPR_END;
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $1;
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| reswords
|
|
|
|
{
|
|
|
|
lex_state = EXPR_END;
|
2009-08-15 05:40:10 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = $<id>1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-10-30 10:56:18 +04:00
|
|
|
fsym : fname
|
1999-08-13 09:45:20 +04:00
|
|
|
| symbol
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2004-10-30 10:56:18 +04:00
|
|
|
fitem : fsym
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_LIT(ID2SYM($1));
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(symbol_literal, $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| dsym
|
|
|
|
;
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
undef_list : fitem
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_UNDEF($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = rb_ary_new3(1, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| undef_list ',' {lex_state = EXPR_FNAME;} fitem
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = block_append($1, NEW_UNDEF($4));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
rb_ary_push($1, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-10-31 08:22:58 +03:00
|
|
|
op : '|' { ifndef_ripper($$ = '|'); }
|
|
|
|
| '^' { ifndef_ripper($$ = '^'); }
|
|
|
|
| '&' { ifndef_ripper($$ = '&'); }
|
|
|
|
| tCMP { ifndef_ripper($$ = tCMP); }
|
|
|
|
| tEQ { ifndef_ripper($$ = tEQ); }
|
|
|
|
| tEQQ { ifndef_ripper($$ = tEQQ); }
|
|
|
|
| tMATCH { ifndef_ripper($$ = tMATCH); }
|
2007-12-09 19:39:49 +03:00
|
|
|
| tNMATCH { ifndef_ripper($$ = tNMATCH); }
|
2004-10-31 08:22:58 +03:00
|
|
|
| '>' { ifndef_ripper($$ = '>'); }
|
|
|
|
| tGEQ { ifndef_ripper($$ = tGEQ); }
|
|
|
|
| '<' { ifndef_ripper($$ = '<'); }
|
|
|
|
| tLEQ { ifndef_ripper($$ = tLEQ); }
|
2007-12-09 19:39:49 +03:00
|
|
|
| tNEQ { ifndef_ripper($$ = tNEQ); }
|
2004-10-31 08:22:58 +03:00
|
|
|
| tLSHFT { ifndef_ripper($$ = tLSHFT); }
|
|
|
|
| tRSHFT { ifndef_ripper($$ = tRSHFT); }
|
|
|
|
| '+' { ifndef_ripper($$ = '+'); }
|
|
|
|
| '-' { ifndef_ripper($$ = '-'); }
|
|
|
|
| '*' { ifndef_ripper($$ = '*'); }
|
|
|
|
| tSTAR { ifndef_ripper($$ = '*'); }
|
|
|
|
| '/' { ifndef_ripper($$ = '/'); }
|
|
|
|
| '%' { ifndef_ripper($$ = '%'); }
|
|
|
|
| tPOW { ifndef_ripper($$ = tPOW); }
|
2007-12-09 19:39:49 +03:00
|
|
|
| '!' { ifndef_ripper($$ = '!'); }
|
2004-10-31 08:22:58 +03:00
|
|
|
| '~' { ifndef_ripper($$ = '~'); }
|
|
|
|
| tUPLUS { ifndef_ripper($$ = tUPLUS); }
|
|
|
|
| tUMINUS { ifndef_ripper($$ = tUMINUS); }
|
|
|
|
| tAREF { ifndef_ripper($$ = tAREF); }
|
|
|
|
| tASET { ifndef_ripper($$ = tASET); }
|
|
|
|
| '`' { ifndef_ripper($$ = '`'); }
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-12-21 06:22:22 +03:00
|
|
|
reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__
|
|
|
|
| keyword_BEGIN | keyword_END
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_alias | keyword_and | keyword_begin
|
|
|
|
| keyword_break | keyword_case | keyword_class | keyword_def
|
|
|
|
| keyword_defined | keyword_do | keyword_else | keyword_elsif
|
|
|
|
| keyword_end | keyword_ensure | keyword_false
|
|
|
|
| keyword_for | keyword_in | keyword_module | keyword_next
|
|
|
|
| keyword_nil | keyword_not | keyword_or | keyword_redo
|
|
|
|
| keyword_rescue | keyword_retry | keyword_return | keyword_self
|
|
|
|
| keyword_super | keyword_then | keyword_true | keyword_undef
|
|
|
|
| keyword_when | keyword_yield | keyword_if | keyword_unless
|
|
|
|
| keyword_while | keyword_until
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
arg : lhs '=' arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr($3);
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = node_assign($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch2(assign, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| lhs '=' arg modifier_rescue arg
|
2003-03-03 08:17:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-05-08 19:54:32 +04:00
|
|
|
value_expr($3);
|
|
|
|
$3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
|
|
|
|
$$ = node_assign($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2008-05-08 19:54:32 +04:00
|
|
|
$$ = dispatch2(assign, $1, dispatch2(rescue_mod, $3, $5));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
}
|
2002-02-13 12:01:11 +03:00
|
|
|
| var_lhs tOP_ASGN arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr($3);
|
2002-02-13 12:01:11 +03:00
|
|
|
if ($1) {
|
2002-02-14 11:47:58 +03:00
|
|
|
ID vid = $1->nd_vid;
|
2001-11-08 09:43:14 +03:00
|
|
|
if ($2 == tOROP) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_OR(gettable(vid), $1);
|
2002-09-13 13:36:28 +04:00
|
|
|
if (is_asgn_or_id(vid)) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$$->nd_aid = vid;
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
2001-05-07 13:26:29 +04:00
|
|
|
}
|
2001-11-08 09:43:14 +03:00
|
|
|
else if ($2 == tANDOP) {
|
2002-02-13 12:01:11 +03:00
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_AND(gettable(vid), $1);
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
|
|
|
else {
|
2002-02-13 12:01:11 +03:00
|
|
|
$$ = $1;
|
2007-08-09 11:04:56 +04:00
|
|
|
$$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
|
2001-11-08 09:43:14 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
else {
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $2, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-05-08 19:54:32 +04:00
|
|
|
| var_lhs tOP_ASGN arg modifier_rescue arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
value_expr($3);
|
|
|
|
$3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
|
|
|
|
if ($1) {
|
|
|
|
ID vid = $1->nd_vid;
|
|
|
|
if ($2 == tOROP) {
|
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_OR(gettable(vid), $1);
|
|
|
|
if (is_asgn_or_id(vid)) {
|
|
|
|
$$->nd_aid = vid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($2 == tANDOP) {
|
|
|
|
$1->nd_value = $3;
|
|
|
|
$$ = NEW_OP_ASGN_AND(gettable(vid), $1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = $1;
|
|
|
|
$$->nd_value = NEW_CALL(gettable(vid), $2, NEW_LIST($3));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = NEW_BEGIN(0);
|
|
|
|
}
|
|
|
|
/*%
|
|
|
|
$3 = dispatch2(rescue_mod, $3, $5);
|
|
|
|
$$ = dispatch3(opassign, $1, $2, $3);
|
|
|
|
%*/
|
|
|
|
}
|
2006-06-10 20:09:12 +04:00
|
|
|
| primary_value '[' opt_call_args rbracket tOP_ASGN arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-02-12 22:15:46 +03:00
|
|
|
NODE *args;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2008-02-12 22:15:46 +03:00
|
|
|
value_expr($6);
|
|
|
|
if (!$3) $3 = NEW_ZARRAY();
|
2009-09-18 11:15:06 +04:00
|
|
|
args = arg_concat($3, $6);
|
1999-01-20 07:59:39 +03:00
|
|
|
if ($5 == tOROP) {
|
|
|
|
$5 = 0;
|
|
|
|
}
|
|
|
|
else if ($5 == tANDOP) {
|
|
|
|
$5 = 1;
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
$$ = NEW_OP_ASGN1($1, $5, args);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2005-09-05 17:29:01 +04:00
|
|
|
$1 = dispatch2(aref_field, $1, escape_Qundef($3));
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $5, $6);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tIDENTIFIER tOP_ASGN arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
1999-01-20 07:59:39 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$1 = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $4, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' tCONSTANT tOP_ASGN arg
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
1999-01-20 07:59:39 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$1 = dispatch3(field, $1, ripper_id2sym('.'), $3);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $4, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-11 11:02:23 +04:00
|
|
|
value_expr($5);
|
2000-02-01 06:12:21 +03:00
|
|
|
if ($4 == tOROP) {
|
|
|
|
$4 = 0;
|
|
|
|
}
|
|
|
|
else if ($4 == tANDOP) {
|
|
|
|
$4 = 1;
|
|
|
|
}
|
|
|
|
$$ = NEW_OP_ASGN2($1, $3, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$1 = dispatch3(field, $1, ripper_intern("::"), $3);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch3(opassign, $1, $4, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2003-03-03 08:17:39 +03:00
|
|
|
| primary_value tCOLON2 tCONSTANT tOP_ASGN arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
yyerror("constant re-assignment");
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_field, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch3(opassign, $$, $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(assign_error, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-03-03 08:17:39 +03:00
|
|
|
}
|
2003-08-14 21:20:14 +04:00
|
|
|
| tCOLON3 tCONSTANT tOP_ASGN arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
yyerror("constant re-assignment");
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(top_const_field, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch3(opassign, $$, $3, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(assign_error, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-08-14 21:20:14 +04:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| backref tOP_ASGN arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_backref_error($1);
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_field, $1);
|
|
|
|
$$ = dispatch3(opassign, $$, $2, $3);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(assign_error, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tDOT2 arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-12 13:22:20 +04:00
|
|
|
value_expr($1);
|
|
|
|
value_expr($3);
|
2008-08-04 11:48:52 +04:00
|
|
|
$$ = NEW_DOT2($1, $3);
|
2005-05-01 04:15:25 +04:00
|
|
|
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
|
|
|
|
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
|
2008-08-04 11:48:52 +04:00
|
|
|
deferred_nodes = list_append(deferred_nodes, $$);
|
2005-05-01 04:15:25 +04:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(dot2, $1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tDOT3 arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-12 13:22:20 +04:00
|
|
|
value_expr($1);
|
|
|
|
value_expr($3);
|
2008-08-04 11:48:52 +04:00
|
|
|
$$ = NEW_DOT3($1, $3);
|
2005-05-01 04:15:25 +04:00
|
|
|
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
|
|
|
|
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
|
2008-08-04 11:48:52 +04:00
|
|
|
deferred_nodes = list_append(deferred_nodes, $$);
|
2005-05-01 04:15:25 +04:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(dot3, $1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '+' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '+', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('+'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '-' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '-', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('-'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '*' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '*', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('*'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '/' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '/', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('/'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '%' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '%', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('%'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tPOW arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tPOW, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("**"), $3);
|
|
|
|
%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
}
|
|
|
|
| tUMINUS_NUM tINTEGER tPOW arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $2, ripper_intern("**"), $4);
|
|
|
|
$$ = dispatch2(unary, ripper_intern("-@"), $$);
|
|
|
|
%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
}
|
|
|
|
| tUMINUS_NUM tFLOAT tPOW arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $2, ripper_intern("**"), $4);
|
|
|
|
$$ = dispatch2(unary, ripper_intern("-@"), $$);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| tUPLUS arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-12-07 05:51:31 +03:00
|
|
|
$$ = call_uni_op($2, tUPLUS);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("+@"), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| tUMINUS arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_uni_op($2, tUMINUS);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("-@"), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '|' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '|', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-12-07 05:52:37 +03:00
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('|'), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '^' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '^', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('^'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '&' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '&', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('&'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tCMP arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tCMP, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("<=>"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '>' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '>', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('>'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tGEQ arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tGEQ, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern(">="), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| arg '<' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, '<', $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ID2SYM('<'), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tLEQ arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tLEQ, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("<="), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tEQ arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tEQ, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("=="), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tEQQ arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tEQQ, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("==="), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tNEQ arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-12-09 19:39:49 +03:00
|
|
|
$$ = call_bin_op($1, tNEQ, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("!="), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tMATCH arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-09-17 13:24:13 +04:00
|
|
|
$$ = match_op($1, $3);
|
2007-12-18 14:26:24 +03:00
|
|
|
if (nd_type($1) == NODE_LIT && TYPE($1->nd_lit) == T_REGEXP) {
|
|
|
|
$$ = reg_named_capture_assign($1->nd_lit, $$);
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("=~"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tNMATCH arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-12-09 19:39:49 +03:00
|
|
|
$$ = call_bin_op($1, tNMATCH, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("!~"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| '!' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-12-12 06:45:36 +03:00
|
|
|
$$ = call_uni_op(cond($2), '!');
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ID2SYM('!'), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| '~' arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_uni_op($2, '~');
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ID2SYM('~'), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tLSHFT arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tLSHFT, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("<<"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tRSHFT arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
$$ = call_bin_op($1, tRSHFT, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern(">>"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tANDOP arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = logop(NODE_AND, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("&&"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| arg tOROP arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = logop(NODE_OR, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(binary, $1, ripper_intern("||"), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_defined opt_nl {in_defined = 1;} arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
in_defined = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_DEFINED($4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
in_defined = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch1(defined, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-08-08 07:28:58 +04:00
|
|
|
| arg '?' arg opt_nl ':' arg
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr($1);
|
2006-08-08 07:28:58 +04:00
|
|
|
$$ = NEW_IF(cond($1), $3, $6);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2006-08-08 07:28:58 +04:00
|
|
|
$$ = dispatch3(ifop, $1, $3, $6);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
| primary
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-02-18 12:52:48 +03:00
|
|
|
arg_value : arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-02-18 12:52:48 +03:00
|
|
|
value_expr($1);
|
|
|
|
$$ = $1;
|
2007-07-23 13:13:44 +04:00
|
|
|
if (!$$) $$ = NEW_NIL();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
2002-02-18 12:52:48 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2002-02-18 12:52:48 +03:00
|
|
|
|
2000-07-03 09:46:36 +04:00
|
|
|
aref_args : none
|
2000-09-04 12:24:09 +04:00
|
|
|
| args trailer
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| args ',' assocs trailer
|
2000-07-03 09:46:36 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-29 07:48:19 +04:00
|
|
|
$$ = arg_append($1, NEW_HASH($3));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = arg_add_assocs($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-07-03 09:46:36 +04:00
|
|
|
}
|
2000-09-04 12:24:09 +04:00
|
|
|
| assocs trailer
|
2000-07-07 07:20:53 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-07-07 07:20:53 +04:00
|
|
|
$$ = NEW_LIST(NEW_HASH($1));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add_assocs(arg_new(), $1);
|
|
|
|
%*/
|
2000-07-07 07:20:53 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
paren_args : '(' opt_call_args rparen
|
2000-09-04 12:24:09 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-01-23 11:08:59 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2006-06-25 12:45:44 +04:00
|
|
|
$$ = dispatch1(arg_paren, escape_Qundef($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-09-04 12:24:09 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-01-23 11:08:59 +03:00
|
|
|
|
|
|
|
opt_paren_args : none
|
|
|
|
| paren_args
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-05-02 00:44:25 +04:00
|
|
|
opt_call_args : none
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| call_args
|
|
|
|
;
|
|
|
|
|
2001-01-20 17:02:28 +03:00
|
|
|
call_args : command
|
2000-07-01 10:51:28 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-01-15 09:06:47 +03:00
|
|
|
value_expr($1);
|
2000-07-01 10:51:28 +04:00
|
|
|
$$ = NEW_LIST($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add(arg_new(), $1);
|
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| args opt_block_arg
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = arg_blk_pass($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add_optblock($1, $2);
|
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
| assocs opt_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_LIST(NEW_HASH($1));
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = arg_blk_pass($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add_assocs(arg_new(), $1);
|
|
|
|
$$ = arg_add_optblock($$, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| args ',' assocs opt_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = arg_append($1, NEW_HASH($3));
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = arg_blk_pass($$, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add_optblock(arg_add_assocs($1, $3), $4);
|
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| block_arg
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
2007-05-02 00:44:25 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = arg_add_block(arg_new(), $1);
|
2007-05-02 00:44:25 +04:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2001-05-30 13:12:34 +04:00
|
|
|
command_args : {
|
2009-03-11 07:27:11 +03:00
|
|
|
$<val>$ = cmdarg_stack;
|
2001-05-30 13:12:34 +04:00
|
|
|
CMDARG_PUSH(1);
|
|
|
|
}
|
2008-06-21 11:29:05 +04:00
|
|
|
call_args
|
2001-05-30 13:12:34 +04:00
|
|
|
{
|
|
|
|
/* CMDARG_POP() */
|
2009-03-11 07:27:11 +03:00
|
|
|
cmdarg_stack = $<val>1;
|
2001-05-30 13:12:34 +04:00
|
|
|
$$ = $2;
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-05-30 13:12:34 +04:00
|
|
|
|
2002-02-18 12:52:48 +03:00
|
|
|
block_arg : tAMPER arg_value
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = NEW_BLOCK_PASS($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $2;
|
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
opt_block_arg : ',' block_arg
|
|
|
|
{
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $2;
|
|
|
|
}
|
2008-10-18 15:49:39 +04:00
|
|
|
| ','
|
|
|
|
{
|
|
|
|
$$ = 0;
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| none
|
2007-06-08 09:58:06 +04:00
|
|
|
{
|
|
|
|
$$ = 0;
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-05-02 00:44:25 +04:00
|
|
|
args : arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_LIST($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add(arg_new(), $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| tSTAR arg_value
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_SPLAT($2);
|
|
|
|
/*%
|
2006-06-10 03:18:04 +04:00
|
|
|
$$ = arg_add_star(arg_new(), $2);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| args ',' arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-02-12 10:18:49 +03:00
|
|
|
NODE *n1;
|
|
|
|
if ((n1 = splat_array($1)) != 0) {
|
|
|
|
$$ = list_append(n1, $3);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = arg_append($1, $3);
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add($1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
| args ',' tSTAR arg_value
|
|
|
|
{
|
|
|
|
/*%%%*/
|
2008-02-12 10:18:49 +03:00
|
|
|
NODE *n1;
|
2008-10-22 00:45:35 +04:00
|
|
|
if ((nd_type($4) == NODE_ARRAY) && (n1 = splat_array($1)) != 0) {
|
2008-02-12 10:18:49 +03:00
|
|
|
$$ = list_concat(n1, $4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = arg_concat($1, $4);
|
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
|
|
|
$$ = arg_add_star($1, $4);
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2003-01-01 06:24:29 +03:00
|
|
|
mrhs : args ',' arg_value
|
2000-12-05 12:36:54 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-02-12 10:18:49 +03:00
|
|
|
NODE *n1;
|
|
|
|
if ((n1 = splat_array($1)) != 0) {
|
|
|
|
$$ = list_append(n1, $3);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = arg_append($1, $3);
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mrhs_add(args2mrhs($1), $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| args ',' tSTAR arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-02-12 10:18:49 +03:00
|
|
|
NODE *n1;
|
|
|
|
if (nd_type($4) == NODE_ARRAY &&
|
|
|
|
(n1 = splat_array($1)) != 0) {
|
|
|
|
$$ = list_concat(n1, $4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$$ = arg_concat($1, $4);
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mrhs_add_star(args2mrhs($1), $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| tSTAR arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-03-26 10:01:14 +03:00
|
|
|
$$ = NEW_SPLAT($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mrhs_add_star(mrhs_new(), $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
primary : literal
|
2002-06-24 11:20:42 +04:00
|
|
|
| strings
|
|
|
|
| xstring
|
|
|
|
| regexp
|
2002-06-26 12:01:00 +04:00
|
|
|
| words
|
|
|
|
| qwords
|
1998-01-16 15:13:05 +03:00
|
|
|
| var_ref
|
|
|
|
| backref
|
2000-02-01 06:12:21 +03:00
|
|
|
| tFID
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-07-18 09:29:46 +04:00
|
|
|
$$ = NEW_FCALL($1, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = method_arg(dispatch1(fcall, $1), arg_new());
|
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_begin
|
2002-11-14 16:51:19 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-06-10 11:58:09 +04:00
|
|
|
$<num>$ = ruby_sourceline;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
%*/
|
2002-11-14 16:51:19 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2005-03-23 10:15:49 +03:00
|
|
|
if ($3 == NULL) {
|
2004-06-30 06:39:38 +04:00
|
|
|
$$ = NEW_NIL();
|
2005-03-23 10:15:49 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (nd_type($3) == NODE_RESCUE ||
|
|
|
|
nd_type($3) == NODE_ENSURE)
|
2007-06-10 11:58:09 +04:00
|
|
|
nd_set_line($3, $<num>2);
|
2004-06-30 06:39:38 +04:00
|
|
|
$$ = NEW_BEGIN($3);
|
2005-03-23 10:15:49 +03:00
|
|
|
}
|
2007-06-10 11:58:09 +04:00
|
|
|
nd_set_line($$, $<num>2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(begin, $3);
|
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2004-02-12 09:23:24 +03:00
|
|
|
| tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} rparen
|
2001-05-30 13:12:34 +04:00
|
|
|
{
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_warning0("(...) interpreted as grouped expression");
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-05-30 13:12:34 +04:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(paren, $2);
|
|
|
|
%*/
|
2001-05-30 13:12:34 +04:00
|
|
|
}
|
2000-02-01 06:12:21 +03:00
|
|
|
| tLPAREN compstmt ')'
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-07-20 05:39:30 +04:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(paren, $2);
|
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 tCONSTANT
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
$$ = NEW_COLON2($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(const_path_ref, $1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2003-08-14 21:20:14 +04:00
|
|
|
| tCOLON3 tCONSTANT
|
2000-02-01 06:12:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
$$ = NEW_COLON3($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(top_const_ref, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2000-09-12 09:37:38 +04:00
|
|
|
| tLBRACK aref_args ']'
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
if ($2 == 0) {
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_ZARRAY(); /* zero length array*/
|
2001-06-07 12:29:59 +04:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
else {
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(array, escape_Qundef($2));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| tLBRACE assoc_list '}'
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_HASH($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(hash, escape_Qundef($2));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_return
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
$$ = NEW_RETURN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(return0);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_yield '(' call_args rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-06-20 11:11:44 +04:00
|
|
|
$$ = new_yield($3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(yield, dispatch1(paren, $3));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_yield '(' rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-06-20 11:11:44 +04:00
|
|
|
$$ = NEW_YIELD(0, Qfalse);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(yield, dispatch1(paren, arg_new()));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_yield
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-06-20 11:11:44 +04:00
|
|
|
$$ = NEW_YIELD(0, Qfalse);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(yield0);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_defined opt_nl '(' {in_defined = 1;} expr rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
in_defined = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_DEFINED($5);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
in_defined = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
$$ = dispatch1(defined, $5);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-06-25 16:55:47 +04:00
|
|
|
| keyword_not '(' expr rparen
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = call_uni_op(cond($3), '!');
|
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("not"), $3);
|
|
|
|
%*/
|
|
|
|
}
|
2008-06-25 19:49:17 +04:00
|
|
|
| keyword_not '(' rparen
|
|
|
|
{
|
|
|
|
/*%%%*/
|
2008-06-27 13:35:53 +04:00
|
|
|
$$ = call_uni_op(cond(NEW_NIL()), '!');
|
2008-06-25 19:49:17 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("not"), Qnil);
|
|
|
|
%*/
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| operation brace_block
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$2->nd_iter = NEW_FCALL($1, 0);
|
|
|
|
$$ = $2;
|
2004-01-12 17:27:22 +03:00
|
|
|
fixpos($2->nd_iter, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = method_arg(dispatch1(fcall, $1), arg_new());
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| method_call
|
1999-08-13 09:45:20 +04:00
|
|
|
| method_call brace_block
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
block_dup_check($1->nd_args, $2);
|
1998-01-16 15:13:05 +03:00
|
|
|
$2->nd_iter = $1;
|
2006-12-31 18:02:22 +03:00
|
|
|
$$ = $2;
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-08-16 19:24:15 +04:00
|
|
|
| tLAMBDA lambda
|
2005-07-27 11:27:19 +04:00
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_if expr_value then
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
if_tail
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_IF(cond($2), $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(if, $2, $4, escape_Qundef($5));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_unless expr_value then
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
opt_else
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_UNLESS(cond($2), $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(unless, $2, $4, escape_Qundef($5));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_while {COND_PUSH(1);} expr_value do {COND_POP();}
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = NEW_WHILE(cond($3), $6, 1);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(while, $3, $6);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_until {COND_PUSH(1);} expr_value do {COND_POP();}
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = NEW_UNTIL(cond($3), $6, 1);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(until, $3, $6);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_case expr_value opt_terms
|
1998-01-16 15:13:05 +03:00
|
|
|
case_body
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-12-18 12:46:21 +03:00
|
|
|
$$ = NEW_CASE($2, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(case, $2, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_case opt_terms case_body k_end
|
2000-12-18 12:46:21 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2006-09-02 18:36:22 +04:00
|
|
|
$$ = NEW_CASE(0, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(case, Qnil, $3);
|
|
|
|
%*/
|
2000-12-18 12:46:21 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_for for_var keyword_in
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
{COND_PUSH(1);}
|
2007-05-02 00:44:25 +04:00
|
|
|
expr_value do
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
{COND_POP();}
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-06-15 07:27:33 +04:00
|
|
|
/*
|
|
|
|
* for a, b, c in e
|
|
|
|
* #=>
|
|
|
|
* e.each{|*x| a, b, c = x
|
|
|
|
*
|
|
|
|
* for a in e
|
|
|
|
* #=>
|
|
|
|
* e.each{|x| a, = x}
|
|
|
|
*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
ID id = internal_id();
|
|
|
|
ID *tbl = ALLOC_N(ID, 2);
|
2007-06-15 07:27:33 +04:00
|
|
|
NODE *m = NEW_ARGS_AUX(0, 0);
|
|
|
|
NODE *args, *scope;
|
|
|
|
|
|
|
|
if (nd_type($2) == NODE_MASGN) {
|
|
|
|
/* if args.length == 1 && args[0].kind_of?(Array)
|
|
|
|
* args = args[0]
|
|
|
|
* end
|
|
|
|
*/
|
|
|
|
NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1)));
|
|
|
|
NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0)));
|
|
|
|
m->nd_next = block_append(
|
2007-08-09 11:04:56 +04:00
|
|
|
NEW_IF(
|
2007-06-15 07:27:33 +04:00
|
|
|
NEW_NODE(NODE_AND,
|
|
|
|
NEW_CALL(NEW_CALL(NEW_DVAR(id), rb_intern("length"), 0),
|
|
|
|
rb_intern("=="), one),
|
|
|
|
NEW_CALL(NEW_CALL(NEW_DVAR(id), rb_intern("[]"), zero),
|
|
|
|
rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))),
|
2007-08-09 11:04:56 +04:00
|
|
|
0),
|
2008-10-10 23:19:36 +04:00
|
|
|
NEW_DASGN_CURR(id,
|
|
|
|
NEW_CALL(NEW_DVAR(id), rb_intern("[]"), zero)),
|
|
|
|
0),
|
2007-06-15 07:27:33 +04:00
|
|
|
node_assign($2, NEW_DVAR(id)));
|
2008-10-10 23:19:36 +04:00
|
|
|
|
|
|
|
args = new_args(m, 0, id, 0, 0);
|
2007-06-15 07:27:33 +04:00
|
|
|
}
|
|
|
|
else {
|
2008-10-10 23:19:36 +04:00
|
|
|
if (nd_type($2) == NODE_LASGN ||
|
|
|
|
nd_type($2) == NODE_DASGN ||
|
|
|
|
nd_type($2) == NODE_DASGN_CURR) {
|
|
|
|
$2->nd_value = NEW_DVAR(id);
|
|
|
|
m->nd_plen = 1;
|
|
|
|
m->nd_next = $2;
|
|
|
|
args = new_args(m, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id));
|
|
|
|
args = new_args(m, 0, id, 0, 0);
|
|
|
|
}
|
2007-06-15 07:27:33 +04:00
|
|
|
}
|
|
|
|
scope = NEW_NODE(NODE_SCOPE, tbl, $8, args);
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
tbl[0] = 1; tbl[1] = id;
|
|
|
|
$$ = NEW_FOR(0, $5, scope);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(for, $2, $5, $8);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_class cpath superclass
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2001-02-13 08:09:11 +03:00
|
|
|
if (in_def || in_single)
|
1998-01-16 15:13:05 +03:00
|
|
|
yyerror("class definition in method body");
|
2002-03-19 12:03:11 +03:00
|
|
|
local_push(0);
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$<num>$ = ruby_sourceline;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_CLASS($2, $5, $3);
|
|
|
|
nd_set_line($$, $<num>4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(class, $2, $3, $5);
|
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_class tLSHFT expr
|
2001-02-26 08:29:06 +03:00
|
|
|
{
|
|
|
|
$<num>$ = in_def;
|
2007-05-02 00:44:25 +04:00
|
|
|
in_def = 0;
|
2001-02-26 08:29:06 +03:00
|
|
|
}
|
|
|
|
term
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2007-05-02 00:44:25 +04:00
|
|
|
$<num>$ = in_single;
|
|
|
|
in_single = 0;
|
2002-03-19 12:03:11 +03:00
|
|
|
local_push(0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_SCLASS($3, $7);
|
|
|
|
fixpos($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(sclass, $3, $7);
|
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
2008-12-16 10:29:47 +03:00
|
|
|
in_def = $<num>4;
|
|
|
|
in_single = $<num>6;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_module cpath
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2001-02-13 08:09:11 +03:00
|
|
|
if (in_def || in_single)
|
1998-01-16 15:13:05 +03:00
|
|
|
yyerror("module definition in method body");
|
2002-03-19 12:03:11 +03:00
|
|
|
local_push(0);
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$<num>$ = ruby_sourceline;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_MODULE($2, $4);
|
|
|
|
nd_set_line($$, $<num>3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(module, $2, $4);
|
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_def fname
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2001-02-13 08:09:11 +03:00
|
|
|
$<id>$ = cur_mid;
|
1998-01-16 15:13:05 +03:00
|
|
|
cur_mid = $2;
|
2001-02-13 08:09:11 +03:00
|
|
|
in_def++;
|
2002-03-19 12:03:11 +03:00
|
|
|
local_push(0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
f_arglist
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-02-03 05:23:20 +03:00
|
|
|
NODE *body = remove_begin($5);
|
|
|
|
reduce_nodes(&body);
|
|
|
|
$$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE);
|
2009-12-04 10:50:15 +03:00
|
|
|
nd_set_line($$, $<num>1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(def, $2, $4, $5);
|
2008-12-16 10:29:47 +03:00
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
2005-02-27 00:08:24 +03:00
|
|
|
in_def--;
|
2004-09-12 19:21:49 +04:00
|
|
|
cur_mid = $<id>3;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-08-30 11:29:41 +04:00
|
|
|
| k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
in_single++;
|
2007-05-02 00:44:25 +04:00
|
|
|
lex_state = EXPR_END; /* force for args */
|
2007-04-26 12:18:00 +04:00
|
|
|
local_push(0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
f_arglist
|
2002-03-26 09:18:51 +03:00
|
|
|
bodystmt
|
2008-08-30 11:29:41 +04:00
|
|
|
k_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-02-03 05:23:20 +03:00
|
|
|
NODE *body = remove_begin($8);
|
|
|
|
reduce_nodes(&body);
|
|
|
|
$$ = NEW_DEFS($2, $5, $7, body);
|
2009-12-04 10:50:15 +03:00
|
|
|
nd_set_line($$, $<num>1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch5(defs, $2, $3, $5, $7, $8);
|
|
|
|
%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
local_pop();
|
2008-12-16 10:29:47 +03:00
|
|
|
in_single--;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_break
|
2001-05-22 12:28:11 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
$$ = NEW_BREAK(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(break, arg_new());
|
|
|
|
%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_next
|
2001-05-22 12:28:11 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
$$ = NEW_NEXT(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(next, arg_new());
|
|
|
|
%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_redo
|
2001-05-22 12:28:11 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
$$ = NEW_REDO();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(redo);
|
|
|
|
%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_retry
|
2001-05-22 12:28:11 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
$$ = NEW_RETRY();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(retry);
|
|
|
|
%*/
|
2001-05-22 12:28:11 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-05-02 00:44:25 +04:00
|
|
|
primary_value : primary
|
2002-02-18 12:52:48 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-02-18 12:52:48 +03:00
|
|
|
value_expr($1);
|
|
|
|
$$ = $1;
|
2007-07-23 13:13:44 +04:00
|
|
|
if (!$$) $$ = NEW_NIL();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
2002-02-18 12:52:48 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2002-02-18 12:52:48 +03:00
|
|
|
|
2008-08-30 11:29:41 +04:00
|
|
|
k_begin : keyword_begin
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("begin");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_if : keyword_if
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("if");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_unless : keyword_unless
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("unless");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_while : keyword_while
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("while");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_until : keyword_until
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("until");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_case : keyword_case
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("case");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_for : keyword_for
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("for");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_class : keyword_class
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("class");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_module : keyword_module
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("module");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_def : keyword_def
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_push("def");
|
2009-12-04 10:50:15 +03:00
|
|
|
/*%%%*/
|
|
|
|
$<num>$ = ruby_sourceline;
|
|
|
|
/*%
|
|
|
|
%*/
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
k_end : keyword_end
|
|
|
|
{
|
2009-10-13 13:23:19 +04:00
|
|
|
token_info_pop("end");
|
2008-08-30 11:29:41 +04:00
|
|
|
}
|
2009-05-11 17:54:59 +04:00
|
|
|
;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
then : term
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
|
|
|
{ $$ = Qnil; }
|
|
|
|
%*/
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_then
|
|
|
|
| term keyword_then
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
|
|
|
{ $$ = $2; }
|
|
|
|
%*/
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:19:22 +03:00
|
|
|
|
|
|
|
do : term
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
|
|
|
{ $$ = Qnil; }
|
|
|
|
%*/
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_do_cond
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
if_tail : opt_else
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_elsif expr_value then
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
if_tail
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_IF(cond($2), $4, $5);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(elsif, $2, $4, escape_Qundef($5));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
opt_else : none
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_else compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(else, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-05-02 00:44:25 +04:00
|
|
|
for_var : lhs
|
1998-01-16 15:13:05 +03:00
|
|
|
| mlhs
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
f_marg : f_norm_arg
|
2006-10-03 19:59:45 +04:00
|
|
|
{
|
2007-08-15 09:22:44 +04:00
|
|
|
$$ = assignable($1, 0);
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = dispatch1(mlhs_paren, $$);
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| tLPAREN f_margs rparen
|
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-08-15 09:22:44 +04:00
|
|
|
$$ = $2;
|
2006-10-03 19:59:45 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(mlhs_paren, $2);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2007-08-09 09:01:37 +04:00
|
|
|
f_marg_list : f_marg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-08-15 08:52:56 +04:00
|
|
|
$$ = NEW_LIST($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = mlhs_add(mlhs_new(), $1);
|
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| f_marg_list ',' f_marg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
$$ = list_append($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = mlhs_add($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2007-08-09 09:01:37 +04:00
|
|
|
f_margs : f_marg_list
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
$$ = NEW_MASGN($1, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| f_marg_list ',' tSTAR f_norm_arg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = assignable($4, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_MASGN($1, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = mlhs_add_star($1, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = assignable($4, 0);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_MASGN($1, NEW_POSTARG($$, $6));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = mlhs_add_star($1, $$);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| f_marg_list ',' tSTAR
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_MASGN($1, -1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = mlhs_add_star($1, Qnil);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| f_marg_list ',' tSTAR ',' f_marg_list
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-07-07 11:16:05 +04:00
|
|
|
$$ = NEW_MASGN($1, NEW_POSTARG(-1, $5));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = mlhs_add_star($1, $5);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| tSTAR f_norm_arg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = assignable($2, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_MASGN(0, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = mlhs_add_star(mlhs_new(), $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| tSTAR f_norm_arg ',' f_marg_list
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = assignable($2, 0);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_MASGN(0, NEW_POSTARG($$, $4));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
#if 0
|
|
|
|
TODO: Check me
|
|
|
|
#endif
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = mlhs_add_star($$, $4);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| tSTAR
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_MASGN(0, -1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = mlhs_add_star(mlhs_new(), Qnil);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-08-09 09:01:37 +04:00
|
|
|
| tSTAR ',' f_marg_list
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = mlhs_add_star(mlhs_new(), Qnil);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
;
|
|
|
|
|
2008-09-06 22:39:36 +04:00
|
|
|
block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, $5, 0, $6);
|
|
|
|
/*%
|
|
|
|
$$ = params_new($1, $3, $5, Qnil, escape_Qundef($6));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, $5, $7, $8);
|
|
|
|
/*%
|
|
|
|
$$ = params_new($1, $3, $5, $7, escape_Qundef($8));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_arg ',' f_block_optarg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, 0, 0, $4);
|
|
|
|
/*%
|
|
|
|
$$ = params_new($1, $3, Qnil, Qnil, escape_Qundef($4));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_arg ',' f_block_optarg ',' f_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, 0, $5, $6);
|
|
|
|
/*%
|
|
|
|
$$ = params_new($1, $3, Qnil, $5, escape_Qundef($6));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_arg ',' f_rest_arg opt_f_block_arg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args($1, 0, $3, 0, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, $3, Qnil, escape_Qundef($4));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2007-05-02 00:44:25 +04:00
|
|
|
| f_arg ','
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-06-25 20:05:17 +04:00
|
|
|
$$ = new_args($1, 0, 1, 0, 0);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, Qnil, Qnil, Qnil);
|
|
|
|
dispatch1(excessed_comma, $$);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_arg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
2006-07-10 05:08:15 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args($1, 0, $3, $5, $6);
|
2006-07-10 05:08:15 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, $3, $5, escape_Qundef($6));
|
2006-07-10 05:08:15 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_arg opt_f_block_arg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args($1, 0, 0, 0, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil,Qnil, Qnil, escape_Qundef($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
2008-09-06 22:39:36 +04:00
|
|
|
| f_block_optarg ',' f_rest_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, $3, 0, $4);
|
|
|
|
/*%
|
|
|
|
$$ = params_new(Qnil, $1, $3, Qnil, escape_Qundef($4));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_block_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, $3, $5, $6);
|
|
|
|
/*%
|
|
|
|
$$ = params_new(Qnil, $1, $3, $5, escape_Qundef($6));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_block_optarg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, 0, 0, $2);
|
|
|
|
/*%
|
|
|
|
$$ = params_new(Qnil, $1, Qnil, Qnil,escape_Qundef($2));
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_block_optarg ',' f_arg opt_f_block_arg
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, 0, $3, $4);
|
|
|
|
/*%
|
|
|
|
$$ = params_new(Qnil, $1, Qnil, $3, escape_Qundef($4));
|
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_rest_arg opt_f_block_arg
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args(0, 0, $1, 0, $2);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, $1, Qnil, escape_Qundef($2));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_rest_arg ',' f_arg opt_f_block_arg
|
2006-07-10 05:08:15 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args(0, 0, $1, $3, $4);
|
2006-07-10 05:08:15 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, $1, $3, escape_Qundef($4));
|
2006-07-10 05:08:15 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_block_arg
|
2004-05-25 06:54:22 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = new_args(0, 0, 0, 0, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, Qnil, Qnil, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-05-25 06:54:22 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2005-07-28 06:33:28 +04:00
|
|
|
opt_block_param : none
|
|
|
|
| block_param_def
|
2008-02-29 09:12:46 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = TRUE;
|
2008-02-29 09:12:46 +03:00
|
|
|
}
|
2005-03-02 06:21:31 +03:00
|
|
|
;
|
|
|
|
|
2005-07-28 06:33:28 +04:00
|
|
|
block_param_def : '|' opt_bv_decl '|'
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = blockvar_new(params_new(Qnil,Qnil,Qnil,Qnil,Qnil),
|
|
|
|
escape_Qundef($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| tOROP
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = 0;
|
2005-03-09 12:29:52 +03:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = blockvar_new(params_new(Qnil,Qnil,Qnil,Qnil,Qnil),
|
|
|
|
Qnil);
|
2005-03-09 12:29:52 +03:00
|
|
|
%*/
|
|
|
|
}
|
2005-07-28 06:33:28 +04:00
|
|
|
| '|' block_param opt_bv_decl '|'
|
2005-03-09 12:29:52 +03:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = blockvar_new(escape_Qundef($2), escape_Qundef($3));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-03-09 12:29:52 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
opt_bv_decl : none
|
|
|
|
| ';' bv_decls
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = $2;
|
2005-03-09 12:29:52 +03:00
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2006-10-06 02:32:04 +04:00
|
|
|
bv_decls : bvar
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
2005-03-09 12:29:52 +03:00
|
|
|
{
|
2009-10-03 17:14:19 +04:00
|
|
|
$$ = rb_ary_new3(1, $1);
|
2005-03-09 12:29:52 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
%*/
|
2006-10-06 02:32:04 +04:00
|
|
|
| bv_decls ',' bvar
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
2005-03-09 12:29:52 +03:00
|
|
|
{
|
2007-09-17 16:02:35 +04:00
|
|
|
rb_ary_push($$, $3);
|
2005-03-09 12:29:52 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
%*/
|
2005-03-09 12:29:52 +03:00
|
|
|
;
|
|
|
|
|
2007-10-29 12:42:18 +03:00
|
|
|
bvar : tIDENTIFIER
|
2005-03-09 12:29:52 +03:00
|
|
|
{
|
2009-10-03 17:14:19 +04:00
|
|
|
new_bv(get_id($1));
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
2005-03-09 12:29:52 +03:00
|
|
|
/*%
|
2009-10-03 17:14:19 +04:00
|
|
|
$$ = get_value($1);
|
2005-03-09 12:29:52 +03:00
|
|
|
%*/
|
|
|
|
}
|
2007-10-29 12:42:18 +03:00
|
|
|
| f_bad_arg
|
|
|
|
{
|
|
|
|
$$ = 0;
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2000-10-16 13:13:20 +04:00
|
|
|
|
2007-02-23 06:25:26 +03:00
|
|
|
lambda : {
|
2009-12-01 06:01:15 +03:00
|
|
|
$<vars>$ = dyna_push();
|
|
|
|
}
|
|
|
|
{
|
|
|
|
$<num>$ = lpar_beg;
|
2007-02-23 06:25:26 +03:00
|
|
|
lpar_beg = ++paren_nest;
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
2005-07-27 11:27:19 +04:00
|
|
|
f_larglist
|
|
|
|
lambda_body
|
|
|
|
{
|
2009-12-01 06:01:15 +03:00
|
|
|
lpar_beg = $<num>2;
|
2005-07-27 11:27:19 +04:00
|
|
|
/*%%%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
$$ = $3;
|
|
|
|
$$->nd_body = NEW_SCOPE($3->nd_head, $4);
|
2005-07-27 11:27:19 +04:00
|
|
|
/*%
|
2009-12-01 06:01:15 +03:00
|
|
|
$$ = dispatch2(lambda, $3, $4);
|
2005-07-27 11:27:19 +04:00
|
|
|
%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
dyna_pop($<vars>1);
|
2005-07-27 11:27:19 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2005-07-27 18:30:09 +04:00
|
|
|
f_larglist : '(' f_args opt_bv_decl rparen
|
2005-07-27 11:27:19 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_LAMBDA($2);
|
2005-07-27 11:27:19 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(paren, $2);
|
|
|
|
%*/
|
|
|
|
}
|
2008-10-22 10:03:12 +04:00
|
|
|
| f_args
|
2005-07-27 11:27:19 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_LAMBDA($1);
|
2005-07-27 11:27:19 +04:00
|
|
|
/*%
|
2005-08-12 12:13:28 +04:00
|
|
|
$$ = $1;
|
2005-07-27 11:27:19 +04:00
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2005-08-16 19:24:15 +04:00
|
|
|
lambda_body : tLAMBEG compstmt '}'
|
2005-07-27 11:27:19 +04:00
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_do_LAMBDA compstmt keyword_end
|
2005-07-27 11:27:19 +04:00
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
do_block : keyword_do_block
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-12-01 06:01:15 +03:00
|
|
|
$<vars>1 = dyna_push();
|
|
|
|
/*%%%*/
|
|
|
|
$<num>$ = ruby_sourceline;
|
|
|
|
/*% %*/
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2005-07-28 06:33:28 +04:00
|
|
|
opt_block_param
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
2006-06-26 18:15:49 +04:00
|
|
|
keyword_end
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ITER($3,$4);
|
2009-12-01 06:01:15 +03:00
|
|
|
nd_set_line($$, $<num>2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch2(do_block, escape_Qundef($3), $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
dyna_pop($<vars>1);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2001-01-26 08:02:19 +03:00
|
|
|
block_call : command do_block
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2008-12-16 03:16:46 +03:00
|
|
|
if (nd_type($1) == NODE_YIELD) {
|
|
|
|
compile_error(PARSER_ARG "block given to yield");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
block_dup_check($1->nd_args, $2);
|
2009-02-22 17:23:33 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
$2->nd_iter = $1;
|
2006-12-31 18:02:22 +03:00
|
|
|
$$ = $2;
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = method_add_block($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-06-28 18:42:46 +04:00
|
|
|
| block_call '.' operation2 opt_paren_args
|
2001-01-20 17:02:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
|
|
|
|
$$ = method_optarg($$, $4);
|
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
2002-06-28 18:42:46 +04:00
|
|
|
| block_call tCOLON2 operation2 opt_paren_args
|
2001-01-20 17:02:28 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(call, $1, ripper_intern("::"), $3);
|
|
|
|
$$ = method_optarg($$, $4);
|
|
|
|
%*/
|
2001-01-20 17:02:28 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2001-01-23 11:08:59 +03:00
|
|
|
method_call : operation paren_args
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_FCALL($1, $2);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = method_arg(dispatch1(fcall, $1), $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value '.' operation2 opt_paren_args
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
|
|
|
|
$$ = method_optarg($$, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 operation2 paren_args
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, $4);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
|
|
|
|
$$ = method_optarg($$, $4);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
| primary_value tCOLON2 operation3
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_CALL($1, $3, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(call, $1, ripper_intern("::"), $3);
|
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2006-06-21 09:13:48 +04:00
|
|
|
| primary_value '.' paren_args
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_CALL($1, rb_intern("call"), $3);
|
|
|
|
fixpos($$, $1);
|
|
|
|
/*%
|
2009-10-20 10:28:51 +04:00
|
|
|
$$ = dispatch3(call, $1, ripper_id2sym('.'),
|
|
|
|
ripper_intern("call"));
|
2006-06-21 09:13:48 +04:00
|
|
|
$$ = method_optarg($$, $3);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| primary_value tCOLON2 paren_args
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_CALL($1, rb_intern("call"), $3);
|
|
|
|
fixpos($$, $1);
|
|
|
|
/*%
|
2009-10-20 10:28:51 +04:00
|
|
|
$$ = dispatch3(call, $1, ripper_intern("::"),
|
|
|
|
ripper_intern("call"));
|
2006-06-21 09:13:48 +04:00
|
|
|
$$ = method_optarg($$, $3);
|
|
|
|
%*/
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_super paren_args
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = NEW_SUPER($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(super, $2);
|
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_super
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
$$ = NEW_ZSUPER();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(zsuper);
|
|
|
|
%*/
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2006-06-10 20:09:12 +04:00
|
|
|
| primary_value '[' opt_call_args rbracket
|
2005-06-12 20:56:06 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
if ($1 && nd_type($1) == NODE_SELF)
|
|
|
|
$$ = NEW_FCALL(tAREF, $3);
|
|
|
|
else
|
|
|
|
$$ = NEW_CALL($1, tAREF, $3);
|
|
|
|
fixpos($$, $1);
|
|
|
|
/*%
|
2005-09-05 17:29:01 +04:00
|
|
|
$$ = dispatch2(aref, $1, escape_Qundef($3));
|
2005-06-12 20:56:06 +04:00
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2001-01-26 08:02:19 +03:00
|
|
|
brace_block : '{'
|
|
|
|
{
|
2009-12-01 06:01:15 +03:00
|
|
|
$<vars>1 = dyna_push();
|
|
|
|
/*%%%*/
|
|
|
|
$<num>$ = ruby_sourceline;
|
|
|
|
/*%
|
|
|
|
%*/
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2005-07-28 06:33:28 +04:00
|
|
|
opt_block_param
|
2001-01-26 08:02:19 +03:00
|
|
|
compstmt '}'
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ITER($3,$4);
|
2009-12-01 06:01:15 +03:00
|
|
|
nd_set_line($$, $<num>2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = dispatch2(brace_block, escape_Qundef($3), $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
dyna_pop($<vars>1);
|
2001-01-26 08:02:19 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_do
|
2001-01-26 08:02:19 +03:00
|
|
|
{
|
2009-12-01 06:01:15 +03:00
|
|
|
$<vars>1 = dyna_push();
|
|
|
|
/*%%%*/
|
|
|
|
$<num>$ = ruby_sourceline;
|
|
|
|
/*%
|
|
|
|
%*/
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2005-07-28 06:33:28 +04:00
|
|
|
opt_block_param
|
2006-06-26 18:15:49 +04:00
|
|
|
compstmt keyword_end
|
2001-01-26 08:02:19 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ITER($3,$4);
|
2009-12-01 06:01:15 +03:00
|
|
|
nd_set_line($$, $<num>2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-13 09:00:23 +04:00
|
|
|
$$ = dispatch2(do_block, escape_Qundef($3), $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2009-12-01 06:01:15 +03:00
|
|
|
dyna_pop($<vars>1);
|
2001-01-26 08:02:19 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2001-01-26 08:02:19 +03:00
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
case_body : keyword_when args then
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
cases
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = NEW_WHEN($2, $4, $5);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch3(when, $2, $4, escape_Qundef($5));
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
cases : opt_else
|
|
|
|
| case_body
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
opt_rescue : keyword_rescue exc_list exc_var then
|
1998-01-16 15:19:22 +03:00
|
|
|
compstmt
|
2002-03-26 09:18:51 +03:00
|
|
|
opt_rescue
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
if ($3) {
|
|
|
|
$3 = node_assign($3, NEW_ERRINFO());
|
2000-03-23 11:37:35 +03:00
|
|
|
$5 = block_append($3, $5);
|
|
|
|
}
|
|
|
|
$$ = NEW_RESBODY($2, $5, $6);
|
2007-05-02 00:44:25 +04:00
|
|
|
fixpos($$, $2?$2:$5);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch4(rescue,
|
2007-05-02 00:44:25 +04:00
|
|
|
escape_Qundef($2),
|
|
|
|
escape_Qundef($3),
|
|
|
|
escape_Qundef($5),
|
|
|
|
escape_Qundef($6));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| none
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2003-12-04 10:41:20 +03:00
|
|
|
exc_list : arg_value
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-12-04 10:41:20 +03:00
|
|
|
$$ = NEW_LIST($1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-05-02 04:39:34 +04:00
|
|
|
$$ = rb_ary_new3(1, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2003-12-04 10:41:20 +03:00
|
|
|
}
|
|
|
|
| mrhs
|
2008-02-12 10:48:37 +03:00
|
|
|
{
|
|
|
|
/*%%%*/
|
2008-02-12 15:04:53 +03:00
|
|
|
if (!($$ = splat_array($1))) $$ = $1;
|
2008-02-12 10:48:37 +03:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
| none
|
|
|
|
;
|
|
|
|
|
|
|
|
exc_var : tASSOC lhs
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
| none
|
|
|
|
;
|
|
|
|
|
2006-06-26 18:15:49 +04:00
|
|
|
opt_ensure : keyword_ensure compstmt
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-10-02 15:34:13 +04:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(ensure, $2);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
| none
|
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
literal : numeric
|
1999-08-13 09:45:20 +04:00
|
|
|
| symbol
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-09-06 05:24:41 +04:00
|
|
|
$$ = NEW_LIT(ID2SYM($1));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(symbol_literal, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-10-23 14:17:30 +04:00
|
|
|
| dsym
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
strings : string
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
NODE *node = $1;
|
|
|
|
if (!node) {
|
2007-09-27 04:42:51 +04:00
|
|
|
node = NEW_STR(STR_NEW0());
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2003-05-21 20:01:49 +04:00
|
|
|
else {
|
|
|
|
node = evstr2dstr(node);
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = node;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-06-24 11:59:02 +04:00
|
|
|
;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
string : tCHAR
|
|
|
|
| string1
|
2002-06-24 11:20:42 +04:00
|
|
|
| string string1
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = literal_concat($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(string_concat, $1, $2);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-06-25 13:56:36 +04:00
|
|
|
string1 : tSTRING_BEG string_contents tSTRING_END
|
1999-10-15 12:52:18 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-25 13:56:36 +04:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(string_literal, $2);
|
|
|
|
%*/
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
;
|
|
|
|
|
2002-06-25 13:56:36 +04:00
|
|
|
xstring : tXSTRING_BEG xstring_contents tSTRING_END
|
1999-10-15 12:52:18 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-25 13:56:36 +04:00
|
|
|
NODE *node = $2;
|
2002-06-24 11:20:42 +04:00
|
|
|
if (!node) {
|
2007-09-27 04:42:51 +04:00
|
|
|
node = NEW_XSTR(STR_NEW0());
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
|
|
|
else {
|
2002-06-24 11:20:42 +04:00
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_STR:
|
|
|
|
nd_set_type(node, NODE_XSTR);
|
|
|
|
break;
|
|
|
|
case NODE_DSTR:
|
|
|
|
nd_set_type(node, NODE_DXSTR);
|
|
|
|
break;
|
|
|
|
default:
|
2009-07-20 14:01:05 +04:00
|
|
|
node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node));
|
2002-06-24 11:20:42 +04:00
|
|
|
break;
|
|
|
|
}
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = node;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(xstring_literal, $2);
|
|
|
|
%*/
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
;
|
|
|
|
|
2002-06-25 13:56:36 +04:00
|
|
|
regexp : tREGEXP_BEG xstring_contents tREGEXP_END
|
1999-10-15 12:52:18 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-25 13:56:36 +04:00
|
|
|
int options = $3;
|
|
|
|
NODE *node = $2;
|
2007-12-02 03:16:24 +03:00
|
|
|
NODE *list;
|
2002-06-24 11:20:42 +04:00
|
|
|
if (!node) {
|
2007-10-19 11:41:03 +04:00
|
|
|
node = NEW_LIT(reg_compile(STR_NEW0(), options));
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
else switch (nd_type(node)) {
|
|
|
|
case NODE_STR:
|
|
|
|
{
|
|
|
|
VALUE src = node->nd_lit;
|
|
|
|
nd_set_type(node, NODE_LIT);
|
2007-10-19 11:41:03 +04:00
|
|
|
node->nd_lit = reg_compile(src, options);
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2009-07-29 03:11:29 +04:00
|
|
|
node = NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node));
|
2002-06-24 11:20:42 +04:00
|
|
|
case NODE_DSTR:
|
|
|
|
if (options & RE_OPTION_ONCE) {
|
|
|
|
nd_set_type(node, NODE_DREGX_ONCE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
nd_set_type(node, NODE_DREGX);
|
|
|
|
}
|
2007-10-19 11:41:03 +04:00
|
|
|
node->nd_cflag = options & RE_OPTION_MASK;
|
2009-07-20 14:01:05 +04:00
|
|
|
if (!NIL_P(node->nd_lit)) reg_fragment_check(node->nd_lit, options);
|
2007-12-02 03:16:24 +03:00
|
|
|
for (list = node->nd_next; list; list = list->nd_next) {
|
|
|
|
if (nd_type(list->nd_head) == NODE_STR) {
|
2007-12-08 10:21:05 +03:00
|
|
|
reg_fragment_check(list->nd_head->nd_lit, options);
|
2007-12-02 03:16:24 +03:00
|
|
|
}
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
$$ = node;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2005-04-14 14:05:29 +04:00
|
|
|
$$ = dispatch2(regexp_literal, $2, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-06-26 12:01:00 +04:00
|
|
|
words : tWORDS_BEG ' ' tSTRING_END
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
$$ = NEW_ZARRAY();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(words_new);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
| tWORDS_BEG word_list tSTRING_END
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
word_list : /* none */
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(words_new);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
| word_list word ' '
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-05-21 20:01:49 +04:00
|
|
|
$$ = list_append($1, evstr2dstr($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(words_add, $1, $2);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
word : string_content
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
|
|
|
{
|
|
|
|
$$ = dispatch0(word_new);
|
|
|
|
$$ = dispatch2(word_add, $$, $1);
|
|
|
|
}
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
| word string_content
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
$$ = literal_concat($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(word_add, $1, $2);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
2002-06-27 21:16:39 +04:00
|
|
|
;
|
2002-06-26 12:01:00 +04:00
|
|
|
|
|
|
|
qwords : tQWORDS_BEG ' ' tSTRING_END
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
$$ = NEW_ZARRAY();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(qwords_new);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
| tQWORDS_BEG qword_list tSTRING_END
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
qword_list : /* none */
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(qwords_new);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
| qword_list tSTRING_CONTENT ' '
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-09-06 05:24:41 +04:00
|
|
|
$$ = list_append($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(qwords_add, $1, $2);
|
|
|
|
%*/
|
2002-06-26 12:01:00 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
string_contents : /* none */
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(string_content);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
| string_contents string_content
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = literal_concat($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(string_add, $1, $2);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
xstring_contents: /* none */
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch0(xstring_new);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
| xstring_contents string_content
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-09-20 18:03:45 +04:00
|
|
|
$$ = literal_concat($1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(xstring_add, $1, $2);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2002-09-06 05:24:41 +04:00
|
|
|
string_content : tSTRING_CONTENT
|
2002-06-24 11:20:42 +04:00
|
|
|
| tSTRING_DVAR
|
|
|
|
{
|
|
|
|
$<node>$ = lex_strterm;
|
|
|
|
lex_strterm = 0;
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
|
|
|
string_dvar
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
lex_strterm = $<node>2;
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = NEW_EVSTR($3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
lex_strterm = $<node>2;
|
|
|
|
$$ = dispatch1(string_dvar, $3);
|
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2003-09-17 15:34:02 +04:00
|
|
|
| tSTRING_DBEG
|
2010-04-18 07:32:06 +04:00
|
|
|
{
|
2010-04-18 17:13:23 +04:00
|
|
|
$<val>1 = cond_stack;
|
|
|
|
$<val>$ = cmdarg_stack;
|
2010-04-18 07:32:06 +04:00
|
|
|
cond_stack = 0;
|
|
|
|
cmdarg_stack = 0;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
|
|
|
$<node>$ = lex_strterm;
|
|
|
|
lex_strterm = 0;
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
|
|
|
compstmt '}'
|
|
|
|
{
|
2010-04-18 17:13:23 +04:00
|
|
|
cond_stack = $<val>1;
|
|
|
|
cmdarg_stack = $<val>2;
|
2010-04-18 07:32:06 +04:00
|
|
|
lex_strterm = $<node>3;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2010-04-18 07:32:06 +04:00
|
|
|
if ($4) $4->flags &= ~NODE_FL_NEWLINE;
|
|
|
|
$$ = new_evstr($4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2010-04-18 07:32:06 +04:00
|
|
|
$$ = dispatch1(string_embexpr, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
string_dvar : tGVAR
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_GVAR($1);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_ref, $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| tIVAR
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_IVAR($1);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_ref, $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| tCVAR
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = NEW_CVAR($1);
|
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_ref, $1);
|
|
|
|
%*/
|
|
|
|
}
|
2002-06-24 19:18:00 +04:00
|
|
|
| backref
|
2002-06-24 11:20:42 +04:00
|
|
|
;
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
symbol : tSYMBEG sym
|
|
|
|
{
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
2009-08-15 05:40:10 +04:00
|
|
|
/*%%%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(symbol, $2);
|
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
sym : fname
|
1999-01-20 07:59:39 +03:00
|
|
|
| tIVAR
|
|
|
|
| tGVAR
|
2000-10-16 13:13:20 +04:00
|
|
|
| tCVAR
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2002-10-23 14:17:30 +04:00
|
|
|
dsym : tSYMBEG xstring_contents tSTRING_END
|
|
|
|
{
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
2009-08-15 05:40:10 +04:00
|
|
|
/*%%%*/
|
2002-11-17 17:01:57 +03:00
|
|
|
if (!($$ = $2)) {
|
2008-01-30 20:20:48 +03:00
|
|
|
$$ = NEW_LIT(ID2SYM(rb_intern("")));
|
2002-10-23 14:17:30 +04:00
|
|
|
}
|
|
|
|
else {
|
2005-11-21 16:52:49 +03:00
|
|
|
VALUE lit;
|
|
|
|
|
2002-10-23 14:17:30 +04:00
|
|
|
switch (nd_type($$)) {
|
|
|
|
case NODE_DSTR:
|
|
|
|
nd_set_type($$, NODE_DSYM);
|
|
|
|
break;
|
2003-03-07 08:59:42 +03:00
|
|
|
case NODE_STR:
|
2005-11-21 16:52:49 +03:00
|
|
|
lit = $$->nd_lit;
|
2007-09-26 13:39:08 +04:00
|
|
|
$$->nd_lit = ID2SYM(rb_intern_str(lit));
|
2007-07-13 06:16:27 +04:00
|
|
|
nd_set_type($$, NODE_LIT);
|
|
|
|
break;
|
2002-10-23 14:17:30 +04:00
|
|
|
default:
|
2009-07-20 14:01:05 +04:00
|
|
|
$$ = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST($$));
|
2002-10-23 14:17:30 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(dyna_symbol, $2);
|
|
|
|
%*/
|
2002-10-23 14:17:30 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2007-05-02 00:44:25 +04:00
|
|
|
numeric : tINTEGER
|
1999-01-20 07:59:39 +03:00
|
|
|
| tFLOAT
|
2003-01-23 06:39:25 +03:00
|
|
|
| tUMINUS_NUM tINTEGER %prec tLOWEST
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
$$ = negate_lit($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("-@"), $2);
|
|
|
|
%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
}
|
|
|
|
| tUMINUS_NUM tFLOAT %prec tLOWEST
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
$$ = negate_lit($2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(unary, ripper_intern("-@"), $2);
|
|
|
|
%*/
|
2003-01-23 06:39:25 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
variable : tIDENTIFIER
|
|
|
|
| tIVAR
|
|
|
|
| tGVAR
|
|
|
|
| tCONSTANT
|
2000-03-23 11:37:35 +03:00
|
|
|
| tCVAR
|
2006-06-26 18:15:49 +04:00
|
|
|
| keyword_nil {ifndef_ripper($$ = keyword_nil);}
|
|
|
|
| keyword_self {ifndef_ripper($$ = keyword_self);}
|
|
|
|
| keyword_true {ifndef_ripper($$ = keyword_true);}
|
|
|
|
| keyword_false {ifndef_ripper($$ = keyword_false);}
|
|
|
|
| keyword__FILE__ {ifndef_ripper($$ = keyword__FILE__);}
|
|
|
|
| keyword__LINE__ {ifndef_ripper($$ = keyword__LINE__);}
|
2007-12-21 06:22:22 +03:00
|
|
|
| keyword__ENCODING__ {ifndef_ripper($$ = keyword__ENCODING__);}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
var_ref : variable
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-07-20 05:39:30 +04:00
|
|
|
if (!($$ = gettable($1))) $$ = NEW_BEGIN(0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(var_ref, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-02-13 12:01:11 +03:00
|
|
|
var_lhs : variable
|
|
|
|
{
|
2002-02-13 19:39:37 +03:00
|
|
|
$$ = assignable($1, 0);
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = dispatch1(var_field, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-02-13 12:01:11 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
2002-02-13 12:01:11 +03:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
backref : tNTH_REF
|
|
|
|
| tBACK_REF
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
superclass : term
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = Qnil;
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| '<'
|
|
|
|
{
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
2002-02-18 12:52:48 +03:00
|
|
|
expr_value term
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
$$ = $3;
|
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
| error term
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
yyerrok;
|
|
|
|
$$ = 0;
|
|
|
|
/*%
|
|
|
|
yyerrok;
|
|
|
|
$$ = Qnil;
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-02-12 09:23:24 +03:00
|
|
|
f_arglist : '(' f_args rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(paren, $2);
|
2009-08-15 05:40:10 +04:00
|
|
|
%*/
|
2004-09-12 19:21:49 +04:00
|
|
|
lex_state = EXPR_BEG;
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = TRUE;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| f_args term
|
|
|
|
{
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
f_args : f_arg ',' f_optarg ',' f_rest_arg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args($1, $3, $5, 0, $6);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, $3, $5, Qnil, escape_Qundef($6));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, $5, $7, $8);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, $3, $5, $7, escape_Qundef($8));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_arg ',' f_optarg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args($1, $3, 0, 0, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, $3, Qnil, Qnil, escape_Qundef($4));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_arg ',' f_optarg ',' f_arg opt_f_block_arg
|
2006-07-12 15:10:22 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, $3, 0, $5, $6);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, $3, Qnil, $5, escape_Qundef($6));
|
2006-07-12 15:10:22 +04:00
|
|
|
%*/
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_arg ',' f_rest_arg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args($1, 0, $3, 0, $4);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, $3, Qnil, escape_Qundef($4));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_arg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args($1, 0, $3, $5, $6);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, $3, $5, escape_Qundef($6));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_arg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args($1, 0, 0, 0, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new($1, Qnil, Qnil, Qnil,escape_Qundef($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_optarg ',' f_rest_arg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args(0, $1, $3, 0, $4);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, $1, $3, Qnil, escape_Qundef($4));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_optarg ',' f_rest_arg ',' f_arg opt_f_block_arg
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, $3, $5, $6);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, $1, $3, $5, escape_Qundef($6));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_optarg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args(0, $1, 0, 0, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, $1, Qnil, Qnil,escape_Qundef($2));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_optarg ',' f_arg opt_f_block_arg
|
2006-07-12 15:10:22 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, $1, 0, $3, $4);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, $1, Qnil, $3, escape_Qundef($4));
|
2006-07-12 15:10:22 +04:00
|
|
|
%*/
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_rest_arg opt_f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args(0, 0, $1, 0, $2);
|
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, $1, Qnil,escape_Qundef($2));
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| f_rest_arg ',' f_arg opt_f_block_arg
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = new_args(0, 0, $1, $3, $4);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, $1, $3, escape_Qundef($4));
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
| f_block_arg
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args(0, 0, 0, 0, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, Qnil, Qnil, $1);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
| /* none */
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
$$ = new_args(0, 0, 0, 0, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = params_new(Qnil, Qnil, Qnil, Qnil, Qnil);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-10-29 12:42:18 +03:00
|
|
|
f_bad_arg : tCONSTANT
|
2000-03-13 10:18:45 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-07-01 10:47:47 +04:00
|
|
|
yyerror("formal argument cannot be a constant");
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(param_error, $1);
|
|
|
|
%*/
|
2000-07-01 10:47:47 +04:00
|
|
|
}
|
2007-05-02 00:44:25 +04:00
|
|
|
| tIVAR
|
2000-07-01 10:47:47 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
yyerror("formal argument cannot be an instance variable");
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(param_error, $1);
|
|
|
|
%*/
|
2000-07-01 10:47:47 +04:00
|
|
|
}
|
2007-05-02 00:44:25 +04:00
|
|
|
| tGVAR
|
2000-07-01 10:47:47 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
yyerror("formal argument cannot be a global variable");
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(param_error, $1);
|
|
|
|
%*/
|
2000-07-01 10:47:47 +04:00
|
|
|
}
|
2007-05-02 00:44:25 +04:00
|
|
|
| tCVAR
|
2000-07-01 10:47:47 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2007-05-02 00:44:25 +04:00
|
|
|
yyerror("formal argument cannot be a class variable");
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
$$ = 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(param_error, $1);
|
|
|
|
%*/
|
2000-03-13 10:18:45 +03:00
|
|
|
}
|
2007-10-29 12:42:18 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
f_norm_arg : f_bad_arg
|
2000-03-13 10:18:45 +03:00
|
|
|
| tIDENTIFIER
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
formal_argument(get_id($1));
|
2005-07-27 11:27:19 +04:00
|
|
|
$$ = $1;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
f_arg_item : f_norm_arg
|
2005-08-10 05:39:24 +04:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
arg_var(get_id($1));
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ARGS_AUX($1, 1);
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = get_value($1);
|
2007-05-02 00:44:25 +04:00
|
|
|
%*/
|
2005-08-10 05:39:24 +04:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
| tLPAREN f_margs rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2007-05-02 00:44:25 +04:00
|
|
|
ID tid = internal_id();
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
arg_var(tid);
|
2009-10-02 15:37:44 +04:00
|
|
|
/*%%%*/
|
2007-05-17 08:25:18 +04:00
|
|
|
if (dyna_in_block()) {
|
|
|
|
$2->nd_value = NEW_DVAR(tid);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$2->nd_value = NEW_LVAR(tid);
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = NEW_ARGS_AUX(tid, 1);
|
2007-05-02 00:44:25 +04:00
|
|
|
$$->nd_next = $2;
|
|
|
|
/*%
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = dispatch1(mlhs_paren, $2);
|
2007-05-02 00:44:25 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
f_arg : f_arg_item
|
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = rb_ary_new3(1, $1);
|
2007-05-17 08:31:05 +04:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
c%*/
|
|
|
|
| f_arg ',' f_arg_item
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
{
|
|
|
|
/*%%%*/
|
2007-05-17 08:25:18 +04:00
|
|
|
$$ = $1;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$->nd_plen++;
|
|
|
|
$$->nd_next = block_append($$->nd_next, $3->nd_next);
|
2007-05-02 00:44:25 +04:00
|
|
|
rb_gc_force_recycle((VALUE)$3);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
/*%
|
2007-04-26 12:18:00 +04:00
|
|
|
$$ = rb_ary_push($1, $3);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
%*/
|
|
|
|
}
|
2007-05-02 04:39:34 +04:00
|
|
|
;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
|
2002-02-18 12:52:48 +03:00
|
|
|
f_opt : tIDENTIFIER '=' arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
arg_var(formal_argument(get_id($1)));
|
|
|
|
$$ = assignable($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_OPT_ARG(0, $$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = rb_assoc_new($$, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-09-06 22:39:36 +04:00
|
|
|
;
|
|
|
|
|
|
|
|
f_block_opt : tIDENTIFIER '=' primary_value
|
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
arg_var(formal_argument(get_id($1)));
|
|
|
|
$$ = assignable($1, $3);
|
2008-09-06 22:39:36 +04:00
|
|
|
/*%%%*/
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = NEW_OPT_ARG(0, $$);
|
2008-09-06 22:39:36 +04:00
|
|
|
/*%
|
2009-10-02 15:37:44 +04:00
|
|
|
$$ = rb_assoc_new($$, $3);
|
2008-09-06 22:39:36 +04:00
|
|
|
%*/
|
|
|
|
}
|
|
|
|
;
|
|
|
|
|
|
|
|
f_block_optarg : f_block_opt
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = $1;
|
|
|
|
/*%
|
|
|
|
$$ = rb_ary_new3(1, $1);
|
|
|
|
%*/
|
|
|
|
}
|
|
|
|
| f_block_optarg ',' f_block_opt
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
NODE *opts = $1;
|
|
|
|
|
|
|
|
while (opts->nd_next) {
|
|
|
|
opts = opts->nd_next;
|
|
|
|
}
|
|
|
|
opts->nd_next = $3;
|
|
|
|
$$ = $1;
|
|
|
|
/*%
|
|
|
|
$$ = rb_ary_push($1, $3);
|
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
f_optarg : f_opt
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = rb_ary_new3(1, $1);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
| f_optarg ',' f_opt
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
NODE *opts = $1;
|
|
|
|
|
|
|
|
while (opts->nd_next) {
|
|
|
|
opts = opts->nd_next;
|
|
|
|
}
|
|
|
|
opts->nd_next = $3;
|
|
|
|
$$ = $1;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = rb_ary_push($1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2003-10-04 21:51:11 +04:00
|
|
|
restarg_mark : '*'
|
|
|
|
| tSTAR
|
|
|
|
;
|
|
|
|
|
|
|
|
f_rest_arg : restarg_mark tIDENTIFIER
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
if (!is_local_id($2))
|
|
|
|
yyerror("rest argument must be local variable");
|
2009-10-02 15:37:44 +04:00
|
|
|
/*% %*/
|
|
|
|
arg_var(shadowing_lvar(get_id($2)));
|
|
|
|
/*%%%*/
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(rest_param, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2003-10-04 21:51:11 +04:00
|
|
|
| restarg_mark
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
$$ = internal_id();
|
2007-05-02 00:44:25 +04:00
|
|
|
arg_var($$);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-09-17 16:02:35 +04:00
|
|
|
$$ = dispatch1(rest_param, Qnil);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2003-10-04 21:51:11 +04:00
|
|
|
blkarg_mark : '&'
|
|
|
|
| tAMPER
|
|
|
|
;
|
|
|
|
|
|
|
|
f_block_arg : blkarg_mark tIDENTIFIER
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2000-02-18 09:59:36 +03:00
|
|
|
if (!is_local_id($2))
|
|
|
|
yyerror("block argument must be local variable");
|
2005-07-28 11:16:22 +04:00
|
|
|
else if (!dyna_in_block() && local_id($2))
|
|
|
|
yyerror("duplicated block argument name");
|
2009-10-02 15:37:44 +04:00
|
|
|
/*% %*/
|
|
|
|
arg_var(shadowing_lvar(get_id($2)));
|
|
|
|
/*%%%*/
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
$$ = $2;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-08-23 10:51:21 +04:00
|
|
|
$$ = dispatch1(blockarg, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
opt_f_block_arg : ',' f_block_arg
|
|
|
|
{
|
|
|
|
$$ = $2;
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
| none
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
{
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%%%*/
|
2007-02-24 11:45:58 +03:00
|
|
|
$$ = 0;
|
2007-05-02 00:44:25 +04:00
|
|
|
/*%
|
|
|
|
$$ = Qundef;
|
|
|
|
%*/
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
singleton : var_ref
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
value_expr($1);
|
2007-07-23 13:13:44 +04:00
|
|
|
$$ = $1;
|
|
|
|
if (!$$) $$ = NEW_NIL();
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = $1;
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-02-12 09:23:24 +03:00
|
|
|
| '(' {lex_state = EXPR_BEG;} expr rparen
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2002-06-12 13:22:20 +04:00
|
|
|
if ($3 == 0) {
|
2003-08-28 00:04:23 +04:00
|
|
|
yyerror("can't define singleton method for ().");
|
2002-06-12 13:22:20 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
switch (nd_type($3)) {
|
|
|
|
case NODE_STR:
|
|
|
|
case NODE_DSTR:
|
|
|
|
case NODE_XSTR:
|
|
|
|
case NODE_DXSTR:
|
|
|
|
case NODE_DREGX:
|
|
|
|
case NODE_LIT:
|
|
|
|
case NODE_ARRAY:
|
|
|
|
case NODE_ZARRAY:
|
2003-08-28 00:04:23 +04:00
|
|
|
yyerror("can't define singleton method for literals");
|
2002-06-12 13:22:20 +04:00
|
|
|
default:
|
|
|
|
value_expr($3);
|
|
|
|
break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
$$ = $3;
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch1(paren, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
assoc_list : none
|
1998-01-16 15:13:05 +03:00
|
|
|
| assocs trailer
|
|
|
|
{
|
2007-04-26 12:18:00 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = $1;
|
2007-04-26 12:18:00 +04:00
|
|
|
/*%
|
2007-05-02 00:44:25 +04:00
|
|
|
$$ = dispatch1(assoclist_from_args, $1);
|
2007-04-26 12:18:00 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
assocs : assoc
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
|
|
|
{
|
|
|
|
$$ = rb_ary_new3(1, $1);
|
|
|
|
}
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
| assocs ',' assoc
|
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = list_concat($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-04-26 12:18:00 +04:00
|
|
|
$$ = rb_ary_push($1, $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-02-18 12:52:48 +03:00
|
|
|
assoc : arg_value tASSOC arg_value
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
$$ = list_append(NEW_LIST($1), $3);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
|
|
|
$$ = dispatch2(assoc_new, $1, $3);
|
|
|
|
%*/
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-02-08 16:39:47 +03:00
|
|
|
| tLABEL arg_value
|
2004-04-05 17:16:40 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%%%*/
|
2004-04-05 17:16:40 +04:00
|
|
|
$$ = list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%
|
2007-04-26 12:18:00 +04:00
|
|
|
$$ = dispatch2(assoc_new, $1, $2);
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2004-04-05 17:16:40 +04:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
operation : tIDENTIFIER
|
|
|
|
| tCONSTANT
|
|
|
|
| tFID
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
operation2 : tIDENTIFIER
|
|
|
|
| tCONSTANT
|
|
|
|
| tFID
|
|
|
|
| op
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
operation3 : tIDENTIFIER
|
|
|
|
| tFID
|
|
|
|
| op
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
dot_or_colon : '.'
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
2004-10-31 08:22:58 +03:00
|
|
|
{ $$ = $<val>1; }
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
1999-01-20 07:59:39 +03:00
|
|
|
| tCOLON2
|
2004-09-12 19:21:49 +04:00
|
|
|
/*%c%*/
|
|
|
|
/*%c
|
2004-10-31 08:22:58 +03:00
|
|
|
{ $$ = $<val>1; }
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
opt_terms : /* none */
|
|
|
|
| terms
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
opt_nl : /* none */
|
|
|
|
| '\n'
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-02-12 09:23:24 +03:00
|
|
|
rparen : opt_nl ')'
|
|
|
|
;
|
|
|
|
|
2006-06-10 20:09:12 +04:00
|
|
|
rbracket : opt_nl ']'
|
|
|
|
;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
trailer : /* none */
|
|
|
|
| '\n'
|
|
|
|
| ','
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
term : ';' {yyerrok;}
|
|
|
|
| '\n'
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
terms : term
|
|
|
|
| terms ';' {yyerrok;}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
none : /* none */
|
|
|
|
{
|
|
|
|
/*%%%*/
|
|
|
|
$$ = 0;
|
|
|
|
/*%
|
2007-05-02 04:39:34 +04:00
|
|
|
$$ = Qundef;
|
2004-09-12 19:21:49 +04:00
|
|
|
%*/
|
|
|
|
}
|
2002-03-26 09:18:51 +03:00
|
|
|
;
|
1998-01-16 15:13:05 +03:00
|
|
|
%%
|
2004-09-12 19:21:49 +04:00
|
|
|
# undef parser
|
2004-09-17 13:24:13 +04:00
|
|
|
# undef yylex
|
2004-09-12 19:21:49 +04:00
|
|
|
# undef yylval
|
2004-09-17 13:24:13 +04:00
|
|
|
# define yylval (*((YYSTYPE*)(parser->parser_yylval)))
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static int parser_regx_options(struct parser_params*);
|
2007-12-01 19:56:19 +03:00
|
|
|
static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**);
|
2007-11-08 01:55:27 +03:00
|
|
|
static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);
|
2005-09-25 04:39:22 +04:00
|
|
|
static int parser_parse_string(struct parser_params*,NODE*);
|
|
|
|
static int parser_here_document(struct parser_params*,NODE*);
|
2004-09-17 13:24:13 +04:00
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
# define nextc() parser_nextc(parser)
|
|
|
|
# define pushback(c) parser_pushback(parser, c)
|
|
|
|
# define newtok() parser_newtok(parser)
|
2007-10-24 12:09:40 +04:00
|
|
|
# define tokspace(n) parser_tokspace(parser, n)
|
2004-09-17 13:24:13 +04:00
|
|
|
# define tokadd(c) parser_tokadd(parser, c)
|
2007-11-08 01:55:27 +03:00
|
|
|
# define tok_hex(numlen) parser_tok_hex(parser, numlen)
|
2007-12-01 19:56:19 +03:00
|
|
|
# define read_escape(flags,e) parser_read_escape(parser, flags, e)
|
2008-02-26 09:44:53 +03:00
|
|
|
# define tokadd_escape(e) parser_tokadd_escape(parser, e)
|
2004-09-17 13:24:13 +04:00
|
|
|
# define regx_options() parser_regx_options(parser)
|
2007-12-01 19:56:19 +03:00
|
|
|
# define tokadd_string(f,t,p,n,e) parser_tokadd_string(parser,f,t,p,n,e)
|
2004-09-17 13:24:13 +04:00
|
|
|
# define parse_string(n) parser_parse_string(parser,n)
|
2007-11-08 01:55:27 +03:00
|
|
|
# define tokaddmbc(c, enc) parser_tokaddmbc(parser, c, enc)
|
2004-09-17 13:24:13 +04:00
|
|
|
# define here_document(n) parser_here_document(parser,n)
|
|
|
|
# define heredoc_identifier() parser_heredoc_identifier(parser)
|
|
|
|
# define heredoc_restore(n) parser_heredoc_restore(parser,n)
|
|
|
|
# define whole_match_p(e,l,i) parser_whole_match_p(parser,e,l,i)
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
#ifndef RIPPER
|
|
|
|
# define set_yylval_str(x) yylval.node = NEW_STR(x)
|
|
|
|
# define set_yylval_num(x) yylval.num = x
|
|
|
|
# define set_yylval_id(x) yylval.id = x
|
2009-10-02 15:37:44 +04:00
|
|
|
# define set_yylval_name(x) yylval.id = x
|
2004-09-12 19:21:49 +04:00
|
|
|
# define set_yylval_literal(x) yylval.node = NEW_LIT(x)
|
2004-10-31 08:22:58 +03:00
|
|
|
# define set_yylval_node(x) yylval.node = x
|
|
|
|
# define yylval_id() yylval.id
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
2009-10-02 15:37:44 +04:00
|
|
|
static inline VALUE
|
|
|
|
ripper_yylval_id(ID x)
|
|
|
|
{
|
|
|
|
return (VALUE)NEW_LASGN(x, ID2SYM(x));
|
|
|
|
}
|
2005-09-25 02:34:56 +04:00
|
|
|
# define set_yylval_str(x) (void)(x)
|
|
|
|
# define set_yylval_num(x) (void)(x)
|
2009-10-02 15:37:44 +04:00
|
|
|
# define set_yylval_id(x) (void)(x)
|
|
|
|
# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(x))
|
2005-09-25 02:34:56 +04:00
|
|
|
# define set_yylval_literal(x) (void)(x)
|
|
|
|
# define set_yylval_node(x) (void)(x)
|
2009-10-02 15:37:44 +04:00
|
|
|
# define yylval_id() yylval.id
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
|
|
|
|
2009-10-20 09:50:53 +04:00
|
|
|
#ifndef RIPPER
|
|
|
|
#define ripper_flush(p) (void)(p)
|
|
|
|
#else
|
2004-09-20 09:40:23 +04:00
|
|
|
#define ripper_flush(p) (p->tokp = p->parser_lex_p)
|
2004-09-17 13:24:13 +04:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#define yylval_rval *(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val)
|
|
|
|
|
2009-10-20 09:50:53 +04:00
|
|
|
static int
|
|
|
|
ripper_has_scan_event(struct parser_params *parser)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-20 09:40:23 +04:00
|
|
|
|
|
|
|
if (lex_p < parser->tokp) rb_raise(rb_eRuntimeError, "lex_p < tokp");
|
2009-10-20 09:50:53 +04:00
|
|
|
return lex_p > parser->tokp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
|
|
|
ripper_scan_event_val(struct parser_params *parser, int t)
|
|
|
|
{
|
|
|
|
VALUE str = STR_NEW(parser->tokp, lex_p - parser->tokp);
|
|
|
|
VALUE rval = ripper_dispatch1(parser, ripper_token2eventid(t), str);
|
2004-09-20 09:40:23 +04:00
|
|
|
ripper_flush(parser);
|
2009-10-20 09:50:53 +04:00
|
|
|
return rval;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ripper_dispatch_scan_event(struct parser_params *parser, int t)
|
|
|
|
{
|
|
|
|
if (!ripper_has_scan_event(parser)) return;
|
|
|
|
yylval_rval = ripper_scan_event_val(parser, t);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ripper_dispatch_ignored_scan_event(struct parser_params *parser, int t)
|
|
|
|
{
|
|
|
|
if (!ripper_has_scan_event(parser)) return;
|
|
|
|
(void)ripper_scan_event_val(parser, t);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch_delayed_token(struct parser_params *parser, int t)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-20 11:59:30 +04:00
|
|
|
int saved_line = ruby_sourceline;
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *saved_tokp = parser->tokp;
|
2004-09-20 11:59:30 +04:00
|
|
|
|
|
|
|
ruby_sourceline = parser->delayed_line;
|
|
|
|
parser->tokp = lex_pbeg + parser->delayed_col;
|
2009-10-02 15:37:44 +04:00
|
|
|
yylval_rval = ripper_dispatch1(parser, ripper_token2eventid(t), parser->delayed);
|
2004-09-20 11:59:30 +04:00
|
|
|
parser->delayed = Qnil;
|
2004-09-20 09:40:23 +04:00
|
|
|
ruby_sourceline = saved_line;
|
|
|
|
parser->tokp = saved_tokp;
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
#endif /* RIPPER */
|
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
#include "ruby/regex.h"
|
|
|
|
#include "ruby/util.h"
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2000-10-20 20:37:01 +04:00
|
|
|
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
|
|
|
|
since ours (we hope) works properly with all combinations of
|
|
|
|
machines, compilers, `char' and `unsigned char' argument types.
|
|
|
|
(Per Bothner suggested the basic approach.) */
|
|
|
|
#undef SIGN_EXTEND_CHAR
|
|
|
|
#if __STDC__
|
|
|
|
# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
|
|
|
|
#else /* not __STDC__ */
|
|
|
|
/* As in Harbison and Steele. */
|
|
|
|
# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
|
|
|
|
#endif
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
|
2008-09-03 15:02:11 +04:00
|
|
|
#define parser_encoding_name() (parser->enc->name)
|
2007-09-06 16:33:45 +04:00
|
|
|
#define parser_mbclen() mbclen((lex_p-1),lex_pend,parser->enc)
|
2007-12-08 05:50:43 +03:00
|
|
|
#define parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,parser->enc)
|
|
|
|
#define is_identchar(p,e,enc) (rb_enc_isalnum(*p,enc) || (*p) == '_' || !ISASCII(*p))
|
2007-09-06 16:33:45 +04:00
|
|
|
#define parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,parser->enc))
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-12-08 05:50:43 +03:00
|
|
|
#define parser_isascii() ISASCII(*(lex_p-1))
|
|
|
|
|
2008-08-30 11:29:41 +04:00
|
|
|
#ifndef RIPPER
|
|
|
|
static int
|
2008-08-30 13:16:38 +04:00
|
|
|
token_info_get_column(struct parser_params *parser, const char *token)
|
2008-08-30 11:29:41 +04:00
|
|
|
{
|
|
|
|
int column = 1;
|
|
|
|
const char *p, *pend = lex_p - strlen(token);
|
|
|
|
for (p = lex_pbeg; p < pend; p++) {
|
|
|
|
if (*p == '\t') {
|
|
|
|
column = (((column - 1) / 8) + 1) * 8;
|
|
|
|
}
|
|
|
|
column++;
|
|
|
|
}
|
|
|
|
return column;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2008-08-30 13:16:38 +04:00
|
|
|
token_info_has_nonspaces(struct parser_params *parser, const char *token)
|
2008-08-30 11:29:41 +04:00
|
|
|
{
|
|
|
|
const char *p, *pend = lex_p - strlen(token);
|
|
|
|
for (p = lex_pbeg; p < pend; p++) {
|
|
|
|
if (*p != ' ' && *p != '\t') {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-13 13:23:19 +04:00
|
|
|
#undef token_info_push
|
2008-08-30 11:29:41 +04:00
|
|
|
static void
|
2008-08-30 13:16:38 +04:00
|
|
|
token_info_push(struct parser_params *parser, const char *token)
|
2008-08-30 11:29:41 +04:00
|
|
|
{
|
2008-09-29 20:02:58 +04:00
|
|
|
token_info *ptinfo;
|
2008-08-30 11:29:41 +04:00
|
|
|
|
2008-09-29 20:02:58 +04:00
|
|
|
if (compile_for_eval) return;
|
|
|
|
ptinfo = ALLOC(token_info);
|
2008-08-30 11:29:41 +04:00
|
|
|
ptinfo->token = token;
|
|
|
|
ptinfo->linenum = ruby_sourceline;
|
|
|
|
ptinfo->column = token_info_get_column(parser, token);
|
|
|
|
ptinfo->nonspc = token_info_has_nonspaces(parser, token);
|
|
|
|
ptinfo->next = parser->parser_token_info;
|
|
|
|
|
|
|
|
parser->parser_token_info = ptinfo;
|
|
|
|
}
|
|
|
|
|
2009-10-13 13:23:19 +04:00
|
|
|
#undef token_info_pop
|
2008-08-30 11:29:41 +04:00
|
|
|
static void
|
2008-08-30 13:16:38 +04:00
|
|
|
token_info_pop(struct parser_params *parser, const char *token)
|
2008-08-30 11:29:41 +04:00
|
|
|
{
|
|
|
|
int linenum;
|
|
|
|
token_info *ptinfo = parser->parser_token_info;
|
|
|
|
|
2008-09-29 20:02:58 +04:00
|
|
|
if (!ptinfo) return;
|
2008-08-30 11:29:41 +04:00
|
|
|
parser->parser_token_info = ptinfo->next;
|
|
|
|
if (token_info_get_column(parser, token) == ptinfo->column) { /* OK */
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
linenum = ruby_sourceline;
|
|
|
|
if (linenum == ptinfo->linenum) { /* SKIP */
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { /* SKIP */
|
|
|
|
goto finish;
|
|
|
|
}
|
2008-10-13 14:13:40 +04:00
|
|
|
rb_compile_warning(ruby_sourcefile, linenum,
|
|
|
|
"mismatched indentations at '%s' with '%s' at %d",
|
|
|
|
token, ptinfo->token, ptinfo->linenum);
|
2008-08-30 11:29:41 +04:00
|
|
|
|
|
|
|
finish:
|
|
|
|
xfree(ptinfo);
|
|
|
|
}
|
|
|
|
#endif /* RIPPER */
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_yyerror(struct parser_params *parser, const char *msg)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
#ifndef RIPPER
|
2007-09-26 00:12:24 +04:00
|
|
|
const int max_line_margin = 30;
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *p, *pe;
|
|
|
|
char *buf;
|
2009-05-26 04:22:20 +04:00
|
|
|
long len;
|
|
|
|
int i;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "%s", msg);
|
1998-01-16 15:13:05 +03:00
|
|
|
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) {
|
2005-10-20 17:15:19 +04:00
|
|
|
char *p2;
|
2007-09-26 00:12:24 +04:00
|
|
|
const char *pre = "", *post = "";
|
|
|
|
|
|
|
|
if (len > max_line_margin * 2 + 10) {
|
|
|
|
if (lex_p - p > max_line_margin) {
|
2008-09-13 22:22:04 +04:00
|
|
|
p = rb_enc_prev_char(p, lex_p - max_line_margin, pe, rb_enc_get(lex_lastline));
|
2007-09-26 00:12:24 +04:00
|
|
|
pre = "...";
|
|
|
|
}
|
|
|
|
if (pe - lex_p > max_line_margin) {
|
2008-09-13 22:22:04 +04:00
|
|
|
pe = rb_enc_prev_char(lex_p, lex_p + max_line_margin, pe, rb_enc_get(lex_lastline));
|
2007-09-26 00:12:24 +04:00
|
|
|
post = "...";
|
|
|
|
}
|
|
|
|
len = pe - p;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
buf = ALLOCA_N(char, len+2);
|
|
|
|
MEMCPY(buf, p, char, len);
|
|
|
|
buf[len] = '\0';
|
2007-09-26 00:12:24 +04:00
|
|
|
rb_compile_error_append("%s%s%s", pre, buf, post);
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-05-26 04:22:20 +04:00
|
|
|
i = (int)(lex_p - p);
|
2005-10-20 17:15:19 +04:00
|
|
|
p2 = buf; pe = buf + len;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-10-20 17:15:19 +04:00
|
|
|
while (p2 < pe) {
|
|
|
|
if (*p2 != '\t') *p2 = ' ';
|
|
|
|
p2++;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
buf[i] = '^';
|
|
|
|
buf[i+1] = '\0';
|
2007-09-26 00:12:24 +04:00
|
|
|
rb_compile_error_append("%s%s", pre, buf);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
dispatch1(parse_error, STR_NEW2(msg));
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif /* !RIPPER */
|
2004-09-12 19:21:49 +04:00
|
|
|
return 0;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static void parser_prepare(struct parser_params *parser);
|
2005-05-14 06:48:07 +04:00
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifndef RIPPER
|
2007-12-05 07:41:27 +03:00
|
|
|
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
|
2007-06-18 11:55:45 +04:00
|
|
|
|
|
|
|
static VALUE
|
2007-12-05 07:41:27 +03:00
|
|
|
debug_lines(const char *f)
|
2007-06-18 11:55:45 +04:00
|
|
|
{
|
2009-01-21 08:32:08 +03:00
|
|
|
ID script_lines;
|
|
|
|
CONST_ID(script_lines, "SCRIPT_LINES__");
|
|
|
|
if (rb_const_defined_at(rb_cObject, script_lines)) {
|
|
|
|
VALUE hash = rb_const_get_at(rb_cObject, script_lines);
|
2007-06-18 11:55:45 +04:00
|
|
|
if (TYPE(hash) == T_HASH) {
|
2007-12-05 07:41:27 +03:00
|
|
|
VALUE fname = rb_str_new2(f);
|
2008-03-24 13:43:56 +03:00
|
|
|
VALUE lines = rb_ary_new();
|
|
|
|
rb_hash_aset(hash, fname, lines);
|
2007-06-18 11:55:45 +04:00
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-07-01 20:55:30 +04:00
|
|
|
static VALUE
|
|
|
|
coverage(const char *f, int n)
|
|
|
|
{
|
2008-07-08 19:13:22 +04:00
|
|
|
extern VALUE rb_get_coverages(void);
|
|
|
|
VALUE coverages = rb_get_coverages();
|
2008-07-08 17:57:06 +04:00
|
|
|
if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
|
2008-07-03 16:55:12 +04:00
|
|
|
VALUE fname = rb_str_new2(f);
|
|
|
|
VALUE lines = rb_ary_new2(n);
|
|
|
|
int i;
|
2008-07-08 17:57:06 +04:00
|
|
|
RBASIC(lines)->klass = 0;
|
2008-07-03 16:55:12 +04:00
|
|
|
for (i = 0; i < n; i++) RARRAY_PTR(lines)[i] = Qnil;
|
2008-10-09 09:47:04 +04:00
|
|
|
RARRAY(lines)->as.heap.len = n;
|
2008-07-03 16:55:12 +04:00
|
|
|
rb_hash_aset(coverages, fname, lines);
|
|
|
|
return lines;
|
2008-07-01 20:55:30 +04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
e_option_supplied(struct parser_params *parser)
|
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return strcmp(ruby_sourcefile, "-e") == 0;
|
2008-07-01 20:55:30 +04:00
|
|
|
}
|
|
|
|
|
2007-12-05 07:41:27 +03:00
|
|
|
static VALUE
|
|
|
|
yycompile0(VALUE arg, int tracing)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
int n;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
NODE *tree;
|
2007-12-05 07:41:27 +03:00
|
|
|
struct parser_params *parser = (struct parser_params *)arg;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-05-17 09:23:10 +04:00
|
|
|
if (!compile_for_eval && rb_safe_level() == 0) {
|
2007-12-05 07:41:27 +03:00
|
|
|
ruby_debug_lines = debug_lines(ruby_sourcefile);
|
|
|
|
if (ruby_debug_lines && ruby_sourceline > 0) {
|
2008-01-24 01:35:27 +03:00
|
|
|
VALUE str = STR_NEW0();
|
2007-12-05 07:41:27 +03:00
|
|
|
n = ruby_sourceline;
|
2005-05-14 06:48:07 +04:00
|
|
|
do {
|
2000-01-05 07:41:21 +03:00
|
|
|
rb_ary_push(ruby_debug_lines, str);
|
2005-05-14 06:48:07 +04:00
|
|
|
} while (--n);
|
2000-01-05 07:41:21 +03:00
|
|
|
}
|
2008-07-01 20:55:30 +04:00
|
|
|
|
|
|
|
if (!e_option_supplied(parser)) {
|
|
|
|
ruby_coverage = coverage(ruby_sourcefile, ruby_sourceline);
|
|
|
|
}
|
1999-10-15 12:52:18 +04:00
|
|
|
}
|
|
|
|
|
2005-05-14 06:48:07 +04:00
|
|
|
parser_prepare(parser);
|
2008-08-04 11:48:52 +04:00
|
|
|
deferred_nodes = 0;
|
2004-09-17 13:24:13 +04:00
|
|
|
n = yyparse((void*)parser);
|
1999-10-15 12:52:18 +04:00
|
|
|
ruby_debug_lines = 0;
|
2008-07-01 20:55:30 +04:00
|
|
|
ruby_coverage = 0;
|
1999-08-13 09:45:20 +04:00
|
|
|
compile_for_eval = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
lex_strterm = 0;
|
2007-12-30 15:54:29 +03:00
|
|
|
lex_p = lex_pbeg = lex_pend = 0;
|
|
|
|
lex_lastline = lex_nextline = 0;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
if (parser->nerr) {
|
|
|
|
return 0;
|
2004-09-22 04:19:15 +04:00
|
|
|
}
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
tree = ruby_eval_tree;
|
|
|
|
if (!tree) {
|
|
|
|
tree = NEW_NIL();
|
|
|
|
}
|
2008-12-12 10:23:24 +03:00
|
|
|
else if (ruby_eval_tree_begin) {
|
|
|
|
tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body);
|
2004-09-22 04:19:15 +04:00
|
|
|
}
|
2007-12-05 07:41:27 +03:00
|
|
|
return (VALUE)tree;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE*
|
|
|
|
yycompile(struct parser_params *parser, const char *f, int line)
|
|
|
|
{
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
ruby_sourcefile = ruby_strdup(f);
|
2007-12-05 07:41:27 +03:00
|
|
|
ruby_sourceline = line - 1;
|
2009-09-14 11:39:16 +04:00
|
|
|
return (NODE *)ruby_suppress_tracing(yycompile0, (VALUE)parser, TRUE);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif /* !RIPPER */
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-08-17 09:35:10 +04:00
|
|
|
static rb_encoding *
|
|
|
|
must_be_ascii_compatible(VALUE s)
|
|
|
|
{
|
|
|
|
rb_encoding *enc = rb_enc_get(s);
|
|
|
|
if (!rb_enc_asciicompat(enc)) {
|
|
|
|
rb_raise(rb_eArgError, "invalid source encoding");
|
|
|
|
}
|
|
|
|
return enc;
|
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
lex_get_str(struct parser_params *parser, VALUE s)
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
|
|
|
char *beg, *end, *pend;
|
2009-08-17 09:35:10 +04:00
|
|
|
rb_encoding *enc = must_be_ascii_compatible(s);
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2006-08-31 14:47:44 +04:00
|
|
|
beg = RSTRING_PTR(s);
|
1999-01-20 07:59:39 +03:00
|
|
|
if (lex_gets_ptr) {
|
2006-08-31 14:47:44 +04:00
|
|
|
if (RSTRING_LEN(s) == lex_gets_ptr) return Qnil;
|
1999-01-20 07:59:39 +03:00
|
|
|
beg += lex_gets_ptr;
|
|
|
|
}
|
2006-08-31 14:47:44 +04:00
|
|
|
pend = RSTRING_PTR(s) + RSTRING_LEN(s);
|
1999-01-20 07:59:39 +03:00
|
|
|
end = beg;
|
|
|
|
while (end < pend) {
|
|
|
|
if (*end++ == '\n') break;
|
|
|
|
}
|
2006-08-31 14:47:44 +04:00
|
|
|
lex_gets_ptr = end - RSTRING_PTR(s);
|
2009-08-17 09:35:10 +04:00
|
|
|
return rb_enc_str_new(beg, end - beg, enc);
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
|
1999-10-15 12:52:18 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
lex_getline(struct parser_params *parser)
|
1999-10-15 12:52:18 +04:00
|
|
|
{
|
2004-10-20 10:53:42 +04:00
|
|
|
VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input);
|
2009-08-17 09:35:10 +04:00
|
|
|
if (NIL_P(line)) return line;
|
|
|
|
must_be_ascii_compatible(line);
|
2004-10-20 19:44:06 +04:00
|
|
|
#ifndef RIPPER
|
2009-08-17 09:35:10 +04:00
|
|
|
if (ruby_debug_lines) {
|
2004-10-20 10:53:42 +04:00
|
|
|
rb_ary_push(ruby_debug_lines, line);
|
|
|
|
}
|
2009-08-17 09:35:10 +04:00
|
|
|
if (ruby_coverage) {
|
2008-07-01 20:55:30 +04:00
|
|
|
rb_ary_push(ruby_coverage, Qnil);
|
|
|
|
}
|
2004-10-20 19:44:06 +04:00
|
|
|
#endif
|
2004-10-20 10:53:42 +04:00
|
|
|
return line;
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
1999-10-15 12:52:18 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
static const rb_data_type_t parser_data_type;
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifndef RIPPER
|
2009-08-17 09:35:10 +04:00
|
|
|
static NODE*
|
|
|
|
parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
|
2005-07-13 17:44:21 +04:00
|
|
|
{
|
2004-12-29 23:41:04 +03:00
|
|
|
struct parser_params *parser;
|
2006-12-31 18:02:22 +03:00
|
|
|
NODE *node;
|
|
|
|
volatile VALUE tmp;
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
1999-01-20 07:59:39 +03:00
|
|
|
lex_gets = lex_get_str;
|
|
|
|
lex_gets_ptr = 0;
|
|
|
|
lex_input = s;
|
|
|
|
lex_pbeg = lex_p = lex_pend = 0;
|
2006-12-31 18:02:22 +03:00
|
|
|
compile_for_eval = rb_parse_in_eval();
|
|
|
|
|
|
|
|
node = yycompile(parser, f, line);
|
|
|
|
tmp = vparser; /* prohibit tail call optimization */
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
return node;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2009-08-17 09:35:10 +04:00
|
|
|
NODE*
|
|
|
|
rb_compile_string(const char *f, VALUE s, int line)
|
|
|
|
{
|
|
|
|
must_be_ascii_compatible(s);
|
|
|
|
return parser_compile_string(rb_parser_new(), f, s, line);
|
|
|
|
}
|
|
|
|
|
|
|
|
NODE*
|
|
|
|
rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
|
|
|
|
{
|
|
|
|
must_be_ascii_compatible(s);
|
|
|
|
return parser_compile_string(vparser, f, s, line);
|
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_compile_cstr(const char *f, const char *s, int len, int line)
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
2009-08-17 09:35:10 +04:00
|
|
|
VALUE str = rb_str_new(s, len);
|
|
|
|
return parser_compile_string(rb_parser_new(), f, str, line);
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
|
2005-07-13 17:44:21 +04:00
|
|
|
NODE*
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line)
|
2005-07-13 17:44:21 +04:00
|
|
|
{
|
2009-08-17 09:35:10 +04:00
|
|
|
VALUE str = rb_str_new(s, len);
|
|
|
|
return parser_compile_string(vparser, f, str, line);
|
2005-07-13 17:44:21 +04:00
|
|
|
}
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
lex_io_gets(struct parser_params *parser, VALUE io)
|
2004-09-17 13:24:13 +04:00
|
|
|
{
|
2005-02-22 01:25:28 +03:00
|
|
|
return rb_io_gets(io);
|
2004-09-17 13:24:13 +04:00
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_compile_file(const char *f, VALUE file, int start)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2005-07-13 17:44:21 +04:00
|
|
|
VALUE volatile vparser = rb_parser_new();
|
|
|
|
|
|
|
|
return rb_parser_compile_file(vparser, f, file, start);
|
|
|
|
}
|
|
|
|
|
|
|
|
NODE*
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start)
|
2005-07-13 17:44:21 +04:00
|
|
|
{
|
2004-12-29 23:41:04 +03:00
|
|
|
struct parser_params *parser;
|
2006-12-31 18:02:22 +03:00
|
|
|
volatile VALUE tmp;
|
|
|
|
NODE *node;
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
2004-09-17 13:24:13 +04:00
|
|
|
lex_gets = lex_io_gets;
|
1998-01-16 15:13:05 +03:00
|
|
|
lex_input = file;
|
|
|
|
lex_pbeg = lex_p = lex_pend = 0;
|
2008-12-27 04:15:56 +03:00
|
|
|
compile_for_eval = rb_parse_in_eval();
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
node = yycompile(parser, f, start);
|
|
|
|
tmp = vparser; /* prohibit tail call optimization */
|
|
|
|
|
|
|
|
return node;
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif /* !RIPPER */
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
#define STR_FUNC_ESCAPE 0x01
|
|
|
|
#define STR_FUNC_EXPAND 0x02
|
|
|
|
#define STR_FUNC_REGEXP 0x04
|
|
|
|
#define STR_FUNC_QWORDS 0x08
|
|
|
|
#define STR_FUNC_SYMBOL 0x10
|
|
|
|
#define STR_FUNC_INDENT 0x20
|
|
|
|
|
|
|
|
enum string_type {
|
|
|
|
str_squote = (0),
|
|
|
|
str_dquote = (STR_FUNC_EXPAND),
|
|
|
|
str_xquote = (STR_FUNC_EXPAND),
|
|
|
|
str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
|
|
|
|
str_sword = (STR_FUNC_QWORDS),
|
|
|
|
str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND),
|
|
|
|
str_ssym = (STR_FUNC_SYMBOL),
|
2008-07-01 12:27:58 +04:00
|
|
|
str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
|
2007-12-01 19:56:19 +03:00
|
|
|
};
|
2007-10-03 11:58:50 +04:00
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
static VALUE
|
2008-01-24 14:43:40 +03:00
|
|
|
parser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0)
|
2007-11-08 01:55:27 +03:00
|
|
|
{
|
2007-12-01 19:56:19 +03:00
|
|
|
VALUE str;
|
2007-11-10 08:45:52 +03:00
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
str = rb_enc_str_new(p, n, enc);
|
2008-01-24 14:43:40 +03:00
|
|
|
if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
|
|
|
|
if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
|
|
|
|
}
|
2008-01-28 05:26:23 +03:00
|
|
|
else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) {
|
2008-01-24 14:43:40 +03:00
|
|
|
rb_enc_associate(str, rb_ascii8bit_encoding());
|
|
|
|
}
|
2007-12-01 19:56:19 +03:00
|
|
|
}
|
2007-11-10 08:45:52 +03:00
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
return str;
|
2007-11-08 01:55:27 +03:00
|
|
|
}
|
|
|
|
|
2007-12-30 07:56:17 +03:00
|
|
|
#define lex_goto_eol(parser) (parser->parser_lex_p = parser->parser_lex_pend)
|
2008-10-10 14:21:53 +04:00
|
|
|
#define peek(c) (lex_p < lex_pend && (c) == *lex_p)
|
2007-12-30 07:56:17 +03:00
|
|
|
|
2001-01-10 13:07:31 +03:00
|
|
|
static inline int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_nextc(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
int c;
|
|
|
|
|
|
|
|
if (lex_p == lex_pend) {
|
2007-11-09 17:33:18 +03:00
|
|
|
VALUE v = lex_nextline;
|
|
|
|
lex_nextline = 0;
|
|
|
|
if (!v) {
|
|
|
|
if (parser->eofp)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (!lex_input || NIL_P(v = lex_getline(parser))) {
|
|
|
|
parser->eofp = Qtrue;
|
2007-12-30 07:56:17 +03:00
|
|
|
lex_goto_eol(parser);
|
2007-11-09 17:33:18 +03:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
2008-08-10 07:15:37 +04:00
|
|
|
{
|
2004-09-20 07:03:12 +04:00
|
|
|
#ifdef RIPPER
|
2004-09-20 09:40:23 +04:00
|
|
|
if (parser->tokp < lex_pend) {
|
2004-09-20 11:59:30 +04:00
|
|
|
if (NIL_P(parser->delayed)) {
|
|
|
|
parser->delayed = rb_str_buf_new(1024);
|
|
|
|
rb_str_buf_cat(parser->delayed,
|
|
|
|
parser->tokp, lex_pend - parser->tokp);
|
|
|
|
parser->delayed_line = ruby_sourceline;
|
2009-10-02 23:34:28 +04:00
|
|
|
parser->delayed_col = (int)(parser->tokp - lex_pbeg);
|
2004-09-20 11:59:30 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
rb_str_buf_cat(parser->delayed,
|
|
|
|
parser->tokp, lex_pend - parser->tokp);
|
|
|
|
}
|
2004-09-20 09:40:23 +04:00
|
|
|
}
|
2004-09-20 07:03:12 +04:00
|
|
|
#endif
|
2002-09-10 18:38:20 +04:00
|
|
|
if (heredoc_end > 0) {
|
|
|
|
ruby_sourceline = heredoc_end;
|
|
|
|
heredoc_end = 0;
|
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
ruby_sourceline++;
|
2005-05-14 06:48:07 +04:00
|
|
|
parser->line_count++;
|
2006-08-31 14:47:44 +04:00
|
|
|
lex_pbeg = lex_p = RSTRING_PTR(v);
|
|
|
|
lex_pend = lex_p + RSTRING_LEN(v);
|
2004-09-20 07:03:12 +04:00
|
|
|
ripper_flush(parser);
|
1998-01-16 15:19:22 +03:00
|
|
|
lex_lastline = v;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
c = (unsigned char)*lex_p++;
|
2008-10-10 14:21:53 +04:00
|
|
|
if (c == '\r' && peek('\n')) {
|
1999-09-16 13:40:33 +04:00
|
|
|
lex_p++;
|
|
|
|
c = '\n';
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_pushback(struct parser_params *parser, int c)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
if (c == -1) return;
|
|
|
|
lex_p--;
|
2004-09-20 07:03:12 +04:00
|
|
|
if (lex_p > lex_pbeg && lex_p[0] == '\n' && lex_p[-1] == '\r') {
|
|
|
|
lex_p--;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2002-12-31 01:56:21 +03:00
|
|
|
#define was_bol() (lex_p == lex_pbeg + 1)
|
1999-08-13 09:45:20 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
#define tokfix() (tokenbuf[tokidx]='\0')
|
|
|
|
#define tok() tokenbuf
|
|
|
|
#define toklen() tokidx
|
|
|
|
#define toklast() (tokidx>0?tokenbuf[tokidx-1]:0)
|
|
|
|
|
|
|
|
static char*
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_newtok(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
tokidx = 0;
|
|
|
|
if (!tokenbuf) {
|
|
|
|
toksiz = 60;
|
|
|
|
tokenbuf = ALLOC_N(char, 60);
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
if (toksiz > 4096) {
|
1998-01-16 15:13:05 +03:00
|
|
|
toksiz = 60;
|
|
|
|
REALLOC_N(tokenbuf, char, 60);
|
|
|
|
}
|
|
|
|
return tokenbuf;
|
|
|
|
}
|
|
|
|
|
2007-10-24 12:09:40 +04:00
|
|
|
static char *
|
|
|
|
parser_tokspace(struct parser_params *parser, int n)
|
|
|
|
{
|
2007-10-25 09:08:08 +04:00
|
|
|
tokidx += n;
|
2007-10-24 12:09:40 +04:00
|
|
|
|
2007-10-25 09:08:08 +04:00
|
|
|
if (tokidx >= toksiz) {
|
|
|
|
do {toksiz *= 2;} while (toksiz < tokidx);
|
2007-10-24 12:09:40 +04:00
|
|
|
REALLOC_N(tokenbuf, char, toksiz);
|
|
|
|
}
|
2007-10-25 09:08:08 +04:00
|
|
|
return &tokenbuf[tokidx-n];
|
2007-10-24 12:09:40 +04:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static void
|
2006-06-10 03:18:04 +04:00
|
|
|
parser_tokadd(struct parser_params *parser, int c)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2006-06-10 03:18:04 +04:00
|
|
|
tokenbuf[tokidx++] = (char)c;
|
1998-01-16 15:13:05 +03:00
|
|
|
if (tokidx >= toksiz) {
|
|
|
|
toksiz *= 2;
|
|
|
|
REALLOC_N(tokenbuf, char, toksiz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2009-03-14 12:25:20 +03:00
|
|
|
parser_tok_hex(struct parser_params *parser, size_t *numlen)
|
2007-11-08 01:55:27 +03:00
|
|
|
{
|
|
|
|
int c;
|
|
|
|
|
|
|
|
c = scan_hex(lex_p, 2, numlen);
|
|
|
|
if (!*numlen) {
|
|
|
|
yyerror("invalid hex escape");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
lex_p += *numlen;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
#define tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n))
|
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
static int
|
2007-12-01 19:56:19 +03:00
|
|
|
parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp,
|
|
|
|
int string_literal, int symbol_literal, int regexp_literal)
|
2007-11-08 01:55:27 +03:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* If string_literal is true, then we allow multiple codepoints
|
|
|
|
* in \u{}, and add the codepoints to the current token.
|
|
|
|
* Otherwise we're parsing a character literal and return a single
|
2008-08-10 07:15:37 +04:00
|
|
|
* codepoint without adding it
|
2007-11-08 01:55:27 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
int codepoint;
|
2009-03-14 12:25:20 +03:00
|
|
|
size_t numlen;
|
2007-11-08 01:55:27 +03:00
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
if (regexp_literal) { tokadd('\\'); tokadd('u'); }
|
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
if (peek('{')) { /* handle \u{...} form */
|
|
|
|
do {
|
2007-12-01 19:56:19 +03:00
|
|
|
if (regexp_literal) { tokadd(*lex_p); }
|
2007-11-08 01:55:27 +03:00
|
|
|
nextc();
|
|
|
|
codepoint = scan_hex(lex_p, 6, &numlen);
|
|
|
|
if (numlen == 0) {
|
|
|
|
yyerror("invalid Unicode escape");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (codepoint > 0x10ffff) {
|
* regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,
compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c,
ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb,
ext/openssl/ossl_bn.c, numeric.c, vm.c,
benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal"
for non law violation context.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21 05:31:11 +03:00
|
|
|
yyerror("invalid Unicode codepoint (too large)");
|
2007-11-08 01:55:27 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
lex_p += numlen;
|
2007-12-01 19:56:19 +03:00
|
|
|
if (regexp_literal) {
|
2009-05-27 18:00:40 +04:00
|
|
|
tokcopy((int)numlen);
|
2007-12-01 19:56:19 +03:00
|
|
|
}
|
|
|
|
else if (codepoint >= 0x80) {
|
2007-11-08 01:55:27 +03:00
|
|
|
*encp = UTF8_ENC();
|
|
|
|
if (string_literal) tokaddmbc(codepoint, *encp);
|
|
|
|
}
|
|
|
|
else if (string_literal) {
|
|
|
|
if (codepoint == 0 && symbol_literal) {
|
|
|
|
yyerror("symbol cannot contain '\\u{0}'");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
tokadd(codepoint);
|
|
|
|
}
|
2007-11-09 17:33:18 +03:00
|
|
|
} while (string_literal && (peek(' ') || peek('\t')));
|
2007-11-08 01:55:27 +03:00
|
|
|
|
|
|
|
if (!peek('}')) {
|
|
|
|
yyerror("unterminated Unicode escape");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-12-01 19:56:19 +03:00
|
|
|
if (regexp_literal) { tokadd('}'); }
|
2007-11-08 01:55:27 +03:00
|
|
|
nextc();
|
|
|
|
}
|
|
|
|
else { /* handle \uxxxx form */
|
|
|
|
codepoint = scan_hex(lex_p, 4, &numlen);
|
|
|
|
if (numlen < 4) {
|
|
|
|
yyerror("invalid Unicode escape");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
lex_p += 4;
|
2007-12-01 19:56:19 +03:00
|
|
|
if (regexp_literal) {
|
|
|
|
tokcopy(4);
|
|
|
|
}
|
|
|
|
else if (codepoint >= 0x80) {
|
2007-11-08 01:55:27 +03:00
|
|
|
*encp = UTF8_ENC();
|
|
|
|
if (string_literal) tokaddmbc(codepoint, *encp);
|
|
|
|
}
|
|
|
|
else if (string_literal) {
|
|
|
|
if (codepoint == 0 && symbol_literal) {
|
|
|
|
yyerror("symbol cannot contain '\\u0000'");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
tokadd(codepoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return codepoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define ESCAPE_CONTROL 1
|
|
|
|
#define ESCAPE_META 2
|
|
|
|
|
|
|
|
static int
|
|
|
|
parser_read_escape(struct parser_params *parser, int flags,
|
2007-12-01 19:56:19 +03:00
|
|
|
rb_encoding **encp)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
int c;
|
2009-03-14 12:25:20 +03:00
|
|
|
size_t numlen;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
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':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
|
2009-03-14 12:25:20 +03:00
|
|
|
pushback(c);
|
2009-09-14 11:39:16 +04:00
|
|
|
c = scan_oct(lex_p, 3, &numlen);
|
2009-03-14 12:25:20 +03:00
|
|
|
lex_p += numlen;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case 'x': /* hex constant */
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
|
|
|
|
c = tok_hex(&numlen);
|
|
|
|
if (numlen == 0) return 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case 'b': /* backspace */
|
1999-08-13 09:45:20 +04:00
|
|
|
return '\010';
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
case 's': /* space */
|
|
|
|
return ' ';
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
case 'M':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & ESCAPE_META) goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) != '-') {
|
|
|
|
pushback(c);
|
2007-11-08 01:55:27 +03:00
|
|
|
goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if ((c = nextc()) == '\\') {
|
2007-12-01 19:56:19 +03:00
|
|
|
return read_escape(flags|ESCAPE_META, encp) | 0x80;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2007-11-18 19:53:12 +03:00
|
|
|
else if (c == -1 || !ISASCII(c)) goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
else {
|
|
|
|
return ((c & 0xff) | 0x80);
|
|
|
|
}
|
|
|
|
|
|
|
|
case 'C':
|
|
|
|
if ((c = nextc()) != '-') {
|
|
|
|
pushback(c);
|
2007-11-08 01:55:27 +03:00
|
|
|
goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
case 'c':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & ESCAPE_CONTROL) goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc())== '\\') {
|
2007-12-01 19:56:19 +03:00
|
|
|
c = read_escape(flags|ESCAPE_CONTROL, encp);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else if (c == '?')
|
|
|
|
return 0177;
|
2007-11-18 19:53:12 +03:00
|
|
|
else if (c == -1 || !ISASCII(c)) goto eof;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c & 0x9f;
|
|
|
|
|
|
|
|
eof:
|
|
|
|
case -1:
|
2006-12-31 18:02:22 +03:00
|
|
|
yyerror("Invalid escape character syntax");
|
1998-01-16 15:13:05 +03:00
|
|
|
return '\0';
|
|
|
|
|
|
|
|
default:
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
static void
|
|
|
|
parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc)
|
|
|
|
{
|
|
|
|
int len = rb_enc_codelen(c, enc);
|
|
|
|
rb_enc_mbcput(c, tokspace(len), enc);
|
|
|
|
}
|
|
|
|
|
2000-05-12 13:07:57 +04:00
|
|
|
static int
|
2008-02-26 09:44:53 +03:00
|
|
|
parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
|
2000-05-12 13:07:57 +04:00
|
|
|
{
|
|
|
|
int c;
|
2007-11-08 01:55:27 +03:00
|
|
|
int flags = 0;
|
2009-05-27 18:00:40 +04:00
|
|
|
size_t numlen;
|
2000-05-12 13:07:57 +04:00
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
first:
|
2000-05-12 13:07:57 +04:00
|
|
|
switch (c = nextc()) {
|
|
|
|
case '\n':
|
|
|
|
return 0; /* just ignore */
|
|
|
|
|
|
|
|
case '0': case '1': case '2': case '3': /* octal constant */
|
|
|
|
case '4': case '5': case '6': case '7':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
{
|
2009-06-16 11:14:48 +04:00
|
|
|
ruby_scan_oct(--lex_p, 3, &numlen);
|
2007-11-08 01:55:27 +03:00
|
|
|
if (numlen == 0) goto eof;
|
|
|
|
lex_p += numlen;
|
2009-05-27 18:00:40 +04:00
|
|
|
tokcopy((int)numlen + 1);
|
2000-05-12 13:07:57 +04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case 'x': /* hex constant */
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
{
|
2009-05-27 18:00:40 +04:00
|
|
|
tok_hex(&numlen);
|
2007-11-08 01:55:27 +03:00
|
|
|
if (numlen == 0) goto eof;
|
2009-05-27 18:00:40 +04:00
|
|
|
tokcopy((int)numlen + 2);
|
2000-05-12 13:07:57 +04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case 'M':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & ESCAPE_META) goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
if ((c = nextc()) != '-') {
|
|
|
|
pushback(c);
|
2007-11-08 01:55:27 +03:00
|
|
|
goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
}
|
2007-11-08 01:55:27 +03:00
|
|
|
tokcopy(3);
|
|
|
|
flags |= ESCAPE_META;
|
2000-05-12 13:07:57 +04:00
|
|
|
goto escaped;
|
|
|
|
|
|
|
|
case 'C':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & ESCAPE_CONTROL) goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
if ((c = nextc()) != '-') {
|
|
|
|
pushback(c);
|
2007-11-08 01:55:27 +03:00
|
|
|
goto eof;
|
2000-05-12 13:07:57 +04:00
|
|
|
}
|
2007-11-08 01:55:27 +03:00
|
|
|
tokcopy(3);
|
2000-05-12 13:07:57 +04:00
|
|
|
goto escaped;
|
|
|
|
|
|
|
|
case 'c':
|
2007-11-08 01:55:27 +03:00
|
|
|
if (flags & ESCAPE_CONTROL) goto eof;
|
|
|
|
tokcopy(2);
|
|
|
|
flags |= ESCAPE_CONTROL;
|
2000-05-12 13:07:57 +04:00
|
|
|
escaped:
|
|
|
|
if ((c = nextc()) == '\\') {
|
2007-11-08 01:55:27 +03:00
|
|
|
goto first;
|
2000-05-12 13:07:57 +04:00
|
|
|
}
|
|
|
|
else if (c == -1) goto eof;
|
|
|
|
tokadd(c);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
eof:
|
|
|
|
case -1:
|
2006-12-31 18:02:22 +03:00
|
|
|
yyerror("Invalid escape character syntax");
|
2000-05-12 13:07:57 +04:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
default:
|
2008-02-26 09:44:53 +03:00
|
|
|
tokadd('\\');
|
2000-05-12 13:07:57 +04:00
|
|
|
tokadd(c);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-10-19 11:41:03 +04:00
|
|
|
extern int rb_char_to_option_kcode(int c, int *option, int *kcode);
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_regx_options(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2007-10-19 11:41:03 +04:00
|
|
|
int kcode = 0;
|
2009-09-09 12:19:06 +04:00
|
|
|
int kopt = 0;
|
1999-01-20 07:59:39 +03:00
|
|
|
int options = 0;
|
2006-05-13 12:55:39 +04:00
|
|
|
int c, opt, kc;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
newtok();
|
2002-06-24 11:20:42 +04:00
|
|
|
while (c = nextc(), ISALPHA(c)) {
|
2006-03-26 17:04:13 +04:00
|
|
|
if (c == 'o') {
|
|
|
|
options |= RE_OPTION_ONCE;
|
|
|
|
}
|
|
|
|
else if (rb_char_to_option_kcode(c, &opt, &kc)) {
|
2009-09-10 21:07:38 +04:00
|
|
|
if (kc >= 0) {
|
|
|
|
if (kc != rb_ascii8bit_encindex()) kcode = c;
|
|
|
|
kopt = opt;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
options |= opt;
|
|
|
|
}
|
2006-03-26 17:04:13 +04:00
|
|
|
}
|
|
|
|
else {
|
2002-06-24 11:20:42 +04:00
|
|
|
tokadd(c);
|
2006-03-26 17:04:13 +04:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2009-09-09 12:19:06 +04:00
|
|
|
options |= kopt;
|
2002-06-24 11:20:42 +04:00
|
|
|
pushback(c);
|
|
|
|
if (toklen()) {
|
|
|
|
tokfix();
|
2004-09-17 13:24:13 +04:00
|
|
|
compile_error(PARSER_ARG "unknown regexp option%s - %s",
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
toklen() > 1 ? "s" : "", tok());
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2007-10-19 11:41:03 +04:00
|
|
|
return options | RE_OPTION_ENCODING(kcode);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2002-12-15 05:48:40 +03:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
dispose_string(VALUE str)
|
2002-12-15 05:48:40 +03:00
|
|
|
{
|
2006-12-31 18:02:22 +03:00
|
|
|
/* TODO: should use another API? */
|
2006-08-31 14:47:44 +04:00
|
|
|
if (RBASIC(str)->flags & RSTRING_NOEMBED)
|
|
|
|
xfree(RSTRING_PTR(str));
|
2002-12-15 05:48:40 +03:00
|
|
|
rb_gc_force_recycle(str);
|
|
|
|
}
|
|
|
|
|
2007-12-02 09:47:59 +03:00
|
|
|
static int
|
2007-09-26 13:39:08 +04:00
|
|
|
parser_tokadd_mbchar(struct parser_params *parser, int c)
|
|
|
|
{
|
2007-12-08 05:50:43 +03:00
|
|
|
int len = parser_precise_mbclen();
|
2008-01-27 17:27:07 +03:00
|
|
|
if (!MBCLEN_CHARFOUND_P(len)) {
|
2008-09-03 15:02:11 +04:00
|
|
|
compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
|
2007-12-02 09:47:59 +03:00
|
|
|
return -1;
|
|
|
|
}
|
2007-11-08 01:55:27 +03:00
|
|
|
tokadd(c);
|
|
|
|
lex_p += --len;
|
|
|
|
if (len > 0) tokcopy(len);
|
2007-12-02 09:47:59 +03:00
|
|
|
return c;
|
2007-09-26 13:39:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#define tokadd_mbchar(c) parser_tokadd_mbchar(parser, c)
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_tokadd_string(struct parser_params *parser,
|
2007-11-08 01:55:27 +03:00
|
|
|
int func, int term, int paren, long *nest,
|
2007-12-01 19:56:19 +03:00
|
|
|
rb_encoding **encp)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
int c;
|
2007-12-01 19:56:19 +03:00
|
|
|
int has_nonascii = 0;
|
2007-11-08 01:55:27 +03:00
|
|
|
rb_encoding *enc = *encp;
|
|
|
|
char *errbuf = 0;
|
|
|
|
static const char mixed_msg[] = "%s mixed within %s source";
|
|
|
|
|
|
|
|
#define mixed_error(enc1, enc2) if (!errbuf) { \
|
2009-05-27 18:00:40 +04:00
|
|
|
size_t len = sizeof(mixed_msg) - 4; \
|
2007-11-08 01:55:27 +03:00
|
|
|
len += strlen(rb_enc_name(enc1)); \
|
|
|
|
len += strlen(rb_enc_name(enc2)); \
|
|
|
|
errbuf = ALLOCA_N(char, len); \
|
|
|
|
snprintf(errbuf, len, mixed_msg, \
|
|
|
|
rb_enc_name(enc1), \
|
|
|
|
rb_enc_name(enc2)); \
|
|
|
|
yyerror(errbuf); \
|
|
|
|
}
|
|
|
|
#define mixed_escape(beg, enc1, enc2) do { \
|
|
|
|
const char *pos = lex_p; \
|
|
|
|
lex_p = beg; \
|
|
|
|
mixed_error(enc1, enc2); \
|
|
|
|
lex_p = pos; \
|
|
|
|
} while (0)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
while ((c = nextc()) != -1) {
|
|
|
|
if (paren && c == paren) {
|
2003-07-11 20:22:01 +04:00
|
|
|
++*nest;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
else if (c == term) {
|
2003-07-11 20:22:01 +04:00
|
|
|
if (!nest || !*nest) {
|
2002-06-24 11:20:42 +04:00
|
|
|
pushback(c);
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2003-07-11 20:22:01 +04:00
|
|
|
--*nest;
|
2002-03-18 05:04:23 +03:00
|
|
|
}
|
2002-06-26 12:01:00 +04:00
|
|
|
else if ((func & STR_FUNC_EXPAND) && c == '#' && lex_p < lex_pend) {
|
2002-06-24 11:20:42 +04:00
|
|
|
int c2 = *lex_p;
|
|
|
|
if (c2 == '$' || c2 == '@' || c2 == '{') {
|
|
|
|
pushback(c);
|
|
|
|
break;
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else if (c == '\\') {
|
2007-11-08 01:55:27 +03:00
|
|
|
const char *beg = lex_p - 1;
|
1998-01-16 15:13:05 +03:00
|
|
|
c = nextc();
|
|
|
|
switch (c) {
|
|
|
|
case '\n':
|
2003-09-04 18:59:43 +04:00
|
|
|
if (func & STR_FUNC_QWORDS) break;
|
|
|
|
if (func & STR_FUNC_EXPAND) continue;
|
|
|
|
tokadd('\\');
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '\\':
|
2002-06-26 12:01:00 +04:00
|
|
|
if (func & STR_FUNC_ESCAPE) tokadd(c);
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
|
2007-11-08 01:55:27 +03:00
|
|
|
case 'u':
|
|
|
|
if ((func & STR_FUNC_EXPAND) == 0) {
|
|
|
|
tokadd('\\');
|
|
|
|
break;
|
|
|
|
}
|
2007-12-01 19:56:19 +03:00
|
|
|
parser_tokadd_utf8(parser, &enc, 1,
|
|
|
|
func & STR_FUNC_SYMBOL,
|
|
|
|
func & STR_FUNC_REGEXP);
|
|
|
|
if (has_nonascii && enc != *encp) {
|
2007-11-08 01:55:27 +03:00
|
|
|
mixed_escape(beg, enc, *encp);
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
default:
|
2002-06-26 12:01:00 +04:00
|
|
|
if (func & STR_FUNC_REGEXP) {
|
2002-06-24 11:20:42 +04:00
|
|
|
pushback(c);
|
2008-02-26 09:44:53 +03:00
|
|
|
if ((c = tokadd_escape(&enc)) < 0)
|
2002-06-24 11:20:42 +04:00
|
|
|
return -1;
|
2007-12-01 19:56:19 +03:00
|
|
|
if (has_nonascii && enc != *encp) {
|
2007-11-08 01:55:27 +03:00
|
|
|
mixed_escape(beg, enc, *encp);
|
|
|
|
}
|
2001-02-08 12:19:27 +03:00
|
|
|
continue;
|
|
|
|
}
|
2002-06-26 12:01:00 +04:00
|
|
|
else if (func & STR_FUNC_EXPAND) {
|
2002-06-24 11:20:42 +04:00
|
|
|
pushback(c);
|
2002-06-26 12:01:00 +04:00
|
|
|
if (func & STR_FUNC_ESCAPE) tokadd('\\');
|
2007-12-01 19:56:19 +03:00
|
|
|
c = read_escape(0, &enc);
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-08-01 13:42:38 +04:00
|
|
|
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
|
|
|
|
/* ignore backslashed spaces in %w */
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
else if (c != term && !(paren && c == paren)) {
|
|
|
|
tokadd('\\');
|
2009-09-28 06:40:30 +04:00
|
|
|
pushback(c);
|
|
|
|
continue;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-12-08 05:50:43 +03:00
|
|
|
else if (!parser_isascii()) {
|
2007-12-01 19:56:19 +03:00
|
|
|
has_nonascii = 1;
|
2007-11-08 01:55:27 +03:00
|
|
|
if (enc != *encp) {
|
|
|
|
mixed_error(enc, *encp);
|
|
|
|
continue;
|
|
|
|
}
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return -1;
|
2007-09-26 13:39:08 +04:00
|
|
|
continue;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-06-26 12:01:00 +04:00
|
|
|
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
|
2000-02-01 06:12:21 +03:00
|
|
|
pushback(c);
|
2002-06-26 12:01:00 +04:00
|
|
|
break;
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
2002-10-23 14:17:30 +04:00
|
|
|
if (!c && (func & STR_FUNC_SYMBOL)) {
|
|
|
|
func &= ~STR_FUNC_SYMBOL;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "symbol cannot contain '\\0'");
|
2002-10-23 14:17:30 +04:00
|
|
|
continue;
|
|
|
|
}
|
2007-12-01 19:56:19 +03:00
|
|
|
if (c & 0x80) {
|
|
|
|
has_nonascii = 1;
|
|
|
|
if (enc != *encp) {
|
|
|
|
mixed_error(enc, *encp);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2000-02-01 06:12:21 +03:00
|
|
|
tokadd(c);
|
|
|
|
}
|
2007-11-08 01:55:27 +03:00
|
|
|
*encp = enc;
|
2002-06-26 12:01:00 +04:00
|
|
|
return c;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
#define NEW_STRTERM(func, term, paren) \
|
2003-07-11 20:22:01 +04:00
|
|
|
rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0)
|
2002-06-24 11:20:42 +04:00
|
|
|
|
1998-01-16 15:19:22 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_parse_string(struct parser_params *parser, NODE *quote)
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
int func = (int)quote->nd_func;
|
2003-07-11 20:22:01 +04:00
|
|
|
int term = nd_term(quote);
|
|
|
|
int paren = nd_paren(quote);
|
2007-12-01 19:56:19 +03:00
|
|
|
int c, space = 0;
|
2007-11-08 01:55:27 +03:00
|
|
|
rb_encoding *enc = parser->enc;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
if (func == -1) return tSTRING_END;
|
|
|
|
c = nextc();
|
2002-06-26 12:01:00 +04:00
|
|
|
if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
|
|
|
|
do {c = nextc();} while (ISSPACE(c));
|
|
|
|
space = 1;
|
|
|
|
}
|
2003-09-17 15:34:02 +04:00
|
|
|
if (c == term && !quote->nd_nest) {
|
2002-12-31 01:56:21 +03:00
|
|
|
if (func & STR_FUNC_QWORDS) {
|
|
|
|
quote->nd_func = -1;
|
|
|
|
return ' ';
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-12-31 01:56:21 +03:00
|
|
|
if (!(func & STR_FUNC_REGEXP)) return tSTRING_END;
|
2004-09-12 19:21:49 +04:00
|
|
|
set_yylval_num(regx_options());
|
2002-12-31 01:56:21 +03:00
|
|
|
return tREGEXP_END;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-06-26 12:01:00 +04:00
|
|
|
if (space) {
|
|
|
|
pushback(c);
|
|
|
|
return ' ';
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
newtok();
|
2002-06-26 12:01:00 +04:00
|
|
|
if ((func & STR_FUNC_EXPAND) && c == '#') {
|
2002-06-24 11:20:42 +04:00
|
|
|
switch (c = nextc()) {
|
|
|
|
case '$':
|
|
|
|
case '@':
|
|
|
|
pushback(c);
|
|
|
|
return tSTRING_DVAR;
|
|
|
|
case '{':
|
|
|
|
return tSTRING_DBEG;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
tokadd('#');
|
|
|
|
}
|
|
|
|
pushback(c);
|
2007-11-08 01:55:27 +03:00
|
|
|
if (tokadd_string(func, term, paren, "e->nd_nest,
|
2007-12-01 19:56:19 +03:00
|
|
|
&enc) == -1) {
|
2007-11-08 01:55:27 +03:00
|
|
|
ruby_sourceline = nd_line(quote);
|
2007-07-05 06:02:30 +04:00
|
|
|
if (func & STR_FUNC_REGEXP) {
|
2007-12-02 16:08:03 +03:00
|
|
|
if (parser->eofp)
|
|
|
|
compile_error(PARSER_ARG "unterminated regexp meets end of file");
|
2007-07-05 06:02:30 +04:00
|
|
|
return tREGEXP_END;
|
|
|
|
}
|
|
|
|
else {
|
2007-12-02 16:08:03 +03:00
|
|
|
if (parser->eofp)
|
|
|
|
compile_error(PARSER_ARG "unterminated string meets end of file");
|
2007-07-05 06:02:30 +04:00
|
|
|
return tSTRING_END;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
tokfix();
|
2007-12-01 19:56:19 +03:00
|
|
|
set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_CONTENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_heredoc_identifier(struct parser_params *parser)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
int c = nextc(), term, func = 0;
|
|
|
|
long len;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
|
|
|
if (c == '-') {
|
|
|
|
c = nextc();
|
2002-06-26 12:01:00 +04:00
|
|
|
func = STR_FUNC_INDENT;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
switch (c) {
|
|
|
|
case '\'':
|
2002-07-15 05:33:36 +04:00
|
|
|
func |= str_squote; goto quoted;
|
2002-06-24 11:20:42 +04:00
|
|
|
case '"':
|
2002-07-15 05:33:36 +04:00
|
|
|
func |= str_dquote; goto quoted;
|
2002-06-24 11:20:42 +04:00
|
|
|
case '`':
|
2002-06-26 12:01:00 +04:00
|
|
|
func |= str_xquote;
|
2002-07-15 05:33:36 +04:00
|
|
|
quoted:
|
2002-06-24 11:20:42 +04:00
|
|
|
newtok();
|
2002-06-26 12:01:00 +04:00
|
|
|
tokadd(func);
|
2002-06-24 11:20:42 +04:00
|
|
|
term = c;
|
|
|
|
while ((c = nextc()) != -1 && c != term) {
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return 0;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
if (c == -1) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "unterminated here document identifier");
|
2002-06-24 11:20:42 +04:00
|
|
|
return 0;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!parser_is_identchar()) {
|
2002-12-31 01:56:21 +03:00
|
|
|
pushback(c);
|
|
|
|
if (func & STR_FUNC_INDENT) {
|
|
|
|
pushback('-');
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
newtok();
|
|
|
|
term = '"';
|
2002-06-26 12:01:00 +04:00
|
|
|
tokadd(func |= str_dquote);
|
2002-06-24 11:20:42 +04:00
|
|
|
do {
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return 0;
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
} while ((c = nextc()) != -1 && parser_is_identchar());
|
1998-01-16 15:19:22 +03:00
|
|
|
pushback(c);
|
|
|
|
break;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
|
1998-01-16 15:19:22 +03:00
|
|
|
tokfix();
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2004-09-20 07:03:12 +04:00
|
|
|
ripper_dispatch_scan_event(parser, tHEREDOC_BEG);
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
2002-06-24 11:20:42 +04:00
|
|
|
len = lex_p - lex_pbeg;
|
2004-09-20 07:03:12 +04:00
|
|
|
lex_goto_eol(parser);
|
2002-06-24 11:20:42 +04:00
|
|
|
lex_strterm = rb_node_newnode(NODE_HEREDOC,
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
STR_NEW(tok(), toklen()), /* nd_lit */
|
2002-06-24 11:20:42 +04:00
|
|
|
len, /* nd_nth */
|
|
|
|
lex_lastline); /* nd_orig */
|
2004-09-20 06:02:58 +04:00
|
|
|
nd_set_line(lex_strterm, ruby_sourceline);
|
2004-09-20 07:03:12 +04:00
|
|
|
ripper_flush(parser);
|
2002-06-24 11:20:42 +04:00
|
|
|
return term == '`' ? tXSTRING_BEG : tSTRING_BEG;
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_heredoc_restore(struct parser_params *parser, NODE *here)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
2004-09-12 19:21:49 +04:00
|
|
|
VALUE line;
|
|
|
|
|
|
|
|
line = here->nd_orig;
|
2002-06-24 11:20:42 +04:00
|
|
|
lex_lastline = line;
|
2006-08-31 14:47:44 +04:00
|
|
|
lex_pbeg = RSTRING_PTR(line);
|
|
|
|
lex_pend = lex_pbeg + RSTRING_LEN(line);
|
2002-06-24 11:20:42 +04:00
|
|
|
lex_p = lex_pbeg + here->nd_nth;
|
2002-09-10 18:38:20 +04:00
|
|
|
heredoc_end = ruby_sourceline;
|
|
|
|
ruby_sourceline = nd_line(here);
|
2002-12-15 05:48:40 +03:00
|
|
|
dispose_string(here->nd_lit);
|
2002-06-24 11:20:42 +04:00
|
|
|
rb_gc_force_recycle((VALUE)here);
|
2004-09-20 07:03:12 +04:00
|
|
|
ripper_flush(parser);
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_whole_match_p(struct parser_params *parser,
|
2009-09-14 11:39:16 +04:00
|
|
|
const char *eos, long len, int indent)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *p = lex_pbeg;
|
2009-09-14 11:39:16 +04:00
|
|
|
long n;
|
1998-01-16 15:19:22 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
if (indent) {
|
|
|
|
while (*p && ISSPACE(*p)) p++;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2009-09-14 11:39:16 +04:00
|
|
|
n = lex_pend - (p + len);
|
|
|
|
if (n < 0 || (n > 0 && p[len] != '\n' && p[len] != '\r')) return FALSE;
|
|
|
|
return strncmp(eos, p, len) == 0;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_here_document(struct parser_params *parser, NODE *here)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
|
|
|
int c, func, indent = 0;
|
2005-10-20 17:15:19 +04:00
|
|
|
const char *eos, *p, *pend;
|
2002-08-21 19:47:54 +04:00
|
|
|
long len;
|
2002-12-31 01:56:21 +03:00
|
|
|
VALUE str = 0;
|
2009-10-20 09:50:53 +04:00
|
|
|
rb_encoding *enc = parser->enc;
|
1998-01-16 15:19:22 +03:00
|
|
|
|
2006-08-31 14:47:44 +04:00
|
|
|
eos = RSTRING_PTR(here->nd_lit);
|
|
|
|
len = RSTRING_LEN(here->nd_lit) - 1;
|
2002-06-26 12:01:00 +04:00
|
|
|
indent = (func = *eos++) & STR_FUNC_INDENT;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
|
|
|
if ((c = nextc()) == -1) {
|
|
|
|
error:
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "can't find string \"%s\" anywhere before EOF", eos);
|
2009-10-20 09:50:53 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
if (NIL_P(parser->delayed)) {
|
|
|
|
ripper_dispatch_scan_event(parser, tSTRING_CONTENT);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (str ||
|
|
|
|
((len = lex_p - parser->tokp) > 0 &&
|
|
|
|
(str = STR_NEW3(parser->tokp, len, enc, func), 1))) {
|
|
|
|
rb_str_append(parser->delayed, str);
|
|
|
|
}
|
|
|
|
ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
|
|
|
|
}
|
|
|
|
lex_goto_eol(parser);
|
|
|
|
#endif
|
2007-12-02 16:08:03 +03:00
|
|
|
restore:
|
2002-06-24 11:20:42 +04:00
|
|
|
heredoc_restore(lex_strterm);
|
|
|
|
lex_strterm = 0;
|
|
|
|
return 0;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-12-31 01:56:21 +03:00
|
|
|
if (was_bol() && whole_match_p(eos, len, indent)) {
|
2002-06-24 11:20:42 +04:00
|
|
|
heredoc_restore(lex_strterm);
|
|
|
|
return tSTRING_END;
|
|
|
|
}
|
|
|
|
|
2002-06-26 12:01:00 +04:00
|
|
|
if (!(func & STR_FUNC_EXPAND)) {
|
2002-06-24 11:20:42 +04:00
|
|
|
do {
|
2006-08-31 14:47:44 +04:00
|
|
|
p = RSTRING_PTR(lex_lastline);
|
2002-12-31 01:56:21 +03:00
|
|
|
pend = lex_pend;
|
|
|
|
if (pend > p) {
|
|
|
|
switch (pend[-1]) {
|
|
|
|
case '\n':
|
|
|
|
if (--pend == p || pend[-1] != '\r') {
|
|
|
|
pend++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case '\r':
|
|
|
|
--pend;
|
|
|
|
}
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
if (str)
|
2002-12-31 01:56:21 +03:00
|
|
|
rb_str_cat(str, p, pend - p);
|
2002-06-24 11:20:42 +04:00
|
|
|
else
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
str = STR_NEW(p, pend - p);
|
2002-12-31 01:56:21 +03:00
|
|
|
if (pend < lex_pend) rb_str_cat(str, "\n", 1);
|
2004-09-20 07:03:12 +04:00
|
|
|
lex_goto_eol(parser);
|
2002-06-24 11:20:42 +04:00
|
|
|
if (nextc() == -1) {
|
2002-12-15 05:48:40 +03:00
|
|
|
if (str) dispose_string(str);
|
2002-06-24 11:20:42 +04:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
} while (!whole_match_p(eos, len, indent));
|
|
|
|
}
|
|
|
|
else {
|
2007-11-27 05:21:17 +03:00
|
|
|
/* int mb = ENC_CODERANGE_7BIT, *mbp = &mb;*/
|
2002-06-24 11:20:42 +04:00
|
|
|
newtok();
|
|
|
|
if (c == '#') {
|
|
|
|
switch (c = nextc()) {
|
|
|
|
case '$':
|
|
|
|
case '@':
|
|
|
|
pushback(c);
|
|
|
|
return tSTRING_DVAR;
|
|
|
|
case '{':
|
|
|
|
return tSTRING_DBEG;
|
|
|
|
}
|
|
|
|
tokadd('#');
|
|
|
|
}
|
|
|
|
do {
|
|
|
|
pushback(c);
|
2007-12-02 16:08:03 +03:00
|
|
|
if ((c = tokadd_string(func, '\n', 0, NULL, &enc)) == -1) {
|
|
|
|
if (parser->eofp) goto error;
|
|
|
|
goto restore;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
if (c != '\n') {
|
2007-12-01 19:56:19 +03:00
|
|
|
set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_CONTENT;
|
|
|
|
}
|
|
|
|
tokadd(nextc());
|
2007-11-08 01:55:27 +03:00
|
|
|
/* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
|
2002-06-24 11:20:42 +04:00
|
|
|
if ((c = nextc()) == -1) goto error;
|
|
|
|
} while (!whole_match_p(eos, len, indent));
|
2007-12-01 19:56:19 +03:00
|
|
|
str = STR_NEW3(tok(), toklen(), enc, func);
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2009-10-20 09:50:53 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
if (!NIL_P(parser->delayed))
|
|
|
|
ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
|
|
|
|
lex_goto_eol(parser);
|
|
|
|
ripper_dispatch_ignored_scan_event(parser, tHEREDOC_END);
|
|
|
|
#endif
|
2002-06-24 11:20:42 +04:00
|
|
|
heredoc_restore(lex_strterm);
|
|
|
|
lex_strterm = NEW_STRTERM(-1, 0, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
set_yylval_str(str);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_CONTENT;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "lex.c"
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
static void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
arg_ambiguous_gen(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
2007-05-29 19:22:49 +04:00
|
|
|
rb_warning0("ambiguous first argument; put parentheses or even spaces");
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
|
|
|
dispatch0(arg_ambiguous);
|
|
|
|
#endif
|
2009-10-02 15:37:44 +04:00
|
|
|
}
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
#define arg_ambiguous() arg_ambiguous_gen(parser)
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
static ID
|
|
|
|
formal_argument_gen(struct parser_params *parser, ID lhs)
|
|
|
|
{
|
|
|
|
#ifndef RIPPER
|
|
|
|
if (!is_local_id(lhs))
|
|
|
|
yyerror("formal argument must be local variable");
|
|
|
|
#endif
|
|
|
|
shadowing_lvar(lhs);
|
|
|
|
return lhs;
|
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
lvar_defined_gen(struct parser_params *parser, ID id)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2006-12-31 18:02:22 +03:00
|
|
|
return (dyna_in_block() && dvar_defined(id)) || local_id(id);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-05-14 06:48:07 +04:00
|
|
|
/* emacsen -*- hack */
|
2009-09-14 11:39:16 +04:00
|
|
|
static long
|
|
|
|
parser_encode_length(struct parser_params *parser, const char *name, long len)
|
2007-12-17 19:21:21 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
long nlen;
|
2007-12-17 19:21:21 +03:00
|
|
|
|
|
|
|
if (len > 5 && name[nlen = len - 5] == '-') {
|
|
|
|
if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
|
|
|
|
return nlen;
|
|
|
|
}
|
|
|
|
if (len > 4 && name[nlen = len - 5] == '-') {
|
|
|
|
if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
|
|
|
|
return nlen;
|
|
|
|
if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0)
|
|
|
|
return nlen;
|
|
|
|
}
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2007-08-28 09:21:48 +04:00
|
|
|
static void
|
|
|
|
parser_set_encode(struct parser_params *parser, const char *name)
|
|
|
|
{
|
2007-10-03 11:58:50 +04:00
|
|
|
int idx = rb_enc_find_index(name);
|
2008-01-27 18:39:14 +03:00
|
|
|
rb_encoding *enc;
|
2009-06-24 10:02:33 +04:00
|
|
|
VALUE excargs[3];
|
2008-01-27 18:39:14 +03:00
|
|
|
|
2007-10-03 11:58:50 +04:00
|
|
|
if (idx < 0) {
|
2009-06-24 10:02:33 +04:00
|
|
|
VALUE rb_make_backtrace(void);
|
|
|
|
VALUE rb_make_exception(int, VALUE*);
|
|
|
|
|
|
|
|
excargs[1] = rb_sprintf("unknown encoding name: %s", name);
|
|
|
|
error:
|
|
|
|
excargs[0] = rb_eArgError;
|
|
|
|
excargs[2] = rb_make_backtrace();
|
|
|
|
rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));
|
|
|
|
rb_exc_raise(rb_make_exception(3, excargs));
|
2007-10-03 11:58:50 +04:00
|
|
|
}
|
2008-01-27 18:39:14 +03:00
|
|
|
enc = rb_enc_from_index(idx);
|
|
|
|
if (!rb_enc_asciicompat(enc)) {
|
2009-06-24 10:02:33 +04:00
|
|
|
excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
|
|
|
|
goto error;
|
2008-01-27 18:39:14 +03:00
|
|
|
}
|
|
|
|
parser->enc = enc;
|
2007-08-28 09:21:48 +04:00
|
|
|
}
|
|
|
|
|
2008-10-10 14:21:53 +04:00
|
|
|
static int
|
|
|
|
comment_at_top(struct parser_params *parser)
|
|
|
|
{
|
|
|
|
const char *p = lex_pbeg, *pend = lex_p - 1;
|
|
|
|
if (parser->line_count != (parser->has_shebang ? 2 : 1)) return 0;
|
|
|
|
while (p < pend) {
|
|
|
|
if (!ISSPACE(*p)) return 0;
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-10-10 17:16:58 +04:00
|
|
|
#ifndef RIPPER
|
2009-09-14 11:39:16 +04:00
|
|
|
typedef long (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);
|
2008-10-10 17:16:58 +04:00
|
|
|
typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);
|
|
|
|
|
2005-05-14 06:48:07 +04:00
|
|
|
static void
|
2007-10-12 10:04:57 +04:00
|
|
|
magic_comment_encoding(struct parser_params *parser, const char *name, const char *val)
|
2005-05-14 06:48:07 +04:00
|
|
|
{
|
2008-10-10 14:21:53 +04:00
|
|
|
if (!comment_at_top(parser)) {
|
2005-05-14 06:48:07 +04:00
|
|
|
return;
|
2008-10-10 14:21:53 +04:00
|
|
|
}
|
2007-08-28 09:21:48 +04:00
|
|
|
parser_set_encode(parser, val);
|
2005-05-14 06:48:07 +04:00
|
|
|
}
|
|
|
|
|
2007-10-12 10:04:57 +04:00
|
|
|
struct magic_comment {
|
2005-05-14 06:48:07 +04:00
|
|
|
const char *name;
|
2007-10-12 10:04:57 +04:00
|
|
|
rb_magic_comment_setter_t func;
|
2007-12-17 19:21:21 +03:00
|
|
|
rb_magic_comment_length_t length;
|
2005-05-14 06:48:07 +04:00
|
|
|
};
|
|
|
|
|
2007-10-12 10:04:57 +04:00
|
|
|
static const struct magic_comment magic_comments[] = {
|
2007-12-17 19:21:21 +03:00
|
|
|
{"coding", magic_comment_encoding, parser_encode_length},
|
|
|
|
{"encoding", magic_comment_encoding, parser_encode_length},
|
2005-05-14 06:48:07 +04:00
|
|
|
};
|
2005-06-02 18:43:10 +04:00
|
|
|
#endif
|
2005-05-14 06:48:07 +04:00
|
|
|
|
|
|
|
static const char *
|
2009-09-14 11:39:16 +04:00
|
|
|
magic_comment_marker(const char *str, long len)
|
2005-05-14 06:48:07 +04:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
long i = 2;
|
2005-05-14 06:48:07 +04:00
|
|
|
|
|
|
|
while (i < len) {
|
|
|
|
switch (str[i]) {
|
|
|
|
case '-':
|
|
|
|
if (str[i-1] == '*' && str[i-2] == '-') {
|
|
|
|
return str + i + 1;
|
|
|
|
}
|
|
|
|
i += 2;
|
|
|
|
break;
|
|
|
|
case '*':
|
|
|
|
if (i + 1 >= len) return 0;
|
|
|
|
if (str[i+1] != '-') {
|
|
|
|
i += 4;
|
|
|
|
}
|
|
|
|
else if (str[i-1] != '-') {
|
|
|
|
i += 2;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return str + i + 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
i += 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2009-09-14 11:39:16 +04:00
|
|
|
parser_magic_comment(struct parser_params *parser, const char *str, long len)
|
2005-05-14 06:48:07 +04:00
|
|
|
{
|
|
|
|
VALUE name = 0, val = 0;
|
|
|
|
const char *beg, *end, *vbeg, *vend;
|
|
|
|
#define str_copy(_s, _p, _n) ((_s) \
|
|
|
|
? (rb_str_resize((_s), (_n)), \
|
2006-08-31 14:47:44 +04:00
|
|
|
MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
: ((_s) = STR_NEW((_p), (_n))))
|
2005-05-14 06:48:07 +04:00
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
if (len <= 7) return FALSE;
|
|
|
|
if (!(beg = magic_comment_marker(str, len))) return FALSE;
|
|
|
|
if (!(end = magic_comment_marker(beg, str + len - beg))) return FALSE;
|
2005-05-14 06:48:07 +04:00
|
|
|
str = beg;
|
|
|
|
len = end - beg - 3;
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
|
2005-05-14 06:48:07 +04:00
|
|
|
/* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
|
|
|
|
while (len > 0) {
|
2005-06-02 18:43:10 +04:00
|
|
|
#ifndef RIPPER
|
2007-10-12 10:04:57 +04:00
|
|
|
const struct magic_comment *p = magic_comments;
|
2005-06-02 18:43:10 +04:00
|
|
|
#endif
|
2008-10-10 14:21:53 +04:00
|
|
|
char *s;
|
2009-09-14 11:39:16 +04:00
|
|
|
int i;
|
|
|
|
long n = 0;
|
2005-05-14 06:48:07 +04:00
|
|
|
|
|
|
|
for (; len > 0 && *str; str++, --len) {
|
|
|
|
switch (*str) {
|
|
|
|
case '\'': case '"': case ':': case ';':
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (!ISSPACE(*str)) break;
|
|
|
|
}
|
|
|
|
for (beg = str; len > 0; str++, --len) {
|
|
|
|
switch (*str) {
|
|
|
|
case '\'': case '"': case ':': case ';':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (ISSPACE(*str)) break;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
for (end = str; len > 0 && ISSPACE(*str); str++, --len);
|
|
|
|
if (!len) break;
|
|
|
|
if (*str != ':') continue;
|
|
|
|
|
|
|
|
do str++; while (--len > 0 && ISSPACE(*str));
|
|
|
|
if (!len) break;
|
|
|
|
if (*str == '"') {
|
|
|
|
for (vbeg = ++str; --len > 0 && *str != '"'; str++) {
|
|
|
|
if (*str == '\\') {
|
|
|
|
--len;
|
|
|
|
++str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vend = str;
|
|
|
|
if (len) {
|
|
|
|
--len;
|
|
|
|
++str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2007-12-09 06:03:18 +03:00
|
|
|
for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
|
2005-05-14 06:48:07 +04:00
|
|
|
vend = str;
|
|
|
|
}
|
|
|
|
while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
|
|
|
|
|
2005-05-22 07:31:08 +04:00
|
|
|
n = end - beg;
|
|
|
|
str_copy(name, beg, n);
|
2008-10-10 14:21:53 +04:00
|
|
|
s = RSTRING_PTR(name);
|
|
|
|
for (i = 0; i < n; ++i) {
|
2009-10-13 13:20:59 +04:00
|
|
|
if (s[i] == '-') s[i] = '_';
|
2008-10-10 14:21:53 +04:00
|
|
|
}
|
2005-06-02 18:43:10 +04:00
|
|
|
#ifndef RIPPER
|
2005-05-14 06:48:07 +04:00
|
|
|
do {
|
2008-10-10 14:21:53 +04:00
|
|
|
if (STRNCASECMP(p->name, s, n) == 0) {
|
2007-12-17 19:21:21 +03:00
|
|
|
n = vend - vbeg;
|
|
|
|
if (p->length) {
|
|
|
|
n = (*p->length)(parser, vbeg, n);
|
|
|
|
}
|
|
|
|
str_copy(val, vbeg, n);
|
2008-10-10 14:21:53 +04:00
|
|
|
(*p->func)(parser, s, RSTRING_PTR(val));
|
2005-05-14 06:48:07 +04:00
|
|
|
break;
|
|
|
|
}
|
2009-09-14 11:39:16 +04:00
|
|
|
} while (++p < magic_comments + numberof(magic_comments));
|
2005-06-02 18:43:10 +04:00
|
|
|
#else
|
2007-10-12 10:04:57 +04:00
|
|
|
dispatch2(magic_comment, name, val);
|
2005-06-02 18:43:10 +04:00
|
|
|
#endif
|
2005-05-14 06:48:07 +04:00
|
|
|
}
|
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
return TRUE;
|
2005-05-14 06:48:07 +04:00
|
|
|
}
|
|
|
|
|
2007-10-12 10:04:57 +04:00
|
|
|
static void
|
|
|
|
set_file_encoding(struct parser_params *parser, const char *str, const char *send)
|
|
|
|
{
|
|
|
|
int sep = 0;
|
|
|
|
const char *beg = str;
|
|
|
|
VALUE s;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
if (send - str <= 6) return;
|
|
|
|
switch (str[6]) {
|
2007-10-13 04:12:00 +04:00
|
|
|
case 'C': case 'c': str += 6; continue;
|
|
|
|
case 'O': case 'o': str += 5; continue;
|
|
|
|
case 'D': case 'd': str += 4; continue;
|
|
|
|
case 'I': case 'i': str += 3; continue;
|
|
|
|
case 'N': case 'n': str += 2; continue;
|
|
|
|
case 'G': case 'g': str += 1; continue;
|
2007-10-12 10:04:57 +04:00
|
|
|
case '=': case ':':
|
|
|
|
sep = 1;
|
|
|
|
str += 6;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str += 6;
|
|
|
|
if (ISSPACE(*str)) break;
|
|
|
|
continue;
|
|
|
|
}
|
2008-01-03 08:37:47 +03:00
|
|
|
if (STRNCASECMP(str-6, "coding", 6) == 0) break;
|
2007-10-12 10:04:57 +04:00
|
|
|
}
|
|
|
|
for (;;) {
|
|
|
|
do {
|
|
|
|
if (++str >= send) return;
|
|
|
|
} while (ISSPACE(*str));
|
|
|
|
if (sep) break;
|
|
|
|
if (*str != '=' && *str != ':') return;
|
|
|
|
sep = 1;
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
beg = str;
|
|
|
|
while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send);
|
2007-12-17 19:21:21 +03:00
|
|
|
s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg));
|
2007-10-12 10:04:57 +04:00
|
|
|
parser_set_encode(parser, RSTRING_PTR(s));
|
|
|
|
rb_str_resize(s, 0);
|
|
|
|
}
|
|
|
|
|
2005-05-14 06:48:07 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_prepare(struct parser_params *parser)
|
2005-05-14 06:48:07 +04:00
|
|
|
{
|
|
|
|
int c = nextc();
|
|
|
|
switch (c) {
|
|
|
|
case '#':
|
|
|
|
if (peek('!')) parser->has_shebang = 1;
|
|
|
|
break;
|
|
|
|
case 0xef: /* UTF-8 BOM marker */
|
|
|
|
if (lex_pend - lex_p >= 2 &&
|
|
|
|
(unsigned char)lex_p[0] == 0xbb &&
|
|
|
|
(unsigned char)lex_p[1] == 0xbf) {
|
2008-10-11 14:49:56 +04:00
|
|
|
parser->enc = rb_utf8_encoding();
|
2005-05-14 06:48:07 +04:00
|
|
|
lex_p += 2;
|
2007-11-20 09:08:16 +03:00
|
|
|
lex_pbeg = lex_p;
|
2005-05-14 06:48:07 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EOF:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
pushback(c);
|
2008-01-19 02:35:38 +03:00
|
|
|
parser->enc = rb_enc_get(lex_lastline);
|
2005-05-14 06:48:07 +04:00
|
|
|
}
|
|
|
|
|
2003-01-31 07:00:17 +03:00
|
|
|
#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
|
2010-04-18 17:16:30 +04:00
|
|
|
#define IS_END() (lex_state == EXPR_END || lex_state == EXPR_ENDARG)
|
2005-02-08 16:39:47 +03:00
|
|
|
#define IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_VALUE || lex_state == EXPR_CLASS)
|
2010-04-18 17:16:30 +04:00
|
|
|
#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
|
2001-05-30 13:12:34 +04:00
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_yylex(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
register int c;
|
|
|
|
int space_seen = 0;
|
2001-05-30 13:12:34 +04:00
|
|
|
int cmd_state;
|
2005-10-22 08:09:24 +04:00
|
|
|
enum lex_state_e last_state;
|
2007-11-08 01:55:27 +03:00
|
|
|
rb_encoding *enc;
|
2007-09-26 13:39:08 +04:00
|
|
|
int mb;
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2009-10-02 23:34:28 +04:00
|
|
|
int fallthru = FALSE;
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
if (lex_strterm) {
|
|
|
|
int token;
|
|
|
|
if (nd_type(lex_strterm) == NODE_HEREDOC) {
|
|
|
|
token = here_document(lex_strterm);
|
|
|
|
if (token == tSTRING_END) {
|
|
|
|
lex_strterm = 0;
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
token = parse_string(lex_strterm);
|
|
|
|
if (token == tSTRING_END || token == tREGEXP_END) {
|
|
|
|
rb_gc_force_recycle((VALUE)lex_strterm);
|
|
|
|
lex_strterm = 0;
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return token;
|
|
|
|
}
|
2001-05-30 13:12:34 +04:00
|
|
|
cmd_state = command_start;
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = FALSE;
|
1999-08-13 09:45:20 +04:00
|
|
|
retry:
|
1998-01-16 15:13:05 +03:00
|
|
|
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' */
|
2000-12-12 10:42:35 +03:00
|
|
|
space_seen++;
|
2007-11-19 10:10:09 +03:00
|
|
|
#ifdef RIPPER
|
|
|
|
while ((c = nextc())) {
|
|
|
|
switch (c) {
|
|
|
|
case ' ': case '\t': case '\f': case '\r':
|
|
|
|
case '\13': /* '\v' */
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto outofloop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
outofloop:
|
|
|
|
pushback(c);
|
|
|
|
ripper_dispatch_scan_event(parser, tSP);
|
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
goto retry;
|
|
|
|
|
|
|
|
case '#': /* it's a comment */
|
2008-08-01 13:38:50 +04:00
|
|
|
/* no magic_comment in shebang line */
|
2008-10-10 14:21:53 +04:00
|
|
|
if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) {
|
|
|
|
if (comment_at_top(parser)) {
|
2008-08-01 13:38:50 +04:00
|
|
|
set_file_encoding(parser, lex_p, lex_pend);
|
2007-10-12 10:04:57 +04:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-05-14 06:48:07 +04:00
|
|
|
lex_p = lex_pend;
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2006-12-31 18:02:22 +03:00
|
|
|
ripper_dispatch_scan_event(parser, tCOMMENT);
|
2009-10-02 23:34:28 +04:00
|
|
|
fallthru = TRUE;
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
/* fall through */
|
|
|
|
case '\n':
|
1999-01-20 07:59:39 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_BEG:
|
|
|
|
case EXPR_FNAME:
|
|
|
|
case EXPR_DOT:
|
2002-03-08 10:03:09 +03:00
|
|
|
case EXPR_CLASS:
|
2005-02-08 16:39:47 +03:00
|
|
|
case EXPR_VALUE:
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2006-12-31 18:02:22 +03:00
|
|
|
if (!fallthru) {
|
|
|
|
ripper_dispatch_scan_event(parser, tIGNORED_NL);
|
|
|
|
}
|
2009-10-02 23:34:28 +04:00
|
|
|
fallthru = FALSE;
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
goto retry;
|
1999-01-20 07:59:39 +03:00
|
|
|
default:
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2007-10-25 21:06:29 +04:00
|
|
|
while ((c = nextc())) {
|
|
|
|
switch (c) {
|
|
|
|
case ' ': case '\t': case '\f': case '\r':
|
|
|
|
case '\13': /* '\v' */
|
|
|
|
space_seen++;
|
|
|
|
break;
|
|
|
|
case '.': {
|
2007-11-19 10:10:09 +03:00
|
|
|
if ((c = nextc()) != '.') {
|
|
|
|
pushback(c);
|
|
|
|
pushback('.');
|
2007-12-30 07:56:17 +03:00
|
|
|
goto retry;
|
2007-11-19 10:10:09 +03:00
|
|
|
}
|
2007-10-25 21:06:29 +04:00
|
|
|
}
|
|
|
|
default:
|
2007-11-19 10:10:09 +03:00
|
|
|
--ruby_sourceline;
|
2007-11-09 17:33:18 +03:00
|
|
|
lex_nextline = lex_lastline;
|
2007-12-30 07:56:17 +03:00
|
|
|
case -1: /* EOF no decrement*/
|
|
|
|
lex_goto_eol(parser);
|
2007-11-19 10:10:09 +03:00
|
|
|
#ifdef RIPPER
|
|
|
|
if (c != -1) {
|
|
|
|
parser->tokp = lex_p;
|
|
|
|
}
|
|
|
|
#endif
|
2007-10-25 21:06:29 +04:00
|
|
|
goto normal_newline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
normal_newline:
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = TRUE;
|
1998-01-16 15:13:05 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
return '\n';
|
|
|
|
|
|
|
|
case '*':
|
|
|
|
if ((c = nextc()) == '*') {
|
2002-06-03 02:16:55 +04:00
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id(tPOW);
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
2002-02-19 08:39:06 +03:00
|
|
|
c = tPOW;
|
2000-05-30 08:24:17 +04:00
|
|
|
}
|
|
|
|
else {
|
2002-02-19 08:39:06 +03:00
|
|
|
if (c == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('*');
|
2002-02-19 08:39:06 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
return tOP_ASGN;
|
|
|
|
}
|
|
|
|
pushback(c);
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_SPCARG(c)) {
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_warning0("`*' interpreted as argument prefix");
|
2002-02-19 08:39:06 +03:00
|
|
|
c = tSTAR;
|
|
|
|
}
|
2004-03-20 19:45:41 +03:00
|
|
|
else if (IS_BEG()) {
|
2002-02-19 08:39:06 +03:00
|
|
|
c = tSTAR;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c = '*';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-05-30 08:24:17 +04:00
|
|
|
return c;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '!':
|
2007-12-09 19:39:49 +03:00
|
|
|
c = nextc();
|
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
|
|
|
lex_state = EXPR_ARG;
|
2007-12-10 02:16:54 +03:00
|
|
|
if (c == '@') {
|
|
|
|
return '!';
|
2007-12-09 19:39:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
|
|
|
if (c == '=') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tNEQ;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (c == '~') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tNMATCH;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '!';
|
|
|
|
|
|
|
|
case '=':
|
2002-12-31 01:56:21 +03:00
|
|
|
if (was_bol()) {
|
1998-01-16 15:13:05 +03:00
|
|
|
/* skip embedded rd document */
|
1999-01-20 07:59:39 +03:00
|
|
|
if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) {
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2009-10-02 23:34:28 +04:00
|
|
|
int first_p = TRUE;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
lex_goto_eol(parser);
|
|
|
|
ripper_dispatch_scan_event(parser, tEMBDOC_BEG);
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
for (;;) {
|
2004-09-20 07:03:12 +04:00
|
|
|
lex_goto_eol(parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2006-12-31 18:02:22 +03:00
|
|
|
if (!first_p) {
|
|
|
|
ripper_dispatch_scan_event(parser, tEMBDOC);
|
|
|
|
}
|
2009-10-02 23:34:28 +04:00
|
|
|
first_p = FALSE;
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
c = nextc();
|
1998-01-16 15:19:22 +03:00
|
|
|
if (c == -1) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "embedded document meets end of file");
|
1998-01-16 15:19:22 +03:00
|
|
|
return 0;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
if (c != '=') continue;
|
2000-10-31 11:37:47 +03:00
|
|
|
if (strncmp(lex_p, "end", 3) == 0 &&
|
|
|
|
(lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) {
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-09-20 07:03:12 +04:00
|
|
|
lex_goto_eol(parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
2006-12-31 18:02:22 +03:00
|
|
|
ripper_dispatch_scan_event(parser, tEMBDOC_END);
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) == '=') {
|
|
|
|
if ((c = nextc()) == '=') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tEQQ;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tEQ;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (c == '~') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tMATCH;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else if (c == '>') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tASSOC;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '=';
|
|
|
|
|
|
|
|
case '<':
|
1998-01-16 15:19:22 +03:00
|
|
|
c = nextc();
|
|
|
|
if (c == '<' &&
|
2001-06-01 10:47:32 +04:00
|
|
|
lex_state != EXPR_END &&
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state != EXPR_DOT &&
|
2005-02-22 01:25:28 +03:00
|
|
|
lex_state != EXPR_ENDARG &&
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state != EXPR_CLASS &&
|
2001-05-30 13:12:34 +04:00
|
|
|
(!IS_ARG() || space_seen)) {
|
2002-06-24 11:20:42 +04:00
|
|
|
int token = heredoc_identifier();
|
|
|
|
if (token) return token;
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
if (c == '=') {
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) == '>') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tCMP;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tLEQ;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (c == '<') {
|
2002-06-18 07:53:23 +04:00
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id(tLSHFT);
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tLSHFT;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '<';
|
|
|
|
|
|
|
|
case '>':
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) == '=') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tGEQ;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (c == '>') {
|
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id(tRSHFT);
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tRSHFT;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '>';
|
|
|
|
|
|
|
|
case '"':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_dquote, '"', 0);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_BEG;
|
2002-06-18 10:29:07 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
case '`':
|
2002-06-18 10:29:07 +04:00
|
|
|
if (lex_state == EXPR_FNAME) {
|
|
|
|
lex_state = EXPR_END;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
if (lex_state == EXPR_DOT) {
|
2003-01-31 07:00:17 +03:00
|
|
|
if (cmd_state)
|
|
|
|
lex_state = EXPR_CMDARG;
|
|
|
|
else
|
|
|
|
lex_state = EXPR_ARG;
|
2002-06-18 10:29:07 +04:00
|
|
|
return c;
|
|
|
|
}
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_xquote, '`', 0);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tXSTRING_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '\'':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_squote, '\'', 0);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '?':
|
2008-09-06 20:09:43 +04:00
|
|
|
if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) {
|
2005-02-08 16:39:47 +03:00
|
|
|
lex_state = EXPR_VALUE;
|
1999-01-20 07:59:39 +03:00
|
|
|
return '?';
|
|
|
|
}
|
|
|
|
c = nextc();
|
2001-08-29 10:28:51 +04:00
|
|
|
if (c == -1) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "incomplete character syntax");
|
2000-12-12 10:42:35 +03:00
|
|
|
return 0;
|
|
|
|
}
|
2007-10-26 10:00:52 +04:00
|
|
|
if (rb_enc_isspace(c, parser->enc)) {
|
|
|
|
if (!IS_ARG()) {
|
2002-09-04 10:37:39 +04:00
|
|
|
int c2 = 0;
|
2002-06-18 10:29:07 +04:00
|
|
|
switch (c) {
|
|
|
|
case ' ':
|
2002-09-04 10:37:39 +04:00
|
|
|
c2 = 's';
|
2002-06-18 10:29:07 +04:00
|
|
|
break;
|
|
|
|
case '\n':
|
2002-09-04 10:37:39 +04:00
|
|
|
c2 = 'n';
|
2002-06-18 10:29:07 +04:00
|
|
|
break;
|
|
|
|
case '\t':
|
2002-09-04 10:37:39 +04:00
|
|
|
c2 = 't';
|
2002-06-18 10:29:07 +04:00
|
|
|
break;
|
|
|
|
case '\v':
|
2002-09-04 10:37:39 +04:00
|
|
|
c2 = 'v';
|
|
|
|
break;
|
|
|
|
case '\r':
|
|
|
|
c2 = 'r';
|
|
|
|
break;
|
|
|
|
case '\f':
|
|
|
|
c2 = 'f';
|
2002-06-18 10:29:07 +04:00
|
|
|
break;
|
|
|
|
}
|
2002-09-04 10:37:39 +04:00
|
|
|
if (c2) {
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_warnI("invalid character syntax; use ?\\%c", c2);
|
2002-06-18 10:29:07 +04:00
|
|
|
}
|
|
|
|
}
|
2002-06-18 19:53:57 +04:00
|
|
|
ternary:
|
1999-01-20 07:59:39 +03:00
|
|
|
pushback(c);
|
2005-02-08 16:39:47 +03:00
|
|
|
lex_state = EXPR_VALUE;
|
1999-01-20 07:59:39 +03:00
|
|
|
return '?';
|
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
newtok();
|
2007-11-08 01:55:27 +03:00
|
|
|
enc = parser->enc;
|
2007-12-08 05:50:43 +03:00
|
|
|
if (!parser_isascii()) {
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return 0;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
else if ((rb_enc_isalnum(c, parser->enc) || c == '_') &&
|
2007-09-06 16:33:45 +04:00
|
|
|
lex_p < lex_pend && is_identchar(lex_p, lex_pend, parser->enc)) {
|
2002-06-18 19:53:57 +04:00
|
|
|
goto ternary;
|
|
|
|
}
|
2007-12-01 19:56:19 +03:00
|
|
|
else if (c == '\\') {
|
|
|
|
if (peek('u')) {
|
|
|
|
nextc();
|
|
|
|
c = parser_tokadd_utf8(parser, &enc, 0, 0, 0);
|
|
|
|
if (0x80 <= c) {
|
|
|
|
tokaddmbc(c, enc);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
tokadd(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c = read_escape(0, &enc);
|
|
|
|
tokadd(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
tokadd(c);
|
2007-12-01 19:56:19 +03:00
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
tokfix();
|
2007-12-01 19:56:19 +03:00
|
|
|
set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0));
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
return tCHAR;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '&':
|
|
|
|
if ((c = nextc()) == '&') {
|
1999-01-20 07:59:39 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id(tANDOP);
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return tANDOP;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else if (c == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('&');
|
1999-01-20 07:59:39 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_SPCARG(c)) {
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_warning0("`&' interpreted as argument prefix");
|
2000-05-30 08:24:17 +04:00
|
|
|
c = tAMPER;
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2004-03-20 19:45:41 +03:00
|
|
|
else if (IS_BEG()) {
|
2000-05-30 08:24:17 +04:00
|
|
|
c = tAMPER;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c = '&';
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
2000-05-30 08:24:17 +04:00
|
|
|
return c;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '|':
|
|
|
|
if ((c = nextc()) == '|') {
|
2002-02-19 08:39:06 +03:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id(tOROP);
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return tOROP;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
if (c == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('|');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
|
|
|
lex_state = EXPR_ARG;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
|
|
|
return '|';
|
|
|
|
|
|
|
|
case '+':
|
|
|
|
c = nextc();
|
1999-08-13 09:45:20 +04:00
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
2002-02-19 08:39:06 +03:00
|
|
|
lex_state = EXPR_ARG;
|
1998-01-16 15:13:05 +03:00
|
|
|
if (c == '@') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tUPLUS;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '+';
|
|
|
|
}
|
|
|
|
if (c == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('+');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_BEG() || IS_SPCARG(c)) {
|
|
|
|
if (!IS_BEG()) arg_ambiguous();
|
2000-05-30 08:24:17 +04:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
pushback(c);
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISDIGIT(c)) {
|
2000-02-26 04:16:48 +03:00
|
|
|
c = '+';
|
|
|
|
goto start_num;
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
return tUPLUS;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
pushback(c);
|
|
|
|
return '+';
|
|
|
|
|
|
|
|
case '-':
|
|
|
|
c = nextc();
|
1999-08-13 09:45:20 +04:00
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
2002-02-19 08:39:06 +03:00
|
|
|
lex_state = EXPR_ARG;
|
1998-01-16 15:13:05 +03:00
|
|
|
if (c == '@') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tUMINUS;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '-';
|
|
|
|
}
|
|
|
|
if (c == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('-');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-07-27 11:27:19 +04:00
|
|
|
if (c == '>') {
|
|
|
|
lex_state = EXPR_ARG;
|
2007-03-04 19:36:36 +03:00
|
|
|
return tLAMBDA;
|
|
|
|
}
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_BEG() || IS_SPCARG(c)) {
|
|
|
|
if (!IS_BEG()) arg_ambiguous();
|
1998-01-16 15:13:05 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
pushback(c);
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISDIGIT(c)) {
|
2003-01-23 06:39:25 +03:00
|
|
|
return tUMINUS_NUM;
|
2000-02-01 06:12:21 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
return tUMINUS;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
pushback(c);
|
|
|
|
return '-';
|
|
|
|
|
|
|
|
case '.':
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
if ((c = nextc()) == '.') {
|
|
|
|
if ((c = nextc()) == '.') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tDOT3;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tDOT2;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISDIGIT(c)) {
|
2003-02-20 23:40:20 +03:00
|
|
|
yyerror("no .<digit> floating literal anymore; put 0 before dot");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2003-02-05 11:11:27 +03:00
|
|
|
lex_state = EXPR_DOT;
|
|
|
|
return '.';
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
start_num:
|
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
|
|
|
{
|
2002-01-28 12:33:56 +03:00
|
|
|
int is_float, seen_point, seen_e, nondigit;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-01-28 12:33:56 +03:00
|
|
|
is_float = seen_point = seen_e = nondigit = 0;
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
1998-01-16 15:13:05 +03:00
|
|
|
newtok();
|
|
|
|
if (c == '-' || c == '+') {
|
|
|
|
tokadd(c);
|
|
|
|
c = nextc();
|
|
|
|
}
|
|
|
|
if (c == '0') {
|
2009-11-30 05:00:14 +03:00
|
|
|
#define no_digits() do {yyerror("numeric literal without digits"); return 0;} while (0)
|
2002-01-28 12:33:56 +03:00
|
|
|
int start = toklen();
|
1998-01-16 15:13:05 +03:00
|
|
|
c = nextc();
|
|
|
|
if (c == 'x' || c == 'X') {
|
|
|
|
/* hexadecimal */
|
1999-08-13 09:45:20 +04:00
|
|
|
c = nextc();
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISXDIGIT(c)) {
|
2002-01-28 12:33:56 +03:00
|
|
|
do {
|
|
|
|
if (c == '_') {
|
|
|
|
if (nondigit) break;
|
|
|
|
nondigit = c;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (!ISXDIGIT(c)) break;
|
|
|
|
nondigit = 0;
|
|
|
|
tokadd(c);
|
2002-09-23 19:48:42 +04:00
|
|
|
} while ((c = nextc()) != -1);
|
2002-01-28 12:33:56 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
|
|
|
tokfix();
|
2002-01-28 12:33:56 +03:00
|
|
|
if (toklen() == start) {
|
2009-11-30 05:00:14 +03:00
|
|
|
no_digits();
|
2000-12-22 06:22:25 +03:00
|
|
|
}
|
2002-01-28 12:33:56 +03:00
|
|
|
else if (nondigit) goto trailing_uc;
|
2009-09-14 11:39:16 +04:00
|
|
|
set_yylval_literal(rb_cstr_to_inum(tok(), 16, FALSE));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tINTEGER;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
if (c == 'b' || c == 'B') {
|
|
|
|
/* binary */
|
|
|
|
c = nextc();
|
2002-01-28 12:33:56 +03:00
|
|
|
if (c == '0' || c == '1') {
|
|
|
|
do {
|
|
|
|
if (c == '_') {
|
|
|
|
if (nondigit) break;
|
|
|
|
nondigit = c;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (c != '0' && c != '1') break;
|
|
|
|
nondigit = 0;
|
|
|
|
tokadd(c);
|
2002-09-23 19:48:42 +04:00
|
|
|
} while ((c = nextc()) != -1);
|
2002-01-28 12:33:56 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
pushback(c);
|
|
|
|
tokfix();
|
2002-01-28 12:33:56 +03:00
|
|
|
if (toklen() == start) {
|
2009-11-30 05:00:14 +03:00
|
|
|
no_digits();
|
2000-12-22 06:22:25 +03:00
|
|
|
}
|
2002-01-28 12:33:56 +03:00
|
|
|
else if (nondigit) goto trailing_uc;
|
2009-09-14 11:39:16 +04:00
|
|
|
set_yylval_literal(rb_cstr_to_inum(tok(), 2, FALSE));
|
1999-08-13 09:45:20 +04:00
|
|
|
return tINTEGER;
|
|
|
|
}
|
2002-07-26 10:12:39 +04:00
|
|
|
if (c == 'd' || c == 'D') {
|
|
|
|
/* decimal */
|
|
|
|
c = nextc();
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISDIGIT(c)) {
|
2002-07-26 10:12:39 +04:00
|
|
|
do {
|
|
|
|
if (c == '_') {
|
|
|
|
if (nondigit) break;
|
|
|
|
nondigit = c;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (!ISDIGIT(c)) break;
|
|
|
|
nondigit = 0;
|
|
|
|
tokadd(c);
|
2002-09-23 19:48:42 +04:00
|
|
|
} while ((c = nextc()) != -1);
|
2002-07-26 10:12:39 +04:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
tokfix();
|
|
|
|
if (toklen() == start) {
|
2009-11-30 05:00:14 +03:00
|
|
|
no_digits();
|
2002-07-26 10:12:39 +04:00
|
|
|
}
|
|
|
|
else if (nondigit) goto trailing_uc;
|
2009-09-14 11:39:16 +04:00
|
|
|
set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE));
|
2002-07-26 10:12:39 +04:00
|
|
|
return tINTEGER;
|
|
|
|
}
|
|
|
|
if (c == '_') {
|
|
|
|
/* 0_0 */
|
|
|
|
goto octal_number;
|
|
|
|
}
|
|
|
|
if (c == 'o' || c == 'O') {
|
|
|
|
/* prefixed octal */
|
|
|
|
c = nextc();
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c == -1 || c == '_' || !ISDIGIT(c)) {
|
2009-11-30 05:00:14 +03:00
|
|
|
no_digits();
|
2002-07-26 10:12:39 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (c >= '0' && c <= '7') {
|
1999-08-13 09:45:20 +04:00
|
|
|
/* octal */
|
2002-07-26 10:12:39 +04:00
|
|
|
octal_number:
|
2006-12-31 18:02:22 +03:00
|
|
|
do {
|
2000-12-22 06:22:25 +03:00
|
|
|
if (c == '_') {
|
2002-01-28 12:33:56 +03:00
|
|
|
if (nondigit) break;
|
|
|
|
nondigit = c;
|
2000-12-22 06:22:25 +03:00
|
|
|
continue;
|
|
|
|
}
|
2008-08-02 10:51:53 +04:00
|
|
|
if (c < '0' || c > '9') break;
|
|
|
|
if (c > '7') goto invalid_octal;
|
2002-01-28 12:33:56 +03:00
|
|
|
nondigit = 0;
|
1999-08-13 09:45:20 +04:00
|
|
|
tokadd(c);
|
2002-09-23 19:48:42 +04:00
|
|
|
} while ((c = nextc()) != -1);
|
2002-01-28 12:33:56 +03:00
|
|
|
if (toklen() > start) {
|
|
|
|
pushback(c);
|
|
|
|
tokfix();
|
|
|
|
if (nondigit) goto trailing_uc;
|
2009-09-14 11:39:16 +04:00
|
|
|
set_yylval_literal(rb_cstr_to_inum(tok(), 8, FALSE));
|
2002-01-28 12:33:56 +03:00
|
|
|
return tINTEGER;
|
|
|
|
}
|
2002-06-10 14:06:12 +04:00
|
|
|
if (nondigit) {
|
|
|
|
pushback(c);
|
|
|
|
goto trailing_uc;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
if (c > '7' && c <= '9') {
|
2008-08-02 10:51:53 +04:00
|
|
|
invalid_octal:
|
2007-12-27 11:27:19 +03:00
|
|
|
yyerror("Invalid octal digit");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-01-28 12:33:56 +03:00
|
|
|
else if (c == '.' || c == 'e' || c == 'E') {
|
1998-01-16 15:13:05 +03:00
|
|
|
tokadd('0');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pushback(c);
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_literal(INT2FIX(0));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tINTEGER;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
switch (c) {
|
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
2002-01-28 12:33:56 +03:00
|
|
|
nondigit = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
tokadd(c);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '.':
|
2002-01-28 12:33:56 +03:00
|
|
|
if (nondigit) goto trailing_uc;
|
1999-01-20 07:59:39 +03:00
|
|
|
if (seen_point || seen_e) {
|
1998-01-16 15:13:05 +03:00
|
|
|
goto decode_num;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
int c0 = nextc();
|
2009-07-02 02:53:51 +04:00
|
|
|
if (c0 == -1 || !ISDIGIT(c0)) {
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c0);
|
|
|
|
goto decode_num;
|
|
|
|
}
|
|
|
|
c = c0;
|
|
|
|
}
|
|
|
|
tokadd('.');
|
|
|
|
tokadd(c);
|
|
|
|
is_float++;
|
|
|
|
seen_point++;
|
2002-01-28 12:33:56 +03:00
|
|
|
nondigit = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'e':
|
|
|
|
case 'E':
|
2002-01-28 12:33:56 +03:00
|
|
|
if (nondigit) {
|
|
|
|
pushback(c);
|
|
|
|
c = nondigit;
|
|
|
|
goto decode_num;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
if (seen_e) {
|
|
|
|
goto decode_num;
|
|
|
|
}
|
|
|
|
tokadd(c);
|
|
|
|
seen_e++;
|
|
|
|
is_float++;
|
2002-01-28 12:33:56 +03:00
|
|
|
nondigit = c;
|
|
|
|
c = nextc();
|
|
|
|
if (c != '-' && c != '+') continue;
|
|
|
|
tokadd(c);
|
|
|
|
nondigit = c;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
|
2000-12-22 06:22:25 +03:00
|
|
|
case '_': /* `_' in number just ignored */
|
2002-01-28 12:33:56 +03:00
|
|
|
if (nondigit) goto decode_num;
|
|
|
|
nondigit = c;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
goto decode_num;
|
|
|
|
}
|
|
|
|
c = nextc();
|
|
|
|
}
|
|
|
|
|
|
|
|
decode_num:
|
|
|
|
pushback(c);
|
2002-01-28 12:33:56 +03:00
|
|
|
if (nondigit) {
|
|
|
|
char tmp[30];
|
2000-12-22 06:22:25 +03:00
|
|
|
trailing_uc:
|
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 04:29:17 +03:00
|
|
|
snprintf(tmp, sizeof(tmp), "trailing `%c' in number", nondigit);
|
2002-01-28 12:33:56 +03:00
|
|
|
yyerror(tmp);
|
2000-12-22 06:22:25 +03:00
|
|
|
}
|
2009-10-17 11:35:39 +04:00
|
|
|
tokfix();
|
1998-01-16 15:13:05 +03:00
|
|
|
if (is_float) {
|
1999-08-13 09:45:20 +04:00
|
|
|
double d = strtod(tok(), 0);
|
|
|
|
if (errno == ERANGE) {
|
2008-05-15 14:48:10 +04:00
|
|
|
rb_warningS("Float %s out of range", tok());
|
1999-08-13 09:45:20 +04:00
|
|
|
errno = 0;
|
|
|
|
}
|
2008-09-05 22:24:21 +04:00
|
|
|
set_yylval_literal(DBL2NUM(d));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tFLOAT;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2009-09-14 11:39:16 +04:00
|
|
|
set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tINTEGER;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2005-08-12 12:13:28 +04:00
|
|
|
case ')':
|
1998-01-16 15:13:05 +03:00
|
|
|
case ']':
|
2005-08-20 19:44:54 +04:00
|
|
|
paren_nest--;
|
1998-01-16 15:13:05 +03:00
|
|
|
case '}':
|
2001-05-30 13:12:34 +04:00
|
|
|
COND_LEXPOP();
|
|
|
|
CMDARG_LEXPOP();
|
2007-04-20 13:38:16 +04:00
|
|
|
if (c == ')')
|
|
|
|
lex_state = EXPR_END;
|
|
|
|
else
|
|
|
|
lex_state = EXPR_ENDARG;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case ':':
|
|
|
|
c = nextc();
|
|
|
|
if (c == ':') {
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_BEG() || lex_state == EXPR_CLASS || IS_SPCARG(-1)) {
|
1999-01-20 07:59:39 +03:00
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
return tCOLON3;
|
|
|
|
}
|
|
|
|
lex_state = EXPR_DOT;
|
|
|
|
return tCOLON2;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2010-04-18 17:16:30 +04:00
|
|
|
if ((IS_END() && !space_seen) || ISSPACE(c)) {
|
2002-10-23 14:17:30 +04:00
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
lex_state = EXPR_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
return ':';
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2002-10-23 14:17:30 +04:00
|
|
|
switch (c) {
|
|
|
|
case '\'':
|
|
|
|
lex_strterm = NEW_STRTERM(str_ssym, c, 0);
|
|
|
|
break;
|
|
|
|
case '"':
|
|
|
|
lex_strterm = NEW_STRTERM(str_dsym, c, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
pushback(c);
|
|
|
|
break;
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
lex_state = EXPR_FNAME;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tSYMBEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '/':
|
2004-03-20 19:45:41 +03:00
|
|
|
if (IS_BEG()) {
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tREGEXP_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('/');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-05-30 08:24:17 +04:00
|
|
|
pushback(c);
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_SPCARG(c)) {
|
|
|
|
arg_ambiguous();
|
|
|
|
lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
|
|
|
|
return tREGEXP_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
return '/';
|
|
|
|
|
|
|
|
case '^':
|
2000-11-10 10:16:52 +03:00
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('^');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
2000-11-10 10:16:52 +03:00
|
|
|
return '^';
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case ';':
|
2005-06-12 20:56:06 +04:00
|
|
|
lex_state = EXPR_BEG;
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = TRUE;
|
2005-06-12 20:56:06 +04:00
|
|
|
return ';';
|
|
|
|
|
2001-05-30 13:12:34 +04:00
|
|
|
case ',':
|
1998-01-16 15:13:05 +03:00
|
|
|
lex_state = EXPR_BEG;
|
2005-06-12 20:56:06 +04:00
|
|
|
return ',';
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '~':
|
1999-08-13 09:45:20 +04:00
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) != '@') {
|
|
|
|
pushback(c);
|
|
|
|
}
|
2007-12-09 19:39:49 +03:00
|
|
|
lex_state = EXPR_ARG;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2007-12-09 19:39:49 +03:00
|
|
|
else {
|
|
|
|
lex_state = EXPR_BEG;
|
2002-02-19 08:39:06 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
return '~';
|
|
|
|
|
|
|
|
case '(':
|
2004-03-20 19:45:41 +03:00
|
|
|
if (IS_BEG()) {
|
1999-01-20 07:59:39 +03:00
|
|
|
c = tLPAREN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2001-05-30 13:12:34 +04:00
|
|
|
else if (space_seen) {
|
2008-06-21 11:29:05 +04:00
|
|
|
if (IS_ARG()) {
|
2003-01-31 07:00:17 +03:00
|
|
|
c = tLPAREN_ARG;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-08-12 12:13:28 +04:00
|
|
|
paren_nest++;
|
2001-05-30 13:12:34 +04:00
|
|
|
COND_PUSH(0);
|
|
|
|
CMDARG_PUSH(0);
|
2000-05-30 08:24:17 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case '[':
|
2005-08-20 19:44:54 +04:00
|
|
|
paren_nest++;
|
1999-08-13 09:45:20 +04:00
|
|
|
if (lex_state == EXPR_FNAME || lex_state == EXPR_DOT) {
|
2002-02-19 08:39:06 +03:00
|
|
|
lex_state = EXPR_ARG;
|
1998-01-16 15:13:05 +03:00
|
|
|
if ((c = nextc()) == ']') {
|
|
|
|
if ((c = nextc()) == '=') {
|
1999-01-20 07:59:39 +03:00
|
|
|
return tASET;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
1999-01-20 07:59:39 +03:00
|
|
|
return tAREF;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '[';
|
|
|
|
}
|
2004-03-20 19:45:41 +03:00
|
|
|
else if (IS_BEG()) {
|
1999-01-20 07:59:39 +03:00
|
|
|
c = tLBRACK;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2001-05-30 13:12:34 +04:00
|
|
|
else if (IS_ARG() && space_seen) {
|
1999-01-20 07:59:39 +03:00
|
|
|
c = tLBRACK;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
lex_state = EXPR_BEG;
|
2001-05-30 13:12:34 +04:00
|
|
|
COND_PUSH(0);
|
|
|
|
CMDARG_PUSH(0);
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case '{':
|
2005-08-12 12:13:28 +04:00
|
|
|
if (lpar_beg && lpar_beg == paren_nest) {
|
|
|
|
lex_state = EXPR_BEG;
|
2005-08-16 19:24:15 +04:00
|
|
|
lpar_beg = 0;
|
|
|
|
--paren_nest;
|
2010-04-16 16:57:28 +04:00
|
|
|
COND_PUSH(0);
|
|
|
|
CMDARG_PUSH(0);
|
2005-08-12 12:13:28 +04:00
|
|
|
return tLAMBEG;
|
|
|
|
}
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
if (IS_ARG() || lex_state == EXPR_END)
|
2006-12-31 18:02:22 +03:00
|
|
|
c = '{'; /* block (primary) */
|
2002-07-26 07:13:06 +04:00
|
|
|
else if (lex_state == EXPR_ENDARG)
|
|
|
|
c = tLBRACE_ARG; /* block (expr) */
|
|
|
|
else
|
|
|
|
c = tLBRACE; /* hash */
|
2001-05-30 13:12:34 +04:00
|
|
|
COND_PUSH(0);
|
|
|
|
CMDARG_PUSH(0);
|
1998-01-16 15:13:05 +03:00
|
|
|
lex_state = EXPR_BEG;
|
2009-09-14 11:39:16 +04:00
|
|
|
if (c != tLBRACE) command_start = TRUE;
|
1998-01-16 15:13:05 +03:00
|
|
|
return c;
|
|
|
|
|
|
|
|
case '\\':
|
|
|
|
c = nextc();
|
|
|
|
if (c == '\n') {
|
|
|
|
space_seen = 1;
|
2004-09-20 07:03:12 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
ripper_dispatch_scan_event(parser, tSP);
|
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
goto retry; /* skip \\n */
|
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
return '\\';
|
|
|
|
|
|
|
|
case '%':
|
2004-03-20 19:45:41 +03:00
|
|
|
if (IS_BEG()) {
|
1998-01-16 15:13:05 +03:00
|
|
|
int term;
|
1999-01-20 07:59:39 +03:00
|
|
|
int paren;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
c = nextc();
|
|
|
|
quotation:
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c == -1 || !ISALNUM(c)) {
|
1998-01-16 15:13:05 +03:00
|
|
|
term = c;
|
1999-01-20 07:59:39 +03:00
|
|
|
c = 'Q';
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
term = nextc();
|
2007-12-08 05:50:43 +03:00
|
|
|
if (rb_enc_isalnum(term, parser->enc) || !parser_isascii()) {
|
2001-10-15 19:15:45 +04:00
|
|
|
yyerror("unknown type of %string");
|
|
|
|
return 0;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (c == -1 || term == -1) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "unterminated quoted string meets end of file");
|
1998-01-16 15:13:05 +03:00
|
|
|
return 0;
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
paren = term;
|
1998-01-16 15:13:05 +03:00
|
|
|
if (term == '(') term = ')';
|
|
|
|
else if (term == '[') term = ']';
|
|
|
|
else if (term == '{') term = '}';
|
|
|
|
else if (term == '<') term = '>';
|
1999-08-13 09:45:20 +04:00
|
|
|
else paren = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
case 'Q':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_dquote, term, paren);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case 'q':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_squote, term, paren);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tSTRING_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2002-06-26 12:01:00 +04:00
|
|
|
case 'W':
|
2006-10-17 19:56:28 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_dword, term, paren);
|
2002-06-26 12:01:00 +04:00
|
|
|
do {c = nextc();} while (ISSPACE(c));
|
|
|
|
pushback(c);
|
|
|
|
return tWORDS_BEG;
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
case 'w':
|
2006-10-17 19:56:28 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_sword, term, paren);
|
2002-06-26 12:01:00 +04:00
|
|
|
do {c = nextc();} while (ISSPACE(c));
|
|
|
|
pushback(c);
|
|
|
|
return tQWORDS_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case 'x':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_xquote, term, paren);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tXSTRING_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case 'r':
|
2002-06-26 12:01:00 +04:00
|
|
|
lex_strterm = NEW_STRTERM(str_regexp, term, paren);
|
2002-06-24 11:20:42 +04:00
|
|
|
return tREGEXP_BEG;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-10-23 14:17:30 +04:00
|
|
|
case 's':
|
|
|
|
lex_strterm = NEW_STRTERM(str_ssym, term, paren);
|
|
|
|
lex_state = EXPR_FNAME;
|
|
|
|
return tSYMBEG;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
default:
|
1999-01-20 07:59:39 +03:00
|
|
|
yyerror("unknown type of %string");
|
1998-01-16 15:13:05 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((c = nextc()) == '=') {
|
2006-12-31 18:02:22 +03:00
|
|
|
set_yylval_id('%');
|
2002-06-18 10:29:07 +04:00
|
|
|
lex_state = EXPR_BEG;
|
1999-01-20 07:59:39 +03:00
|
|
|
return tOP_ASGN;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2010-04-18 17:16:30 +04:00
|
|
|
if (IS_SPCARG(c)) {
|
1999-08-13 09:45:20 +04:00
|
|
|
goto quotation;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-02-19 08:39:06 +03:00
|
|
|
switch (lex_state) {
|
|
|
|
case EXPR_FNAME: case EXPR_DOT:
|
|
|
|
lex_state = EXPR_ARG; break;
|
|
|
|
default:
|
|
|
|
lex_state = EXPR_BEG; break;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
|
|
|
return '%';
|
|
|
|
|
|
|
|
case '$':
|
2005-10-22 08:09:24 +04:00
|
|
|
last_state = lex_state;
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
1998-01-16 15:13:05 +03:00
|
|
|
newtok();
|
|
|
|
c = nextc();
|
|
|
|
switch (c) {
|
1998-01-16 15:19:22 +03:00
|
|
|
case '_': /* $_: last read line string */
|
2000-09-15 10:00:30 +04:00
|
|
|
c = nextc();
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (parser_is_identchar()) {
|
2000-09-15 10:00:30 +04:00
|
|
|
tokadd('$');
|
|
|
|
tokadd('_');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pushback(c);
|
|
|
|
c = '_';
|
2000-09-19 11:54:28 +04:00
|
|
|
/* fall through */
|
|
|
|
case '~': /* $~: match-data */
|
1998-01-16 15:13:05 +03:00
|
|
|
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();
|
2009-10-02 15:37:44 +04:00
|
|
|
set_yylval_name(rb_intern(tok()));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tGVAR;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '-':
|
|
|
|
tokadd('$');
|
|
|
|
tokadd(c);
|
|
|
|
c = nextc();
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (parser_is_identchar()) {
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return 0;
|
2005-10-22 08:09:24 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
pushback(c);
|
|
|
|
}
|
|
|
|
gvar:
|
1998-01-16 15:13:05 +03:00
|
|
|
tokfix();
|
2009-10-02 15:37:44 +04:00
|
|
|
set_yylval_name(rb_intern(tok()));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tGVAR;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '&': /* $&: last match */
|
|
|
|
case '`': /* $`: string before last match */
|
|
|
|
case '\'': /* $': string after last match */
|
|
|
|
case '+': /* $+: string matches last paren. */
|
2005-10-22 08:09:24 +04:00
|
|
|
if (last_state == EXPR_FNAME) {
|
|
|
|
tokadd('$');
|
|
|
|
tokadd(c);
|
|
|
|
goto gvar;
|
|
|
|
}
|
2004-10-31 08:22:58 +03:00
|
|
|
set_yylval_node(NEW_BACK_REF(c));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tBACK_REF;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case '1': case '2': case '3':
|
|
|
|
case '4': case '5': case '6':
|
|
|
|
case '7': case '8': case '9':
|
2000-05-09 08:53:16 +04:00
|
|
|
tokadd('$');
|
2002-12-31 01:56:21 +03:00
|
|
|
do {
|
1998-01-16 15:13:05 +03:00
|
|
|
tokadd(c);
|
|
|
|
c = nextc();
|
2008-10-28 15:34:13 +03:00
|
|
|
} while (c != -1 && ISDIGIT(c));
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
2005-10-22 08:09:24 +04:00
|
|
|
if (last_state == EXPR_FNAME) goto gvar;
|
1998-01-16 15:13:05 +03:00
|
|
|
tokfix();
|
2004-10-31 08:22:58 +03:00
|
|
|
set_yylval_node(NEW_NTH_REF(atoi(tok()+1)));
|
1999-01-20 07:59:39 +03:00
|
|
|
return tNTH_REF;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
default:
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!parser_is_identchar()) {
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
|
|
|
return '$';
|
|
|
|
}
|
|
|
|
case '0':
|
|
|
|
tokadd('$');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '@':
|
|
|
|
c = nextc();
|
2000-02-18 09:59:36 +03:00
|
|
|
newtok();
|
|
|
|
tokadd('@');
|
|
|
|
if (c == '@') {
|
|
|
|
tokadd('@');
|
|
|
|
c = nextc();
|
|
|
|
}
|
2008-10-28 15:34:13 +03:00
|
|
|
if (c != -1 && ISDIGIT(c)) {
|
2002-06-13 07:55:44 +04:00
|
|
|
if (tokidx == 1) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "`@%c' is not allowed as an instance variable name", c);
|
2002-06-13 07:55:44 +04:00
|
|
|
}
|
|
|
|
else {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "`@@%c' is not allowed as a class variable name", c);
|
2002-06-13 07:55:44 +04:00
|
|
|
}
|
2007-06-29 19:17:02 +04:00
|
|
|
return 0;
|
2000-07-11 12:27:06 +04:00
|
|
|
}
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!parser_is_identchar()) {
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
|
|
|
return '@';
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-12-30 21:19:08 +03:00
|
|
|
case '_':
|
2002-12-31 01:56:21 +03:00
|
|
|
if (was_bol() && whole_match_p("__END__", 7, 0)) {
|
2002-12-30 21:19:08 +03:00
|
|
|
ruby__end__seen = 1;
|
2007-12-30 07:56:17 +03:00
|
|
|
parser->eofp = Qtrue;
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifndef RIPPER
|
2002-12-30 21:19:08 +03:00
|
|
|
return -1;
|
2004-09-12 19:21:49 +04:00
|
|
|
#else
|
2006-12-31 18:02:22 +03:00
|
|
|
lex_goto_eol(parser);
|
|
|
|
ripper_dispatch_scan_event(parser, k__END__);
|
|
|
|
return 0;
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif
|
2002-12-30 21:19:08 +03:00
|
|
|
}
|
|
|
|
newtok();
|
|
|
|
break;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
default:
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!parser_is_identchar()) {
|
2007-12-12 17:30:54 +03:00
|
|
|
rb_compile_error(PARSER_ARG "Invalid char `\\x%02X' in expression", c);
|
1998-01-16 15:13:05 +03:00
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
|
|
|
|
newtok();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-11-27 05:21:17 +03:00
|
|
|
mb = ENC_CODERANGE_7BIT;
|
2002-12-31 01:56:21 +03:00
|
|
|
do {
|
2007-10-24 12:09:40 +04:00
|
|
|
if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
|
2007-12-02 09:47:59 +03:00
|
|
|
if (tokadd_mbchar(c) == -1) return 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
c = nextc();
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
} while (parser_is_identchar());
|
2008-05-08 10:59:38 +04:00
|
|
|
switch (tok()[0]) {
|
|
|
|
case '@': case '$':
|
1998-01-16 15:13:05 +03:00
|
|
|
pushback(c);
|
2008-05-08 10:59:38 +04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if ((c == '!' || c == '?') && !peek('=')) {
|
|
|
|
tokadd(c);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pushback(c);
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
tokfix();
|
|
|
|
|
|
|
|
{
|
2000-01-17 11:37:53 +03:00
|
|
|
int result = 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-10-22 08:09:24 +04:00
|
|
|
last_state = lex_state;
|
1998-01-16 15:13:05 +03:00
|
|
|
switch (tok()[0]) {
|
|
|
|
case '$':
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
1999-01-20 07:59:39 +03:00
|
|
|
result = tGVAR;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
case '@':
|
2008-09-06 20:09:43 +04:00
|
|
|
lex_state = EXPR_END;
|
2000-02-18 09:59:36 +03:00
|
|
|
if (tok()[1] == '@')
|
2000-03-23 11:37:35 +03:00
|
|
|
result = tCVAR;
|
2000-02-18 09:59:36 +03:00
|
|
|
else
|
|
|
|
result = tIVAR;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
2001-09-05 10:54:57 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
default:
|
2001-09-05 10:54:57 +04:00
|
|
|
if (toklast() == '!' || toklast() == '?') {
|
|
|
|
result = tFID;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (lex_state == EXPR_FNAME) {
|
|
|
|
if ((c = nextc()) == '=' && !peek('~') && !peek('>') &&
|
2002-09-23 19:48:42 +04:00
|
|
|
(!peek('=') || (lex_p + 1 < lex_pend && lex_p[1] == '>'))) {
|
2001-09-05 10:54:57 +04:00
|
|
|
result = tIDENTIFIER;
|
|
|
|
tokadd(c);
|
2003-05-21 20:01:49 +04:00
|
|
|
tokfix();
|
2001-09-05 10:54:57 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
pushback(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (result == 0 && ISUPPER(tok()[0])) {
|
|
|
|
result = tCONSTANT;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
result = tIDENTIFIER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-14 04:36:52 +04:00
|
|
|
if ((lex_state == EXPR_BEG && !cmd_state) ||
|
|
|
|
lex_state == EXPR_ARG ||
|
|
|
|
lex_state == EXPR_CMDARG) {
|
|
|
|
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
nextc();
|
2009-10-02 15:37:44 +04:00
|
|
|
set_yylval_name(TOK_INTERN(!ENC_SINGLE(mb)));
|
2008-10-14 04:36:52 +04:00
|
|
|
return tLABEL;
|
|
|
|
}
|
|
|
|
}
|
2007-11-27 05:21:17 +03:00
|
|
|
if (mb == ENC_CODERANGE_7BIT && lex_state != EXPR_DOT) {
|
2005-07-13 17:44:21 +04:00
|
|
|
const struct kwtable *kw;
|
2001-09-05 10:54:57 +04:00
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
/* See if it is a reserved word. */
|
|
|
|
kw = rb_reserved_word(tok(), toklen());
|
|
|
|
if (kw) {
|
2004-09-12 19:21:49 +04:00
|
|
|
enum lex_state_e state = lex_state;
|
1999-08-13 09:45:20 +04:00
|
|
|
lex_state = kw->state;
|
|
|
|
if (state == EXPR_FNAME) {
|
2009-10-02 15:37:44 +04:00
|
|
|
set_yylval_name(rb_intern(kw->name));
|
2006-06-17 18:50:04 +04:00
|
|
|
return kw->id[0];
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
if (kw->id[0] == keyword_do) {
|
2009-09-14 11:39:16 +04:00
|
|
|
command_start = TRUE;
|
2005-08-12 12:13:28 +04:00
|
|
|
if (lpar_beg && lpar_beg == paren_nest) {
|
2005-08-16 19:24:15 +04:00
|
|
|
lpar_beg = 0;
|
|
|
|
--paren_nest;
|
2006-06-26 18:15:49 +04:00
|
|
|
return keyword_do_LAMBDA;
|
2005-08-12 12:13:28 +04:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
if (COND_P()) return keyword_do_cond;
|
2003-01-31 07:00:17 +03:00
|
|
|
if (CMDARG_P() && state != EXPR_CMDARG)
|
2006-06-26 18:15:49 +04:00
|
|
|
return keyword_do_block;
|
2005-03-02 06:21:31 +03:00
|
|
|
if (state == EXPR_ENDARG || state == EXPR_BEG)
|
2006-06-26 18:15:49 +04:00
|
|
|
return keyword_do_block;
|
|
|
|
return keyword_do;
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2005-02-08 16:39:47 +03:00
|
|
|
if (state == EXPR_BEG || state == EXPR_VALUE)
|
2001-05-02 08:22:21 +04:00
|
|
|
return kw->id[0];
|
|
|
|
else {
|
|
|
|
if (kw->id[0] != kw->id[1])
|
|
|
|
lex_state = EXPR_BEG;
|
|
|
|
return kw->id[1];
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2004-03-20 19:45:41 +03:00
|
|
|
if (IS_BEG() ||
|
|
|
|
lex_state == EXPR_DOT ||
|
|
|
|
IS_ARG()) {
|
2003-01-31 07:00:17 +03:00
|
|
|
if (cmd_state) {
|
|
|
|
lex_state = EXPR_CMDARG;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
lex_state = EXPR_ARG;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
lex_state = EXPR_END;
|
|
|
|
}
|
|
|
|
}
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
2007-10-03 11:58:50 +04:00
|
|
|
ID ident = TOK_INTERN(!ENC_SINGLE(mb));
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
set_yylval_name(ident);
|
2006-12-31 18:02:22 +03:00
|
|
|
if (last_state != EXPR_DOT && is_local_id(ident) && lvar_defined(ident)) {
|
|
|
|
lex_state = EXPR_END;
|
|
|
|
}
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
#if YYPURE
|
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
yylex(void *lval, void *p)
|
2004-09-17 13:24:13 +04:00
|
|
|
#else
|
2005-09-26 16:01:29 +04:00
|
|
|
yylex(void *p)
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif
|
|
|
|
{
|
|
|
|
struct parser_params *parser = (struct parser_params*)p;
|
|
|
|
int t;
|
|
|
|
|
|
|
|
#if YYPURE
|
2008-08-14 12:46:23 +04:00
|
|
|
parser->parser_yylval = lval;
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_yylval->val = Qundef;
|
|
|
|
#endif
|
|
|
|
t = parser_yylex(parser);
|
|
|
|
#ifdef RIPPER
|
2004-09-20 11:59:30 +04:00
|
|
|
if (!NIL_P(parser->delayed)) {
|
|
|
|
ripper_dispatch_delayed_token(parser, t);
|
|
|
|
}
|
2004-09-20 09:51:13 +04:00
|
|
|
if (t != 0)
|
2004-09-20 07:03:12 +04:00
|
|
|
ripper_dispatch_scan_event(parser, t);
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif
|
2004-09-20 07:03:12 +04:00
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifndef RIPPER
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
static NODE*
|
|
|
|
node_newnode(struct parser_params *parser, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
NODE *n = (rb_node_newnode)(type, a0, a1, a2);
|
1999-01-20 07:59:39 +03:00
|
|
|
nd_set_line(n, ruby_sourceline);
|
1998-01-16 15:13:05 +03:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
enum node_type
|
2005-09-26 16:01:29 +04:00
|
|
|
nodetype(NODE *node) /* for debug */
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
return (enum node_type)nd_type(node);
|
|
|
|
}
|
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
nodeline(NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
return nd_line(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
newline_node(NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-11-18 06:45:23 +03:00
|
|
|
if (node) {
|
2007-11-30 21:34:34 +03:00
|
|
|
node = remove_begin(node);
|
2008-02-18 08:33:01 +03:00
|
|
|
node->flags |= NODE_FL_NEWLINE;
|
2004-11-18 06:45:23 +03:00
|
|
|
}
|
2004-01-21 19:47:23 +03:00
|
|
|
return node;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
fixpos(NODE *node, NODE *orig)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
if (!node) return;
|
|
|
|
if (!orig) return;
|
2002-01-18 17:24:01 +03:00
|
|
|
if (orig == (NODE*)1) return;
|
1998-01-16 15:13:05 +03:00
|
|
|
nd_set_line(node, nd_line(orig));
|
|
|
|
}
|
|
|
|
|
2003-04-21 12:44:38 +04:00
|
|
|
static void
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
parser_warning(struct parser_params *parser, NODE *node, const char *mesg)
|
2003-04-21 12:44:38 +04:00
|
|
|
{
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
rb_compile_warning(ruby_sourcefile, nd_line(node), "%s", mesg);
|
2003-04-21 12:44:38 +04:00
|
|
|
}
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
#define parser_warning(node, mesg) parser_warning(parser, node, mesg)
|
2003-04-21 12:44:38 +04:00
|
|
|
|
|
|
|
static void
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
parser_warn(struct parser_params *parser, NODE *node, const char *mesg)
|
2003-04-21 12:44:38 +04:00
|
|
|
{
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
rb_compile_warn(ruby_sourcefile, nd_line(node), "%s", mesg);
|
2003-04-21 12:44:38 +04:00
|
|
|
}
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
#define parser_warn(node, mesg) parser_warn(parser, node, mesg)
|
2003-04-21 12:44:38 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
block_append_gen(struct parser_params *parser, NODE *head, NODE *tail)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-02-03 05:23:20 +03:00
|
|
|
NODE *end, *h = head, *nd;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
if (tail == 0) return head;
|
|
|
|
|
2002-09-20 18:03:45 +04:00
|
|
|
if (h == 0) return tail;
|
|
|
|
switch (nd_type(h)) {
|
|
|
|
case NODE_LIT:
|
|
|
|
case NODE_STR:
|
2004-10-02 15:34:13 +04:00
|
|
|
case NODE_SELF:
|
|
|
|
case NODE_TRUE:
|
|
|
|
case NODE_FALSE:
|
|
|
|
case NODE_NIL:
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warning(h, "unused literal ignored");
|
2002-09-20 18:03:45 +04:00
|
|
|
return tail;
|
|
|
|
default:
|
2004-01-21 19:47:23 +03:00
|
|
|
h = end = NEW_BLOCK(head);
|
1998-01-16 15:13:05 +03:00
|
|
|
end->nd_end = end;
|
|
|
|
fixpos(end, head);
|
|
|
|
head = end;
|
2002-09-20 18:03:45 +04:00
|
|
|
break;
|
|
|
|
case NODE_BLOCK:
|
|
|
|
end = h->nd_end;
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2004-02-03 05:23:20 +03:00
|
|
|
nd = end->nd_head;
|
|
|
|
switch (nd_type(nd)) {
|
|
|
|
case NODE_RETURN:
|
|
|
|
case NODE_BREAK:
|
|
|
|
case NODE_NEXT:
|
|
|
|
case NODE_REDO:
|
|
|
|
case NODE_RETRY:
|
|
|
|
if (RTEST(ruby_verbose)) {
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warning(nd, "statement not reached");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2004-02-03 05:23:20 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (nd_type(tail) != NODE_BLOCK) {
|
|
|
|
tail = NEW_BLOCK(tail);
|
|
|
|
tail->nd_end = tail;
|
|
|
|
}
|
|
|
|
end->nd_next = tail;
|
2004-01-21 19:47:23 +03:00
|
|
|
h->nd_end = tail->nd_end;
|
1998-01-16 15:13:05 +03:00
|
|
|
return head;
|
|
|
|
}
|
|
|
|
|
2002-07-26 10:12:39 +04:00
|
|
|
/* append item to the list */
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
NODE *last;
|
|
|
|
|
2002-07-26 10:12:39 +04:00
|
|
|
if (list == 0) return NEW_LIST(item);
|
2003-01-14 10:45:19 +03:00
|
|
|
if (list->nd_next) {
|
|
|
|
last = list->nd_next->nd_end;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
last = list;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2002-07-26 10:12:39 +04:00
|
|
|
list->nd_alen += 1;
|
2003-01-14 10:45:19 +03:00
|
|
|
last->nd_next = NEW_LIST(item);
|
|
|
|
list->nd_next->nd_end = last->nd_next;
|
2002-07-26 10:12:39 +04:00
|
|
|
return list;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2002-07-26 10:12:39 +04:00
|
|
|
/* concat two lists */
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
list_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
NODE *last;
|
|
|
|
|
2003-01-14 10:45:19 +03:00
|
|
|
if (head->nd_next) {
|
|
|
|
last = head->nd_next->nd_end;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
last = head;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
head->nd_alen += tail->nd_alen;
|
2003-01-14 10:45:19 +03:00
|
|
|
last->nd_next = tail;
|
|
|
|
if (tail->nd_next) {
|
|
|
|
head->nd_next->nd_end = tail->nd_next->nd_end;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
head->nd_next->nd_end = tail;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
return head;
|
|
|
|
}
|
|
|
|
|
2008-03-18 10:24:55 +03:00
|
|
|
static int
|
2007-11-08 01:55:27 +03:00
|
|
|
literal_concat0(struct parser_params *parser, VALUE head, VALUE tail)
|
|
|
|
{
|
2009-08-02 16:04:43 +04:00
|
|
|
if (NIL_P(tail)) return 1;
|
2007-11-08 01:55:27 +03:00
|
|
|
if (!rb_enc_compatible(head, tail)) {
|
|
|
|
compile_error(PARSER_ARG "string literal encodings differ (%s / %s)",
|
|
|
|
rb_enc_name(rb_enc_get(head)),
|
|
|
|
rb_enc_name(rb_enc_get(tail)));
|
2008-03-18 10:24:55 +03:00
|
|
|
rb_str_resize(head, 0);
|
|
|
|
rb_str_resize(tail, 0);
|
|
|
|
return 0;
|
2007-11-08 01:55:27 +03:00
|
|
|
}
|
|
|
|
rb_str_buf_append(head, tail);
|
2008-03-18 10:24:55 +03:00
|
|
|
return 1;
|
2007-11-08 01:55:27 +03:00
|
|
|
}
|
|
|
|
|
2002-09-20 18:03:45 +04:00
|
|
|
/* concat two string literals */
|
2002-06-24 11:20:42 +04:00
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
2002-09-20 18:03:45 +04:00
|
|
|
enum node_type htype;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
|
|
|
if (!head) return tail;
|
|
|
|
if (!tail) return head;
|
|
|
|
|
2002-09-20 18:03:45 +04:00
|
|
|
htype = nd_type(head);
|
|
|
|
if (htype == NODE_EVSTR) {
|
2009-07-20 14:01:05 +04:00
|
|
|
NODE *node = NEW_DSTR(Qnil);
|
2003-01-14 10:45:19 +03:00
|
|
|
head = list_append(node, head);
|
2002-09-20 18:03:45 +04:00
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
switch (nd_type(tail)) {
|
|
|
|
case NODE_STR:
|
2002-09-20 18:03:45 +04:00
|
|
|
if (htype == NODE_STR) {
|
2008-03-18 10:24:55 +03:00
|
|
|
if (!literal_concat0(parser, head->nd_lit, tail->nd_lit)) {
|
|
|
|
error:
|
|
|
|
rb_gc_force_recycle((VALUE)head);
|
|
|
|
rb_gc_force_recycle((VALUE)tail);
|
|
|
|
return 0;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
rb_gc_force_recycle((VALUE)tail);
|
|
|
|
}
|
2002-09-20 18:03:45 +04:00
|
|
|
else {
|
|
|
|
list_append(head, tail);
|
|
|
|
}
|
2002-09-23 19:48:42 +04:00
|
|
|
break;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
2002-09-20 18:03:45 +04:00
|
|
|
case NODE_DSTR:
|
|
|
|
if (htype == NODE_STR) {
|
2008-03-18 10:24:55 +03:00
|
|
|
if (!literal_concat0(parser, head->nd_lit, tail->nd_lit))
|
|
|
|
goto error;
|
2002-09-20 18:03:45 +04:00
|
|
|
tail->nd_lit = head->nd_lit;
|
|
|
|
rb_gc_force_recycle((VALUE)head);
|
|
|
|
head = tail;
|
|
|
|
}
|
2009-07-31 05:54:14 +04:00
|
|
|
else if (NIL_P(tail->nd_lit)) {
|
2009-09-03 12:57:28 +04:00
|
|
|
head->nd_alen += tail->nd_alen - 1;
|
|
|
|
head->nd_next->nd_end->nd_next = tail->nd_next;
|
|
|
|
head->nd_next->nd_end = tail->nd_next->nd_end;
|
2009-07-31 05:54:14 +04:00
|
|
|
rb_gc_force_recycle((VALUE)tail);
|
|
|
|
}
|
2002-09-20 18:03:45 +04:00
|
|
|
else {
|
2009-07-31 05:54:14 +04:00
|
|
|
nd_set_type(tail, NODE_ARRAY);
|
|
|
|
tail->nd_head = NEW_STR(tail->nd_lit);
|
|
|
|
list_concat(head, tail);
|
2002-09-20 18:03:45 +04:00
|
|
|
}
|
2002-09-23 19:48:42 +04:00
|
|
|
break;
|
2002-09-20 18:03:45 +04:00
|
|
|
|
|
|
|
case NODE_EVSTR:
|
|
|
|
if (htype == NODE_STR) {
|
|
|
|
nd_set_type(head, NODE_DSTR);
|
2004-05-18 09:00:58 +04:00
|
|
|
head->nd_alen = 1;
|
2002-09-20 18:03:45 +04:00
|
|
|
}
|
|
|
|
list_append(head, tail);
|
2002-09-23 19:48:42 +04:00
|
|
|
break;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-09-23 19:48:42 +04:00
|
|
|
return head;
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
|
2003-05-21 20:01:49 +04:00
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
evstr2dstr_gen(struct parser_params *parser, NODE *node)
|
2003-05-21 20:01:49 +04:00
|
|
|
{
|
|
|
|
if (nd_type(node) == NODE_EVSTR) {
|
2009-07-20 14:01:05 +04:00
|
|
|
node = list_append(NEW_DSTR(Qnil), node);
|
2003-05-21 20:01:49 +04:00
|
|
|
}
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2002-06-24 11:20:42 +04:00
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
new_evstr_gen(struct parser_params *parser, NODE *node)
|
2002-06-24 11:20:42 +04:00
|
|
|
{
|
2002-09-23 19:48:42 +04:00
|
|
|
NODE *head = node;
|
2002-06-24 11:20:42 +04:00
|
|
|
|
2002-09-20 18:03:45 +04:00
|
|
|
if (node) {
|
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_STR: case NODE_DSTR: case NODE_EVSTR:
|
|
|
|
return node;
|
|
|
|
}
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
2002-09-23 19:48:42 +04:00
|
|
|
return NEW_EVSTR(head);
|
2002-06-24 11:20:42 +04:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE *
|
2007-08-09 11:04:56 +04:00
|
|
|
call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2007-08-09 11:04:56 +04:00
|
|
|
value_expr(recv);
|
2004-09-17 13:24:13 +04:00
|
|
|
value_expr(arg1);
|
2007-08-09 11:04:56 +04:00
|
|
|
return NEW_CALL(recv, id, NEW_LIST(arg1));
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE *
|
|
|
|
call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id)
|
|
|
|
{
|
|
|
|
value_expr(recv);
|
|
|
|
return NEW_CALL(recv, id, 0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:19:22 +03:00
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
|
1998-01-16 15:19:22 +03:00
|
|
|
{
|
2002-06-12 13:22:20 +04:00
|
|
|
value_expr(node1);
|
|
|
|
value_expr(node2);
|
|
|
|
if (node1) {
|
|
|
|
switch (nd_type(node1)) {
|
|
|
|
case NODE_DREGX:
|
|
|
|
case NODE_DREGX_ONCE:
|
1998-01-16 15:19:22 +03:00
|
|
|
return NEW_MATCH2(node1, node2);
|
2002-06-12 13:22:20 +04:00
|
|
|
|
|
|
|
case NODE_LIT:
|
|
|
|
if (TYPE(node1->nd_lit) == T_REGEXP) {
|
|
|
|
return NEW_MATCH2(node1, node2);
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-06-12 13:22:20 +04:00
|
|
|
if (node2) {
|
|
|
|
switch (nd_type(node2)) {
|
|
|
|
case NODE_DREGX:
|
|
|
|
case NODE_DREGX_ONCE:
|
1998-01-16 15:19:22 +03:00
|
|
|
return NEW_MATCH3(node2, node1);
|
2002-06-12 13:22:20 +04:00
|
|
|
|
|
|
|
case NODE_LIT:
|
|
|
|
if (TYPE(node2->nd_lit) == T_REGEXP) {
|
|
|
|
return NEW_MATCH3(node2, node1);
|
|
|
|
}
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
return NEW_CALL(node1, tMATCH, NEW_LIST(node2));
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
gettable_gen(struct parser_params *parser, ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2006-06-26 18:15:49 +04:00
|
|
|
if (id == keyword_self) {
|
1998-01-16 15:13:05 +03:00
|
|
|
return NEW_SELF();
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_nil) {
|
1998-01-16 15:13:05 +03:00
|
|
|
return NEW_NIL();
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_true) {
|
1998-01-16 15:19:22 +03:00
|
|
|
return NEW_TRUE();
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_false) {
|
1998-01-16 15:19:22 +03:00
|
|
|
return NEW_FALSE();
|
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword__FILE__) {
|
2008-12-23 18:13:18 +03:00
|
|
|
return NEW_STR(rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile),
|
|
|
|
rb_filesystem_encoding()));
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword__LINE__) {
|
1999-01-20 07:59:39 +03:00
|
|
|
return NEW_LIT(INT2FIX(ruby_sourceline));
|
|
|
|
}
|
2007-12-21 06:22:22 +03:00
|
|
|
else if (id == keyword__ENCODING__) {
|
|
|
|
return NEW_LIT(rb_enc_from_encoding(parser->enc));
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
else if (is_local_id(id)) {
|
2006-12-31 18:02:22 +03:00
|
|
|
if (dyna_in_block() && dvar_defined(id)) return NEW_DVAR(id);
|
1998-01-16 15:13:05 +03:00
|
|
|
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);
|
|
|
|
}
|
1999-12-14 09:50:43 +03:00
|
|
|
else if (is_const_id(id)) {
|
2000-03-23 11:37:35 +03:00
|
|
|
return NEW_CONST(id);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-03-23 11:37:35 +03:00
|
|
|
else if (is_class_id(id)) {
|
2000-08-29 06:52:41 +04:00
|
|
|
return NEW_CVAR(id);
|
2000-02-18 09:59:36 +03:00
|
|
|
}
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "identifier %s is not valid to get", rb_id2name(id));
|
1998-01-16 15:13:05 +03:00
|
|
|
return 0;
|
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif /* !RIPPER */
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
static VALUE
|
|
|
|
assignable_gen(struct parser_params *parser, VALUE lhs)
|
|
|
|
#else
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
assignable_gen(struct parser_params *parser, ID id, NODE *val)
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
ID id = get_id(lhs);
|
2009-10-02 21:59:25 +04:00
|
|
|
# define assignable_result(x) get_value(lhs)
|
2009-10-02 23:34:28 +04:00
|
|
|
# define parser_yyerror(parser, x) dispatch1(assign_error, lhs)
|
2009-10-02 15:37:44 +04:00
|
|
|
#else
|
2009-10-02 21:59:25 +04:00
|
|
|
# define assignable_result(x) x
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif
|
2009-10-02 21:59:25 +04:00
|
|
|
if (!id) return assignable_result(0);
|
2006-06-26 18:15:49 +04:00
|
|
|
if (id == keyword_self) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't change the value of self");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_nil) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to nil");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_true) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to true");
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword_false) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to false");
|
1998-01-16 15:19:22 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword__FILE__) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to __FILE__");
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2006-06-26 18:15:49 +04:00
|
|
|
else if (id == keyword__LINE__) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to __LINE__");
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
2008-01-26 17:42:17 +03:00
|
|
|
else if (id == keyword__ENCODING__) {
|
2009-10-02 21:59:25 +04:00
|
|
|
yyerror("Can't assign to __ENCODING__");
|
2008-01-26 17:42:17 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
else if (is_local_id(id)) {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
if (dyna_in_block()) {
|
|
|
|
if (dvar_curr(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_DASGN_CURR(id, val));
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
}
|
|
|
|
else if (dvar_defined(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_DASGN(id, val));
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
}
|
|
|
|
else if (local_id(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_LASGN(id, val));
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
else {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
dyna_var(id);
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_DASGN_CURR(id, val));
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
else {
|
|
|
|
if (!local_id(id)) {
|
|
|
|
local_var(id);
|
|
|
|
}
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_LASGN(id, val));
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (is_global_id(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_GASGN(id, val));
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
else if (is_instance_id(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_IASGN(id, val));
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-12-14 09:50:43 +03:00
|
|
|
else if (is_const_id(id)) {
|
2009-10-02 15:37:44 +04:00
|
|
|
if (!in_def && !in_single)
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_CDECL(id, val, 0));
|
|
|
|
yyerror("dynamic constant assignment");
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-03-23 11:37:35 +03:00
|
|
|
else if (is_class_id(id)) {
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(NEW_CVASGN(id, val));
|
2000-02-18 09:59:36 +03:00
|
|
|
}
|
2008-05-19 20:14:30 +04:00
|
|
|
else {
|
|
|
|
compile_error(PARSER_ARG "identifier %s is not valid to set", rb_id2name(id));
|
|
|
|
}
|
2009-10-02 21:59:25 +04:00
|
|
|
return assignable_result(0);
|
|
|
|
#undef assignable_result
|
|
|
|
#undef parser_yyerror
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
static ID
|
2005-09-26 16:01:29 +04:00
|
|
|
shadowing_lvar_gen(struct parser_params *parser, ID name)
|
2005-08-10 05:39:24 +04:00
|
|
|
{
|
2008-06-09 13:25:32 +04:00
|
|
|
ID uscore;
|
2007-12-10 19:22:52 +03:00
|
|
|
|
2008-06-09 13:25:32 +04:00
|
|
|
CONST_ID(uscore, "_");
|
2009-10-02 15:37:44 +04:00
|
|
|
if (uscore == name) return name;
|
2007-12-10 19:22:52 +03:00
|
|
|
if (dyna_in_block()) {
|
|
|
|
if (dvar_curr(name)) {
|
|
|
|
yyerror("duplicated argument name");
|
|
|
|
}
|
|
|
|
else if (dvar_defined(name) || local_id(name)) {
|
|
|
|
rb_warningS("shadowing outer local variable - %s", rb_id2name(name));
|
|
|
|
vtable_add(lvtbl->vars, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (local_id(name)) {
|
|
|
|
yyerror("duplicated argument name");
|
|
|
|
}
|
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
return name;
|
2005-08-10 05:39:24 +04:00
|
|
|
}
|
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
static void
|
|
|
|
new_bv_gen(struct parser_params *parser, ID name)
|
2005-03-09 12:29:52 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
if (!name) return;
|
2005-07-28 06:33:28 +04:00
|
|
|
if (!is_local_id(name)) {
|
|
|
|
compile_error(PARSER_ARG "invalid local variable - %s",
|
2005-03-09 12:29:52 +03:00
|
|
|
rb_id2name(name));
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
return;
|
2005-03-09 12:29:52 +03:00
|
|
|
}
|
2005-08-10 05:39:24 +04:00
|
|
|
shadowing_lvar(name);
|
2005-07-28 06:33:28 +04:00
|
|
|
dyna_var(name);
|
2005-03-09 12:29:52 +03:00
|
|
|
}
|
2005-07-28 06:33:28 +04:00
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
1998-01-16 15:19:22 +03:00
|
|
|
static NODE *
|
2005-09-26 16:01:29 +04:00
|
|
|
aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2003-02-20 06:35:44 +03:00
|
|
|
if (recv && nd_type(recv) == NODE_SELF)
|
|
|
|
recv = (NODE *)1;
|
2002-12-19 12:20:20 +03:00
|
|
|
return NEW_ATTRASGN(recv, tASET, idx);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2005-06-12 20:56:06 +04:00
|
|
|
static void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
|
2005-06-12 20:56:06 +04:00
|
|
|
{
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
if (node2 && node1 && nd_type(node1) == NODE_BLOCK_PASS) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "both block arg and actual block given");
|
2005-06-12 20:56:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
ID
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_id_attrset(ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
id &= ~ID_SCOPE_MASK;
|
|
|
|
id |= ID_ATTRSET;
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE *
|
2005-09-26 16:01:29 +04:00
|
|
|
attrset_gen(struct parser_params *parser, NODE *recv, ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2003-02-20 06:35:44 +03:00
|
|
|
if (recv && nd_type(recv) == NODE_SELF)
|
|
|
|
recv = (NODE *)1;
|
2002-12-17 13:34:30 +03:00
|
|
|
return NEW_ATTRASGN(recv, rb_id_attrset(id), 0);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_backref_error_gen(struct parser_params *parser, NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_NTH_REF:
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "Can't set variable $%ld", node->nd_nth);
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
case NODE_BACK_REF:
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "Can't set variable $%c", (int)node->nd_nth);
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2)
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2000-01-17 11:37:53 +03:00
|
|
|
if (!node2) return node1;
|
2008-02-12 19:26:47 +03:00
|
|
|
switch (nd_type(node1)) {
|
|
|
|
case NODE_BLOCK_PASS:
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
node1->nd_iter = arg_concat(node1->nd_iter, node2);
|
|
|
|
return node1;
|
2008-02-12 19:26:47 +03:00
|
|
|
case NODE_ARGSPUSH:
|
|
|
|
if (nd_type(node2) != NODE_ARRAY) break;
|
|
|
|
node1->nd_body = list_concat(NEW_LIST(node1->nd_body), node2);
|
|
|
|
nd_set_type(node1, NODE_ARGSCAT);
|
|
|
|
return node1;
|
|
|
|
case NODE_ARGSCAT:
|
2008-10-22 00:45:35 +04:00
|
|
|
if (nd_type(node2) != NODE_ARRAY ||
|
|
|
|
nd_type(node1->nd_body) != NODE_ARRAY) break;
|
2008-02-12 19:26:47 +03:00
|
|
|
node1->nd_body = list_concat(node1->nd_body, node2);
|
|
|
|
return node1;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
return NEW_ARGSCAT(node1, node2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
arg_append_gen(struct parser_params *parser, NODE *node1, NODE *node2)
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
|
|
|
if (!node1) return NEW_LIST(node2);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
switch (nd_type(node1)) {
|
|
|
|
case NODE_ARRAY:
|
1999-08-13 09:45:20 +04:00
|
|
|
return list_append(node1, node2);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
case NODE_BLOCK_PASS:
|
|
|
|
node1->nd_head = arg_append(node1->nd_head, node2);
|
|
|
|
return node1;
|
2008-02-12 19:26:47 +03:00
|
|
|
case NODE_ARGSPUSH:
|
|
|
|
node1->nd_body = list_append(NEW_LIST(node1->nd_body), node2);
|
|
|
|
nd_set_type(node1, NODE_ARGSCAT);
|
|
|
|
return node1;
|
1999-08-13 09:45:20 +04:00
|
|
|
}
|
2008-02-12 19:26:47 +03:00
|
|
|
return NEW_ARGSPUSH(node1, node2);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
}
|
|
|
|
|
2008-02-12 10:18:49 +03:00
|
|
|
static NODE *
|
|
|
|
splat_array(NODE* node)
|
|
|
|
{
|
|
|
|
if (nd_type(node) == NODE_SPLAT) node = node->nd_head;
|
|
|
|
if (nd_type(node) == NODE_ARRAY) return node;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-08-09 11:04:56 +04:00
|
|
|
static NODE *
|
2005-09-26 16:01:29 +04:00
|
|
|
node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
|
|
|
if (!lhs) return 0;
|
|
|
|
|
|
|
|
switch (nd_type(lhs)) {
|
|
|
|
case NODE_GASGN:
|
|
|
|
case NODE_IASGN:
|
2007-02-04 22:17:33 +03:00
|
|
|
case NODE_IASGN2:
|
1999-08-13 09:45:20 +04:00
|
|
|
case NODE_LASGN:
|
|
|
|
case NODE_DASGN:
|
2000-02-01 06:12:21 +03:00
|
|
|
case NODE_DASGN_CURR:
|
1999-08-13 09:45:20 +04:00
|
|
|
case NODE_MASGN:
|
1999-11-17 10:30:37 +03:00
|
|
|
case NODE_CDECL:
|
2000-11-21 17:26:25 +03:00
|
|
|
case NODE_CVASGN:
|
1999-08-13 09:45:20 +04:00
|
|
|
lhs->nd_value = rhs;
|
|
|
|
break;
|
|
|
|
|
2002-12-17 13:34:30 +03:00
|
|
|
case NODE_ATTRASGN:
|
1999-08-13 09:45:20 +04:00
|
|
|
case NODE_CALL:
|
2008-02-12 19:23:02 +03:00
|
|
|
lhs->nd_args = arg_append(lhs->nd_args, rhs);
|
1999-08-13 09:45:20 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* should not happen */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return lhs;
|
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
value_expr_gen(struct parser_params *parser, NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2008-01-27 16:55:29 +03:00
|
|
|
int cond = 0;
|
|
|
|
|
2007-07-23 13:13:44 +04:00
|
|
|
if (!node) {
|
|
|
|
rb_warning0("empty expression");
|
|
|
|
}
|
2002-06-18 07:53:23 +04:00
|
|
|
while (node) {
|
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_DEFN:
|
|
|
|
case NODE_DEFS:
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warning(node, "void value expression");
|
2009-09-14 11:39:16 +04:00
|
|
|
return FALSE;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
case NODE_RETURN:
|
|
|
|
case NODE_BREAK:
|
|
|
|
case NODE_NEXT:
|
|
|
|
case NODE_REDO:
|
|
|
|
case NODE_RETRY:
|
2008-01-27 16:55:29 +03:00
|
|
|
if (!cond) yyerror("void value expression");
|
2002-06-18 07:53:23 +04:00
|
|
|
/* or "control never reach"? */
|
2009-09-14 11:39:16 +04:00
|
|
|
return FALSE;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
case NODE_BLOCK:
|
|
|
|
while (node->nd_next) {
|
|
|
|
node = node->nd_next;
|
|
|
|
}
|
|
|
|
node = node->nd_head;
|
|
|
|
break;
|
2000-05-17 08:38:19 +04:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
case NODE_BEGIN:
|
|
|
|
node = node->nd_body;
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
case NODE_IF:
|
2008-02-26 09:50:12 +03:00
|
|
|
if (!node->nd_body) {
|
|
|
|
node = node->nd_else;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (!node->nd_else) {
|
|
|
|
node = node->nd_body;
|
|
|
|
break;
|
|
|
|
}
|
2009-09-14 11:39:16 +04:00
|
|
|
if (!value_expr(node->nd_body)) return FALSE;
|
2002-06-18 07:53:23 +04:00
|
|
|
node = node->nd_else;
|
|
|
|
break;
|
2002-06-12 13:22:20 +04:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
case NODE_AND:
|
|
|
|
case NODE_OR:
|
2008-01-27 16:55:29 +03:00
|
|
|
cond = 1;
|
2002-06-18 07:53:23 +04:00
|
|
|
node = node->nd_2nd;
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-06-18 07:53:23 +04:00
|
|
|
default:
|
2009-09-14 11:39:16 +04:00
|
|
|
return TRUE;
|
2002-06-18 07:53:23 +04:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2002-06-18 07:53:23 +04:00
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
return TRUE;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
void_expr_gen(struct parser_params *parser, NODE *node)
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
const char *useless = 0;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2002-04-11 14:03:01 +04:00
|
|
|
if (!RTEST(ruby_verbose)) return;
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2003-04-19 22:17:59 +04:00
|
|
|
if (!node) return;
|
1999-08-13 09:45:20 +04:00
|
|
|
switch (nd_type(node)) {
|
|
|
|
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:
|
|
|
|
useless = rb_id2name(node->nd_mid);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NODE_LVAR:
|
|
|
|
case NODE_DVAR:
|
|
|
|
case NODE_GVAR:
|
|
|
|
case NODE_IVAR:
|
2000-03-23 11:37:35 +03:00
|
|
|
case NODE_CVAR:
|
1999-08-13 09:45:20 +04:00
|
|
|
case NODE_NTH_REF:
|
|
|
|
case NODE_BACK_REF:
|
|
|
|
useless = "a variable";
|
|
|
|
break;
|
2000-03-23 11:37:35 +03:00
|
|
|
case NODE_CONST:
|
1999-08-13 09:45:20 +04:00
|
|
|
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);
|
2007-05-02 01:45:48 +04:00
|
|
|
rb_warnS("useless use of %s in void context", useless);
|
1999-08-13 09:45:20 +04:00
|
|
|
ruby_sourceline = line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
void_stmts_gen(struct parser_params *parser, NODE *node)
|
1999-08-13 09:45:20 +04:00
|
|
|
{
|
2002-04-11 14:03:01 +04:00
|
|
|
if (!RTEST(ruby_verbose)) return;
|
1999-08-13 09:45:20 +04:00
|
|
|
if (!node) return;
|
|
|
|
if (nd_type(node) != NODE_BLOCK) return;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
if (!node->nd_next) return;
|
2007-11-29 10:59:12 +03:00
|
|
|
void_expr0(node->nd_head);
|
1999-08-13 09:45:20 +04:00
|
|
|
node = node->nd_next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-10-18 18:13:41 +04:00
|
|
|
static NODE *
|
2005-09-26 16:01:29 +04:00
|
|
|
remove_begin(NODE *node)
|
2002-10-18 18:13:41 +04:00
|
|
|
{
|
2007-07-20 05:39:30 +04:00
|
|
|
NODE **n = &node, *n1 = node;
|
|
|
|
while (n1 && nd_type(n1) == NODE_BEGIN && n1->nd_body) {
|
|
|
|
*n = n1 = n1->nd_body;
|
2002-10-18 18:13:41 +04:00
|
|
|
}
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2004-02-03 05:23:20 +03:00
|
|
|
static void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
reduce_nodes_gen(struct parser_params *parser, NODE **body)
|
2004-02-03 05:23:20 +03:00
|
|
|
{
|
|
|
|
NODE *node = *body;
|
|
|
|
|
2004-11-29 09:09:40 +03:00
|
|
|
if (!node) {
|
|
|
|
*body = NEW_NIL();
|
|
|
|
return;
|
|
|
|
}
|
2004-02-03 05:23:20 +03:00
|
|
|
#define subnodes(n1, n2) \
|
|
|
|
((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
|
|
|
|
(!node->n2) ? (body = &node->n1, 1) : \
|
|
|
|
(reduce_nodes(&node->n1), body = &node->n2, 1))
|
|
|
|
|
|
|
|
while (node) {
|
2009-09-14 11:39:16 +04:00
|
|
|
int newline = (int)(node->flags & NODE_FL_NEWLINE);
|
2004-02-03 05:23:20 +03:00
|
|
|
switch (nd_type(node)) {
|
|
|
|
end:
|
|
|
|
case NODE_NIL:
|
|
|
|
*body = 0;
|
|
|
|
return;
|
|
|
|
case NODE_RETURN:
|
|
|
|
*body = node = node->nd_stts;
|
2009-08-20 18:42:16 +04:00
|
|
|
if (newline && node) node->flags |= NODE_FL_NEWLINE;
|
2004-02-03 05:23:20 +03:00
|
|
|
continue;
|
|
|
|
case NODE_BEGIN:
|
|
|
|
*body = node = node->nd_body;
|
2009-08-20 18:42:16 +04:00
|
|
|
if (newline && node) node->flags |= NODE_FL_NEWLINE;
|
2004-02-03 05:23:20 +03:00
|
|
|
continue;
|
|
|
|
case NODE_BLOCK:
|
|
|
|
body = &node->nd_end->nd_head;
|
|
|
|
break;
|
|
|
|
case NODE_IF:
|
|
|
|
if (subnodes(nd_body, nd_else)) break;
|
|
|
|
return;
|
|
|
|
case NODE_CASE:
|
|
|
|
body = &node->nd_body;
|
|
|
|
break;
|
|
|
|
case NODE_WHEN:
|
|
|
|
if (!subnodes(nd_body, nd_next)) goto end;
|
|
|
|
break;
|
|
|
|
case NODE_ENSURE:
|
|
|
|
if (!subnodes(nd_head, nd_resq)) goto end;
|
|
|
|
break;
|
|
|
|
case NODE_RESCUE:
|
|
|
|
if (!subnodes(nd_head, nd_resq)) goto end;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
node = *body;
|
2009-08-20 18:42:16 +04:00
|
|
|
if (newline && node) node->flags |= NODE_FL_NEWLINE;
|
2004-02-03 05:23:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#undef subnodes
|
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
assign_in_cond(struct parser_params *parser, NODE *node)
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_MASGN:
|
|
|
|
yyerror("multiple assignment in conditional");
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case NODE_LASGN:
|
|
|
|
case NODE_DASGN:
|
2009-09-23 12:08:32 +04:00
|
|
|
case NODE_DASGN_CURR:
|
1999-01-20 07:59:39 +03:00
|
|
|
case NODE_GASGN:
|
|
|
|
case NODE_IASGN:
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (nd_type(node->nd_value)) {
|
|
|
|
case NODE_LIT:
|
|
|
|
case NODE_STR:
|
|
|
|
case NODE_NIL:
|
|
|
|
case NODE_TRUE:
|
|
|
|
case NODE_FALSE:
|
|
|
|
/* reports always */
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warn(node->nd_value, "found = in conditional, should be ==");
|
1999-01-20 07:59:39 +03:00
|
|
|
return 1;
|
|
|
|
|
2000-10-10 11:03:36 +04:00
|
|
|
case NODE_DSTR:
|
|
|
|
case NODE_XSTR:
|
|
|
|
case NODE_DXSTR:
|
|
|
|
case NODE_EVSTR:
|
|
|
|
case NODE_DREGX:
|
1999-01-20 07:59:39 +03:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2000-12-28 08:00:47 +03:00
|
|
|
static void
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
warn_unless_e_option(struct parser_params *parser, NODE *node, const char *str)
|
2000-12-28 08:00:47 +03:00
|
|
|
{
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
if (!e_option_supplied(parser)) parser_warn(node, str);
|
2001-02-08 12:19:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
warning_unless_e_option(struct parser_params *parser, NODE *node, const char *str)
|
2001-02-08 12:19:27 +03:00
|
|
|
{
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
if (!e_option_supplied(parser)) parser_warning(node, str);
|
2000-12-28 08:00:47 +03:00
|
|
|
}
|
|
|
|
|
2008-08-04 11:48:52 +04:00
|
|
|
static void
|
|
|
|
fixup_nodes(NODE **rootnode)
|
|
|
|
{
|
|
|
|
NODE *node, *next, *head;
|
|
|
|
|
|
|
|
for (node = *rootnode; node; node = next) {
|
|
|
|
enum node_type type;
|
|
|
|
VALUE val;
|
|
|
|
|
|
|
|
next = node->nd_next;
|
|
|
|
head = node->nd_head;
|
|
|
|
rb_gc_force_recycle((VALUE)node);
|
|
|
|
*rootnode = next;
|
|
|
|
switch (type = nd_type(head)) {
|
|
|
|
case NODE_DOT2:
|
|
|
|
case NODE_DOT3:
|
|
|
|
val = rb_range_new(head->nd_beg->nd_lit, head->nd_end->nd_lit,
|
2009-09-14 11:39:16 +04:00
|
|
|
type == NODE_DOT3);
|
2008-08-04 11:48:52 +04:00
|
|
|
rb_gc_force_recycle((VALUE)head->nd_beg);
|
|
|
|
rb_gc_force_recycle((VALUE)head->nd_end);
|
|
|
|
nd_set_type(head, NODE_LIT);
|
|
|
|
head->nd_lit = val;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
static NODE *cond0(struct parser_params*,NODE*);
|
2001-02-19 10:03:06 +03:00
|
|
|
|
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
range_op(struct parser_params *parser, NODE *node)
|
2001-02-19 10:03:06 +03:00
|
|
|
{
|
|
|
|
enum node_type type;
|
|
|
|
|
2002-06-12 13:22:20 +04:00
|
|
|
if (node == 0) return 0;
|
2001-02-19 10:03:06 +03:00
|
|
|
|
|
|
|
type = nd_type(node);
|
2008-08-04 11:48:52 +04:00
|
|
|
value_expr(node);
|
2001-02-19 10:03:06 +03:00
|
|
|
if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
warn_unless_e_option(parser, node, "integer literal in conditional range");
|
2007-08-09 11:04:56 +04:00
|
|
|
return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(rb_intern("$."))));
|
2001-02-19 10:03:06 +03:00
|
|
|
}
|
2008-08-04 11:48:52 +04:00
|
|
|
return cond0(parser, node);
|
2001-02-19 10:03:06 +03:00
|
|
|
}
|
|
|
|
|
2003-04-17 09:22:40 +04:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
literal_node(NODE *node)
|
2003-04-17 09:22:40 +04:00
|
|
|
{
|
|
|
|
if (!node) return 1; /* same as NODE_NIL */
|
|
|
|
switch (nd_type(node)) {
|
|
|
|
case NODE_LIT:
|
|
|
|
case NODE_STR:
|
|
|
|
case NODE_DSTR:
|
|
|
|
case NODE_EVSTR:
|
|
|
|
case NODE_DREGX:
|
|
|
|
case NODE_DREGX_ONCE:
|
|
|
|
case NODE_DSYM:
|
|
|
|
return 2;
|
|
|
|
case NODE_TRUE:
|
|
|
|
case NODE_FALSE:
|
|
|
|
case NODE_NIL:
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
cond0(struct parser_params *parser, NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-07-14 18:51:42 +04:00
|
|
|
if (node == 0) return 0;
|
2004-09-17 13:24:13 +04:00
|
|
|
assign_in_cond(parser, node);
|
2001-08-06 07:05:23 +04:00
|
|
|
|
2004-07-14 18:51:42 +04:00
|
|
|
switch (nd_type(node)) {
|
2000-12-27 08:59:03 +03:00
|
|
|
case NODE_DSTR:
|
2003-04-17 09:22:40 +04:00
|
|
|
case NODE_EVSTR:
|
2001-03-13 08:45:13 +03:00
|
|
|
case NODE_STR:
|
2007-05-02 01:45:48 +04:00
|
|
|
rb_warn0("string literal in condition");
|
2001-03-13 08:45:13 +03:00
|
|
|
break;
|
2001-02-08 12:19:27 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
case NODE_DREGX:
|
|
|
|
case NODE_DREGX_ONCE:
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
warning_unless_e_option(parser, node, "regex literal in condition");
|
1998-01-16 15:19:22 +03:00
|
|
|
return NEW_MATCH2(node, NEW_GVAR(rb_intern("$_")));
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2001-08-14 12:13:31 +04:00
|
|
|
case NODE_AND:
|
|
|
|
case NODE_OR:
|
2004-09-17 13:24:13 +04:00
|
|
|
node->nd_1st = cond0(parser, node->nd_1st);
|
|
|
|
node->nd_2nd = cond0(parser, node->nd_2nd);
|
2001-08-14 12:13:31 +04:00
|
|
|
break;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
case NODE_DOT2:
|
|
|
|
case NODE_DOT3:
|
2004-09-17 13:24:13 +04:00
|
|
|
node->nd_beg = range_op(parser, node->nd_beg);
|
|
|
|
node->nd_end = range_op(parser, node->nd_end);
|
2004-07-14 18:51:42 +04:00
|
|
|
if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
|
|
|
|
else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
if (!e_option_supplied(parser)) {
|
2003-04-17 09:22:40 +04:00
|
|
|
int b = literal_node(node->nd_beg);
|
|
|
|
int e = literal_node(node->nd_end);
|
|
|
|
if ((b == 1 && e == 1) || (b + e >= 2 && RTEST(ruby_verbose))) {
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warn(node, "range literal in condition");
|
2003-04-17 09:22:40 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NODE_DSYM:
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warning(node, "literal in condition");
|
2000-12-28 08:00:47 +03:00
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
case NODE_LIT:
|
2001-02-19 10:03:06 +03:00
|
|
|
if (TYPE(node->nd_lit) == T_REGEXP) {
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
warn_unless_e_option(parser, node, "regex literal in condition");
|
2000-12-27 08:59:03 +03:00
|
|
|
nd_set_type(node, NODE_MATCH);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2001-08-14 12:13:31 +04:00
|
|
|
else {
|
2003-04-21 12:44:38 +04:00
|
|
|
parser_warning(node, "literal in condition");
|
2001-08-14 12:13:31 +04:00
|
|
|
}
|
2002-06-05 10:10:57 +04:00
|
|
|
default:
|
|
|
|
break;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2000-12-27 08:59:03 +03:00
|
|
|
return node;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
cond_gen(struct parser_params *parser, NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
1999-01-20 07:59:39 +03:00
|
|
|
if (node == 0) return 0;
|
2004-09-17 13:24:13 +04:00
|
|
|
return cond0(parser, node);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *right)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
value_expr(left);
|
2009-09-14 11:39:16 +04:00
|
|
|
if (left && (enum node_type)nd_type(left) == type) {
|
2002-06-18 07:53:23 +04:00
|
|
|
NODE *node = left, *second;
|
2009-09-14 11:39:16 +04:00
|
|
|
while ((second = node->nd_2nd) != 0 && (enum node_type)nd_type(second) == type) {
|
2002-06-18 07:53:23 +04:00
|
|
|
node = second;
|
|
|
|
}
|
2003-07-04 19:30:35 +04:00
|
|
|
node->nd_2nd = NEW_NODE(type, second, right, 0);
|
2002-06-18 07:53:23 +04:00
|
|
|
return left;
|
|
|
|
}
|
2003-07-04 19:30:35 +04:00
|
|
|
return NEW_NODE(type, left, right, 0);
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
|
2003-06-20 11:11:44 +04:00
|
|
|
static void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
no_blockarg(struct parser_params *parser, NODE *node)
|
2003-06-20 11:11:44 +04:00
|
|
|
{
|
|
|
|
if (node && nd_type(node) == NODE_BLOCK_PASS) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
compile_error(PARSER_ARG "block argument should not be given");
|
2003-06-20 11:11:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-30 13:12:34 +04:00
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
ret_args_gen(struct parser_params *parser, NODE *node)
|
2001-05-30 13:12:34 +04:00
|
|
|
{
|
|
|
|
if (node) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
no_blockarg(parser, node);
|
2004-05-07 12:44:24 +04:00
|
|
|
if (nd_type(node) == NODE_ARRAY) {
|
|
|
|
if (node->nd_next == 0) {
|
|
|
|
node = node->nd_head;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
nd_set_type(node, NODE_VALUES);
|
|
|
|
}
|
2003-06-20 11:11:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
new_yield_gen(struct parser_params *parser, NODE *node)
|
2003-06-20 11:11:44 +04:00
|
|
|
{
|
2003-10-29 20:47:24 +03:00
|
|
|
long state = Qtrue;
|
|
|
|
|
|
|
|
if (node) {
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
no_blockarg(parser, node);
|
2007-06-05 21:26:00 +04:00
|
|
|
if (node && nd_type(node) == NODE_SPLAT) {
|
|
|
|
state = Qtrue;
|
|
|
|
}
|
2003-10-29 20:47:24 +03:00
|
|
|
}
|
|
|
|
else {
|
2006-12-31 18:02:22 +03:00
|
|
|
state = Qfalse;
|
2003-10-29 20:47:24 +03:00
|
|
|
}
|
|
|
|
return NEW_YIELD(node, state);
|
2001-05-30 13:12:34 +04:00
|
|
|
}
|
|
|
|
|
2003-01-23 06:39:25 +03:00
|
|
|
static NODE*
|
2005-09-26 16:01:29 +04:00
|
|
|
negate_lit(NODE *node)
|
2003-01-23 06:39:25 +03:00
|
|
|
{
|
|
|
|
switch (TYPE(node->nd_lit)) {
|
|
|
|
case T_FIXNUM:
|
|
|
|
node->nd_lit = LONG2FIX(-FIX2LONG(node->nd_lit));
|
|
|
|
break;
|
|
|
|
case T_BIGNUM:
|
|
|
|
node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0);
|
|
|
|
break;
|
|
|
|
case T_FLOAT:
|
2007-11-20 14:35:12 +03:00
|
|
|
RFLOAT(node->nd_lit)->float_value = -RFLOAT_VALUE(node->nd_lit);
|
2003-01-23 06:39:25 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
static NODE *
|
2005-09-26 16:01:29 +04:00
|
|
|
arg_blk_pass(NODE *node1, NODE *node2)
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
|
|
|
if (node2) {
|
|
|
|
node2->nd_head = node1;
|
|
|
|
return node2;
|
|
|
|
}
|
|
|
|
return node1;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2005-07-28 11:16:22 +04:00
|
|
|
static NODE*
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, ID b)
|
2005-07-28 11:16:22 +04:00
|
|
|
{
|
|
|
|
int saved_line = ruby_sourceline;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
NODE *node;
|
|
|
|
NODE *i1, *i2 = 0;
|
2005-07-28 11:16:22 +04:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
node = NEW_ARGS(m ? m->nd_plen : 0, o);
|
|
|
|
i1 = m ? m->nd_next : 0;
|
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block.
this change prohibits duplicate block parameter name.
new argument infromation:
NODE_ARGS [m: int, o: NODE_OPT_ARG, ->]
NODE_ARGS_AUX [r: ID, b: ID, ->]
NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*]
optarg information:
NODE_OPT_ARGS [idx, expr, ->]
* vm_macro.def: ditto.
* gc.c: ditto.
* iseq.c: ditto.
* compile.h: fix debug function name.
* test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo|
* test/ruby/test_lambda.rb: disalbe test temporarily.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:07:05 +03:00
|
|
|
node->nd_next = NEW_ARGS_AUX(r, b);
|
2007-05-17 08:25:18 +04:00
|
|
|
|
2006-07-12 15:10:22 +04:00
|
|
|
if (p) {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
i2 = p->nd_next;
|
|
|
|
node->nd_next->nd_next = NEW_ARGS_AUX(p->nd_pid, p->nd_plen);
|
|
|
|
}
|
|
|
|
else if (i1) {
|
|
|
|
node->nd_next->nd_next = NEW_ARGS_AUX(0, 0);
|
|
|
|
}
|
|
|
|
if (i1 || i2) {
|
|
|
|
node->nd_next->nd_next->nd_next = NEW_NODE(NODE_AND, i1, i2, 0);
|
2005-07-28 11:16:22 +04:00
|
|
|
}
|
|
|
|
ruby_sourceline = saved_line;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
return node;
|
2000-06-23 11:05:59 +04:00
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif /* !RIPPER */
|
2000-06-23 11:05:59 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static void
|
2006-12-31 18:02:22 +03:00
|
|
|
local_push_gen(struct parser_params *parser, int inherit_dvars)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
|
|
|
struct local_vars *local;
|
|
|
|
|
|
|
|
local = ALLOC(struct local_vars);
|
|
|
|
local->prev = lvtbl;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
local->args = vtable_alloc(0);
|
|
|
|
local->vars = vtable_alloc(inherit_dvars ? DVARS_INHERIT : DVARS_TOPSCOPE);
|
1998-01-16 15:13:05 +03:00
|
|
|
lvtbl = local;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
local_pop_gen(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
1999-01-20 07:59:39 +03:00
|
|
|
struct local_vars *local = lvtbl->prev;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
vtable_free(lvtbl->args);
|
|
|
|
vtable_free(lvtbl->vars);
|
2004-10-02 15:34:13 +04:00
|
|
|
xfree(lvtbl);
|
1999-01-20 07:59:39 +03:00
|
|
|
lvtbl = local;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
2006-12-31 18:02:22 +03:00
|
|
|
static ID*
|
2007-05-10 10:08:20 +04:00
|
|
|
vtable_tblcpy(ID *buf, const struct vtable *src)
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
|
|
|
int i, cnt = vtable_size(src);
|
|
|
|
|
|
|
|
if (cnt > 0) {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
buf[0] = cnt;
|
2006-12-31 18:02:22 +03:00
|
|
|
for (i = 0; i < cnt; i++) {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
buf[i] = src->tbl[i];
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
return buf;
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ID*
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
local_tbl_gen(struct parser_params *parser)
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
int cnt = vtable_size(lvtbl->args) + vtable_size(lvtbl->vars);
|
|
|
|
ID *buf;
|
|
|
|
|
|
|
|
if (cnt <= 0) return 0;
|
|
|
|
buf = ALLOC_N(ID, cnt + 1);
|
|
|
|
vtable_tblcpy(buf+1, lvtbl->args);
|
|
|
|
vtable_tblcpy(buf+vtable_size(lvtbl->args)+1, lvtbl->vars);
|
|
|
|
buf[0] = cnt;
|
|
|
|
return buf;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
static int
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
arg_var_gen(struct parser_params *parser, ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
vtable_add(lvtbl->args, id);
|
|
|
|
return vtable_size(lvtbl->args) - 1;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
static int
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
local_var_gen(struct parser_params *parser, ID id)
|
1999-01-20 07:59:39 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
vtable_add(lvtbl->vars, id);
|
|
|
|
return vtable_size(lvtbl->vars) - 1;
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
static int
|
2005-09-26 16:01:29 +04:00
|
|
|
local_id_gen(struct parser_params *parser, ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
struct vtable *vars, *args;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
vars = lvtbl->vars;
|
|
|
|
args = lvtbl->args;
|
2006-12-31 18:02:22 +03:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
while (vars && POINTER_P(vars->prev)) {
|
|
|
|
vars = vars->prev;
|
|
|
|
args = args->prev;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
if (vars && vars->prev == DVARS_INHERIT) {
|
|
|
|
return rb_local_defined(id);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
else {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
return (vtable_included(args, id) ||
|
|
|
|
vtable_included(vars, id));
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2005-03-09 12:29:52 +03:00
|
|
|
}
|
|
|
|
|
2009-12-01 06:01:15 +03:00
|
|
|
static const struct vtable *
|
|
|
|
dyna_push_gen(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
lvtbl->args = vtable_alloc(lvtbl->args);
|
|
|
|
lvtbl->vars = vtable_alloc(lvtbl->vars);
|
2009-12-01 06:01:15 +03:00
|
|
|
return lvtbl->args;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-12-09 19:12:57 +03:00
|
|
|
dyna_pop_1(struct parser_params *parser)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
struct vtable *tmp;
|
|
|
|
|
|
|
|
tmp = lvtbl->args;
|
|
|
|
lvtbl->args = lvtbl->args->prev;
|
|
|
|
vtable_free(tmp);
|
|
|
|
tmp = lvtbl->vars;
|
|
|
|
lvtbl->vars = lvtbl->vars->prev;
|
2006-12-31 18:02:22 +03:00
|
|
|
vtable_free(tmp);
|
|
|
|
}
|
|
|
|
|
2009-12-09 19:12:57 +03:00
|
|
|
static void
|
|
|
|
dyna_pop_gen(struct parser_params *parser, const struct vtable *lvargs)
|
|
|
|
{
|
|
|
|
while (lvtbl->args != lvargs) {
|
|
|
|
dyna_pop_1(parser);
|
|
|
|
if (!lvtbl->args) {
|
|
|
|
struct local_vars *local = lvtbl->prev;
|
|
|
|
xfree(lvtbl);
|
|
|
|
lvtbl = local;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dyna_pop_1(parser);
|
|
|
|
}
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static int
|
|
|
|
dyna_in_block_gen(struct parser_params *parser)
|
|
|
|
{
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
return POINTER_P(lvtbl->vars) && lvtbl->vars->prev != DVARS_TOPSCOPE;
|
2003-06-06 15:29:20 +04:00
|
|
|
}
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static int
|
|
|
|
dvar_defined_gen(struct parser_params *parser, ID id)
|
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
struct vtable *vars, *args;
|
|
|
|
|
|
|
|
args = lvtbl->args;
|
|
|
|
vars = lvtbl->vars;
|
|
|
|
|
|
|
|
while (POINTER_P(vars)) {
|
|
|
|
if (vtable_included(args, id)) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (vtable_included(vars, id)) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
args = args->prev;
|
|
|
|
vars = vars->prev;
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
|
|
|
if (vars == DVARS_INHERIT) {
|
2006-12-31 18:02:22 +03:00
|
|
|
return rb_dvar_defined(id);
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dvar_curr_gen(struct parser_params *parser, ID id)
|
|
|
|
{
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
return (vtable_included(lvtbl->args, id) ||
|
|
|
|
vtable_included(lvtbl->vars, id));
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
2009-08-30 12:00:31 +04:00
|
|
|
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
2007-12-08 10:21:05 +03:00
|
|
|
VALUE rb_reg_check_preprocess(VALUE);
|
2007-08-25 11:06:47 +04:00
|
|
|
|
2007-12-02 03:16:24 +03:00
|
|
|
static void
|
|
|
|
reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
|
2007-08-02 18:36:25 +04:00
|
|
|
{
|
2007-10-19 11:41:03 +04:00
|
|
|
int c = RE_OPTION_ENCODING_IDX(options);
|
2007-08-02 18:36:25 +04:00
|
|
|
|
2007-10-19 11:41:03 +04:00
|
|
|
if (c) {
|
|
|
|
int opt, idx;
|
|
|
|
rb_char_to_option_kcode(c, &opt, &idx);
|
2008-01-24 16:11:00 +03:00
|
|
|
if (idx != ENCODING_GET(str) &&
|
2007-11-27 05:21:17 +03:00
|
|
|
rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
|
2008-01-24 16:11:00 +03:00
|
|
|
goto error;
|
2007-10-19 11:41:03 +04:00
|
|
|
}
|
|
|
|
ENCODING_SET(str, idx);
|
|
|
|
}
|
2008-01-24 10:25:46 +03:00
|
|
|
else if (RE_OPTION_ENCODING_NONE(options)) {
|
2008-01-24 16:11:00 +03:00
|
|
|
if (!ENCODING_IS_ASCII8BIT(str) &&
|
|
|
|
rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
|
|
|
|
c = 'n';
|
|
|
|
goto error;
|
|
|
|
}
|
2008-01-24 10:25:46 +03:00
|
|
|
rb_enc_associate(str, rb_ascii8bit_encoding());
|
|
|
|
}
|
2008-01-28 21:04:39 +03:00
|
|
|
else if (parser->enc == rb_usascii_encoding()) {
|
|
|
|
if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
|
|
|
|
/* raise in re.c */
|
|
|
|
rb_enc_associate(str, rb_usascii_encoding());
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rb_enc_associate(str, rb_ascii8bit_encoding());
|
|
|
|
}
|
|
|
|
}
|
2008-01-24 16:11:00 +03:00
|
|
|
return;
|
|
|
|
|
2008-02-14 17:56:40 +03:00
|
|
|
error:
|
2008-01-24 16:11:00 +03:00
|
|
|
compile_error(PARSER_ARG
|
|
|
|
"regexp encoding option '%c' differs from source encoding '%s'",
|
|
|
|
c, rb_enc_name(rb_enc_get(str)));
|
2007-12-02 03:16:24 +03:00
|
|
|
}
|
|
|
|
|
2007-12-08 10:21:05 +03:00
|
|
|
static void
|
|
|
|
reg_fragment_check_gen(struct parser_params* parser, VALUE str, int options)
|
|
|
|
{
|
|
|
|
VALUE err;
|
2009-08-15 05:40:10 +04:00
|
|
|
reg_fragment_setenc(str, options);
|
2007-12-08 10:21:05 +03:00
|
|
|
err = rb_reg_check_preprocess(str);
|
|
|
|
if (err != Qnil) {
|
|
|
|
err = rb_obj_as_string(err);
|
|
|
|
compile_error(PARSER_ARG "%s", RSTRING_PTR(err));
|
|
|
|
RB_GC_GUARD(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-18 14:26:24 +03:00
|
|
|
typedef struct {
|
|
|
|
struct parser_params* parser;
|
|
|
|
rb_encoding *enc;
|
|
|
|
NODE *succ_block;
|
|
|
|
NODE *fail_block;
|
|
|
|
int num;
|
|
|
|
} reg_named_capture_assign_t;
|
|
|
|
|
|
|
|
static int
|
|
|
|
reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
|
|
|
|
int back_num, int *back_refs, OnigRegex regex, void *arg0)
|
|
|
|
{
|
|
|
|
reg_named_capture_assign_t *arg = (reg_named_capture_assign_t*)arg0;
|
|
|
|
struct parser_params* parser = arg->parser;
|
2007-12-19 10:32:00 +03:00
|
|
|
rb_encoding *enc = arg->enc;
|
2009-09-14 11:39:16 +04:00
|
|
|
long len = name_end - name;
|
2007-12-19 10:32:00 +03:00
|
|
|
const char *s = (const char *)name;
|
2007-12-19 10:26:37 +03:00
|
|
|
ID var;
|
2007-12-18 14:26:24 +03:00
|
|
|
|
|
|
|
arg->num++;
|
|
|
|
|
|
|
|
if (arg->succ_block == 0) {
|
|
|
|
arg->succ_block = NEW_BEGIN(0);
|
|
|
|
arg->fail_block = NEW_BEGIN(0);
|
|
|
|
}
|
|
|
|
|
2007-12-22 08:30:37 +03:00
|
|
|
if (!len || (*name != '_' && ISASCII(*name) && !rb_enc_islower(*name, enc)) ||
|
2009-09-14 11:39:16 +04:00
|
|
|
(len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) ||
|
|
|
|
!rb_enc_symname2_p(s, len, enc)) {
|
2007-12-18 14:26:24 +03:00
|
|
|
return ST_CONTINUE;
|
|
|
|
}
|
2007-12-19 10:32:00 +03:00
|
|
|
var = rb_intern3(s, len, enc);
|
2007-12-18 14:26:24 +03:00
|
|
|
if (dvar_defined(var) || local_id(var)) {
|
2008-08-10 07:15:37 +04:00
|
|
|
rb_warningS("named capture conflicts a local variable - %s",
|
2007-12-18 14:26:24 +03:00
|
|
|
rb_id2name(var));
|
|
|
|
}
|
|
|
|
arg->succ_block = block_append(arg->succ_block,
|
|
|
|
newline_node(node_assign(assignable(var,0),
|
|
|
|
NEW_CALL(
|
|
|
|
gettable(rb_intern("$~")),
|
|
|
|
idAREF,
|
|
|
|
NEW_LIST(NEW_LIT(ID2SYM(var))))
|
|
|
|
)));
|
|
|
|
arg->fail_block = block_append(arg->fail_block,
|
|
|
|
newline_node(node_assign(assignable(var,0), NEW_LIT(Qnil))));
|
|
|
|
return ST_CONTINUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NODE *
|
|
|
|
reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match)
|
|
|
|
{
|
|
|
|
reg_named_capture_assign_t arg;
|
|
|
|
|
|
|
|
arg.parser = parser;
|
|
|
|
arg.enc = rb_enc_get(regexp);
|
|
|
|
arg.succ_block = 0;
|
|
|
|
arg.fail_block = 0;
|
|
|
|
arg.num = 0;
|
|
|
|
onig_foreach_name(RREGEXP(regexp)->ptr, reg_named_capture_assign_iter, (void*)&arg);
|
|
|
|
|
|
|
|
if (arg.num == 0)
|
|
|
|
return match;
|
|
|
|
|
2008-08-10 07:15:37 +04:00
|
|
|
return
|
2007-12-18 14:26:24 +03:00
|
|
|
block_append(
|
|
|
|
newline_node(match),
|
|
|
|
NEW_IF(gettable(rb_intern("$~")),
|
|
|
|
block_append(
|
|
|
|
newline_node(arg.succ_block),
|
|
|
|
newline_node(
|
|
|
|
NEW_CALL(
|
|
|
|
gettable(rb_intern("$~")),
|
|
|
|
rb_intern("begin"),
|
|
|
|
NEW_LIST(NEW_LIT(INT2FIX(0)))))),
|
|
|
|
block_append(
|
|
|
|
newline_node(arg.fail_block),
|
|
|
|
newline_node(
|
|
|
|
NEW_LIT(Qnil)))));
|
|
|
|
}
|
|
|
|
|
2007-12-02 03:16:24 +03:00
|
|
|
static VALUE
|
|
|
|
reg_compile_gen(struct parser_params* parser, VALUE str, int options)
|
|
|
|
{
|
|
|
|
VALUE re;
|
2008-02-14 17:56:40 +03:00
|
|
|
VALUE err;
|
2007-12-02 03:16:24 +03:00
|
|
|
|
|
|
|
reg_fragment_setenc(str, options);
|
2008-02-14 17:56:40 +03:00
|
|
|
err = rb_errinfo();
|
2009-08-30 12:00:31 +04:00
|
|
|
re = rb_reg_compile(str, options & RE_OPTION_MASK, ruby_sourcefile, ruby_sourceline);
|
2007-08-18 09:05:36 +04:00
|
|
|
if (NIL_P(re)) {
|
2008-02-14 17:56:40 +03:00
|
|
|
ID mesg = rb_intern("mesg");
|
2008-02-15 03:44:13 +03:00
|
|
|
VALUE m = rb_attr_get(rb_errinfo(), mesg);
|
2008-02-14 17:56:40 +03:00
|
|
|
rb_set_errinfo(err);
|
2008-02-15 03:44:13 +03:00
|
|
|
if (!NIL_P(err)) {
|
|
|
|
rb_str_append(rb_str_cat(rb_attr_get(err, mesg), "\n", 1), m);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
compile_error(PARSER_ARG "%s", RSTRING_PTR(m));
|
|
|
|
}
|
2007-08-02 18:36:25 +04:00
|
|
|
return Qnil;
|
|
|
|
}
|
|
|
|
return re;
|
|
|
|
}
|
|
|
|
|
2002-09-06 00:00:52 +04:00
|
|
|
void
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_gc_mark_parser(void)
|
2002-09-06 00:00:52 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-09-22 04:19:15 +04:00
|
|
|
NODE*
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_append_print(VALUE vparser, NODE *node)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-10-29 06:35:11 +04:00
|
|
|
NODE *prelude = 0;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
NODE *scope = node;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
struct parser_params *parser;
|
|
|
|
|
2007-07-18 04:19:10 +04:00
|
|
|
if (!node) return node;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
node = node->nd_body;
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
|
2007-07-18 04:19:10 +04:00
|
|
|
if (nd_type(node) == NODE_PRELUDE) {
|
2004-10-29 06:35:11 +04:00
|
|
|
prelude = node;
|
2004-09-24 09:53:43 +04:00
|
|
|
node = node->nd_body;
|
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
2004-09-24 09:53:43 +04:00
|
|
|
node = block_append(node,
|
2004-09-22 04:19:15 +04:00
|
|
|
NEW_FCALL(rb_intern("print"),
|
|
|
|
NEW_ARRAY(NEW_GVAR(rb_intern("$_")))));
|
2004-09-24 09:53:43 +04:00
|
|
|
if (prelude) {
|
|
|
|
prelude->nd_body = node;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
scope->nd_body = prelude;
|
2004-09-24 09:53:43 +04:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
else {
|
|
|
|
scope->nd_body = node;
|
|
|
|
}
|
|
|
|
|
|
|
|
return scope;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2004-09-22 04:19:15 +04:00
|
|
|
NODE *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_while_loop(VALUE vparser, NODE *node, int chop, int split)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2004-10-29 06:35:11 +04:00
|
|
|
NODE *prelude = 0;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
NODE *scope = node;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
struct parser_params *parser;
|
|
|
|
|
2007-07-18 04:19:10 +04:00
|
|
|
if (!node) return node;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
|
|
|
node = node->nd_body;
|
2004-09-24 09:53:43 +04:00
|
|
|
|
2007-07-18 04:19:10 +04:00
|
|
|
if (nd_type(node) == NODE_PRELUDE) {
|
2004-10-29 06:35:11 +04:00
|
|
|
prelude = node;
|
2004-09-24 09:53:43 +04:00
|
|
|
node = node->nd_body;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
if (split) {
|
2004-09-22 04:19:15 +04:00
|
|
|
node = block_append(NEW_GASGN(rb_intern("$F"),
|
|
|
|
NEW_CALL(NEW_GVAR(rb_intern("$_")),
|
|
|
|
rb_intern("split"), 0)),
|
|
|
|
node);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
if (chop) {
|
2004-09-22 04:19:15 +04:00
|
|
|
node = block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")),
|
|
|
|
rb_intern("chop!"), 0), node);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
2004-09-24 09:53:43 +04:00
|
|
|
node = NEW_OPT_N(node);
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
|
2004-09-24 09:53:43 +04:00
|
|
|
if (prelude) {
|
|
|
|
prelude->nd_body = node;
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
scope->nd_body = prelude;
|
2004-09-24 09:53:43 +04:00
|
|
|
}
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
else {
|
|
|
|
scope->nd_body = node;
|
|
|
|
}
|
|
|
|
|
|
|
|
return scope;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2005-07-13 17:44:21 +04:00
|
|
|
static const struct {
|
1999-01-20 07:59:39 +03:00
|
|
|
ID token;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
const char *name;
|
1999-01-20 07:59:39 +03:00
|
|
|
} op_tbl[] = {
|
2002-04-24 08:54:16 +04:00
|
|
|
{tDOT2, ".."},
|
|
|
|
{tDOT3, "..."},
|
|
|
|
{'+', "+(binary)"},
|
|
|
|
{'-', "-(binary)"},
|
|
|
|
{tPOW, "**"},
|
|
|
|
{tUPLUS, "+@"},
|
|
|
|
{tUMINUS, "-@"},
|
|
|
|
{tCMP, "<=>"},
|
|
|
|
{tGEQ, ">="},
|
|
|
|
{tLEQ, "<="},
|
|
|
|
{tEQ, "=="},
|
|
|
|
{tEQQ, "==="},
|
|
|
|
{tNEQ, "!="},
|
|
|
|
{tMATCH, "=~"},
|
|
|
|
{tNMATCH, "!~"},
|
|
|
|
{tAREF, "[]"},
|
|
|
|
{tASET, "[]="},
|
|
|
|
{tLSHFT, "<<"},
|
|
|
|
{tRSHFT, ">>"},
|
|
|
|
{tCOLON2, "::"},
|
1998-01-16 15:13:05 +03:00
|
|
|
};
|
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
#define op_tbl_count numberof(op_tbl)
|
2008-08-14 12:57:07 +04:00
|
|
|
|
2009-08-20 07:11:01 +04:00
|
|
|
#ifndef ENABLE_SELECTOR_NAMESPACE
|
|
|
|
#define ENABLE_SELECTOR_NAMESPACE 0
|
|
|
|
#endif
|
|
|
|
|
2005-07-13 17:44:21 +04:00
|
|
|
static struct symbols {
|
|
|
|
ID last_id;
|
2006-09-02 19:05:27 +04:00
|
|
|
st_table *sym_id;
|
2007-02-02 16:19:44 +03:00
|
|
|
st_table *id_str;
|
2009-08-20 07:09:08 +04:00
|
|
|
#if ENABLE_SELECTOR_NAMESPACE
|
2007-02-04 22:17:33 +03:00
|
|
|
st_table *ivar2_id;
|
|
|
|
st_table *id_ivar2;
|
2009-08-20 07:09:08 +04:00
|
|
|
#endif
|
2007-02-02 16:19:44 +03:00
|
|
|
VALUE op_sym[tLAST_TOKEN];
|
2008-08-14 12:57:07 +04:00
|
|
|
} global_symbols = {tLAST_ID};
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-07-05 05:06:49 +04:00
|
|
|
static const struct st_hash_type symhash = {
|
2008-02-12 06:17:43 +03:00
|
|
|
rb_str_hash_cmp,
|
2006-09-02 19:05:27 +04:00
|
|
|
rb_str_hash,
|
|
|
|
};
|
|
|
|
|
2009-08-20 07:09:08 +04:00
|
|
|
#if ENABLE_SELECTOR_NAMESPACE
|
2007-02-04 22:17:33 +03:00
|
|
|
struct ivar2_key {
|
|
|
|
ID id;
|
|
|
|
VALUE klass;
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
ivar2_cmp(struct ivar2_key *key1, struct ivar2_key *key2)
|
|
|
|
{
|
|
|
|
if (key1->id == key2->id && key1->klass == key2->klass) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ivar2_hash(struct ivar2_key *key)
|
|
|
|
{
|
|
|
|
return (key->id << 8) ^ (key->klass >> 2);
|
|
|
|
}
|
|
|
|
|
2007-07-05 05:06:49 +04:00
|
|
|
static const struct st_hash_type ivar2_hash_type = {
|
2007-02-04 22:17:33 +03:00
|
|
|
ivar2_cmp,
|
|
|
|
ivar2_hash,
|
|
|
|
};
|
2009-08-20 07:09:08 +04:00
|
|
|
#endif
|
2007-02-04 22:17:33 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
void
|
2005-09-26 16:01:29 +04:00
|
|
|
Init_sym(void)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2006-09-02 19:05:27 +04:00
|
|
|
global_symbols.sym_id = st_init_table_with_size(&symhash, 1000);
|
2007-02-02 16:19:44 +03:00
|
|
|
global_symbols.id_str = st_init_numtable_with_size(1000);
|
2009-08-20 07:09:08 +04:00
|
|
|
#if ENABLE_SELECTOR_NAMESPACE
|
2007-02-04 22:17:33 +03:00
|
|
|
global_symbols.ivar2_id = st_init_table_with_size(&ivar2_hash_type, 1000);
|
|
|
|
global_symbols.id_ivar2 = st_init_numtable_with_size(1000);
|
2009-08-20 07:09:08 +04:00
|
|
|
#endif
|
2008-08-14 12:57:07 +04:00
|
|
|
|
|
|
|
Init_id();
|
2006-09-02 19:05:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-09-25 09:57:37 +04:00
|
|
|
rb_gc_mark_symbols(void)
|
2006-09-02 19:05:27 +04:00
|
|
|
{
|
2007-02-02 16:19:44 +03:00
|
|
|
rb_mark_tbl(global_symbols.id_str);
|
|
|
|
rb_gc_mark_locations(global_symbols.op_sym,
|
|
|
|
global_symbols.op_sym + tLAST_TOKEN);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2009-10-02 15:37:44 +04:00
|
|
|
#endif /* !RIPPER */
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2001-09-20 10:23:50 +04:00
|
|
|
static ID
|
2007-05-11 10:26:06 +04:00
|
|
|
internal_id_gen(struct parser_params *parser)
|
2001-09-20 10:23:50 +04:00
|
|
|
{
|
2007-05-11 10:26:06 +04:00
|
|
|
ID id = (ID)vtable_size(lvtbl->args) + (ID)vtable_size(lvtbl->vars);
|
2007-08-09 23:47:11 +04:00
|
|
|
id += ((tLAST_TOKEN - ID_INTERNAL) >> ID_SCOPE_SHIFT) + 1;
|
2007-05-11 10:26:06 +04:00
|
|
|
return ID_INTERNAL | (id << ID_SCOPE_SHIFT);
|
2001-09-20 10:23:50 +04:00
|
|
|
}
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#ifndef RIPPER
|
2005-10-22 08:09:24 +04:00
|
|
|
static int
|
2007-09-06 16:33:45 +04:00
|
|
|
is_special_global_name(const char *m, const char *e, rb_encoding *enc)
|
2005-10-22 08:09:24 +04:00
|
|
|
{
|
2007-10-03 11:58:50 +04:00
|
|
|
int mb = 0;
|
|
|
|
|
|
|
|
if (m >= e) return 0;
|
2005-10-22 08:09:24 +04:00
|
|
|
switch (*m) {
|
|
|
|
case '~': case '*': case '$': case '?': case '!': case '@':
|
|
|
|
case '/': case '\\': case ';': case ',': case '.': case '=':
|
|
|
|
case ':': case '<': case '>': case '\"':
|
|
|
|
case '&': case '`': case '\'': case '+':
|
|
|
|
case '0':
|
|
|
|
++m;
|
|
|
|
break;
|
|
|
|
case '-':
|
|
|
|
++m;
|
2007-12-08 05:50:43 +03:00
|
|
|
if (m < e && is_identchar(m, e, enc)) {
|
2007-10-03 11:58:50 +04:00
|
|
|
if (!ISASCII(*m)) mb = 1;
|
|
|
|
m += rb_enc_mbclen(m, e, enc);
|
|
|
|
}
|
2005-10-22 08:09:24 +04:00
|
|
|
break;
|
|
|
|
default:
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!rb_enc_isdigit(*m, enc)) return 0;
|
2007-10-03 11:58:50 +04:00
|
|
|
do {
|
|
|
|
if (!ISASCII(*m)) mb = 1;
|
|
|
|
++m;
|
2009-10-18 14:19:45 +04:00
|
|
|
} while (m < e && rb_enc_isdigit(*m, enc));
|
2005-10-22 08:09:24 +04:00
|
|
|
}
|
2007-10-03 11:58:50 +04:00
|
|
|
return m == e ? mb + 1 : 0;
|
2005-10-22 08:09:24 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
rb_symname_p(const char *name)
|
2007-09-26 13:39:08 +04:00
|
|
|
{
|
2008-01-28 12:03:09 +03:00
|
|
|
return rb_enc_symname_p(name, rb_ascii8bit_encoding());
|
2007-09-26 13:39:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
rb_enc_symname_p(const char *name, rb_encoding *enc)
|
2007-12-19 10:32:00 +03:00
|
|
|
{
|
|
|
|
return rb_enc_symname2_p(name, strlen(name), enc);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2009-09-14 11:39:16 +04:00
|
|
|
rb_enc_symname2_p(const char *name, long len, rb_encoding *enc)
|
2005-10-22 08:09:24 +04:00
|
|
|
{
|
|
|
|
const char *m = name;
|
2007-12-19 10:32:00 +03:00
|
|
|
const char *e = m + len;
|
2009-09-14 11:39:16 +04:00
|
|
|
int localid = FALSE;
|
2005-10-22 08:09:24 +04:00
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
if (!m) return FALSE;
|
2005-10-22 08:09:24 +04:00
|
|
|
switch (*m) {
|
|
|
|
case '\0':
|
2009-09-14 11:39:16 +04:00
|
|
|
return FALSE;
|
2005-10-22 08:09:24 +04:00
|
|
|
|
|
|
|
case '$':
|
2009-09-14 11:39:16 +04:00
|
|
|
if (is_special_global_name(++m, e, enc)) return TRUE;
|
2005-10-22 08:09:24 +04:00
|
|
|
goto id;
|
|
|
|
|
|
|
|
case '@':
|
|
|
|
if (*++m == '@') ++m;
|
|
|
|
goto id;
|
|
|
|
|
|
|
|
case '<':
|
|
|
|
switch (*++m) {
|
|
|
|
case '<': ++m; break;
|
|
|
|
case '=': if (*++m == '>') ++m; break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '>':
|
2005-12-19 17:33:11 +03:00
|
|
|
switch (*++m) {
|
|
|
|
case '>': case '=': ++m; break;
|
|
|
|
}
|
2005-10-22 08:09:24 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case '=':
|
|
|
|
switch (*++m) {
|
|
|
|
case '~': ++m; break;
|
|
|
|
case '=': if (*++m == '=') ++m; break;
|
2009-09-14 11:39:16 +04:00
|
|
|
default: return FALSE;
|
2005-10-22 08:09:24 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '*':
|
|
|
|
if (*++m == '*') ++m;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '+': case '-':
|
|
|
|
if (*++m == '@') ++m;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '|': case '^': case '&': case '/': case '%': case '~': case '`':
|
2005-12-19 17:33:11 +03:00
|
|
|
++m;
|
2005-10-22 08:09:24 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case '[':
|
2009-09-14 11:39:16 +04:00
|
|
|
if (*++m != ']') return FALSE;
|
2005-11-20 16:36:05 +03:00
|
|
|
if (*++m == '=') ++m;
|
2005-10-22 08:09:24 +04:00
|
|
|
break;
|
|
|
|
|
2008-02-04 08:51:21 +03:00
|
|
|
case '!':
|
|
|
|
switch (*++m) {
|
2009-09-14 11:39:16 +04:00
|
|
|
case '\0': return TRUE;
|
2008-02-04 08:51:21 +03:00
|
|
|
case '=': case '~': ++m; break;
|
2009-09-14 11:39:16 +04:00
|
|
|
default: return FALSE;
|
2008-02-04 08:51:21 +03:00
|
|
|
}
|
|
|
|
break;
|
2008-08-10 07:15:37 +04:00
|
|
|
|
2005-10-22 08:09:24 +04:00
|
|
|
default:
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
localid = !rb_enc_isupper(*m, enc);
|
2005-10-22 08:09:24 +04:00
|
|
|
id:
|
2007-12-08 05:50:43 +03:00
|
|
|
if (m >= e || (*m != '_' && !rb_enc_isalpha(*m, enc) && ISASCII(*m)))
|
2009-09-14 11:39:16 +04:00
|
|
|
return FALSE;
|
2007-12-08 05:50:43 +03:00
|
|
|
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
|
2005-10-22 08:09:24 +04:00
|
|
|
if (localid) {
|
|
|
|
switch (*m) {
|
|
|
|
case '!': case '?': case '=': ++m;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-08-30 11:39:10 +04:00
|
|
|
return m == e;
|
2005-10-22 08:09:24 +04:00
|
|
|
}
|
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
static ID
|
|
|
|
register_symid(ID id, const char *name, long len, rb_encoding *enc)
|
|
|
|
{
|
|
|
|
VALUE str = rb_enc_str_new(name, len, enc);
|
|
|
|
OBJ_FREEZE(str);
|
|
|
|
st_add_direct(global_symbols.sym_id, (st_data_t)str, id);
|
|
|
|
st_add_direct(global_symbols.id_str, id, (st_data_t)str);
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
ID
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
rb_intern3(const char *name, long len, rb_encoding *enc)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2007-06-21 18:16:00 +04:00
|
|
|
const char *m = name;
|
2007-09-06 16:33:45 +04:00
|
|
|
const char *e = m + len;
|
2008-08-14 12:57:07 +04:00
|
|
|
unsigned char c;
|
2007-06-27 20:45:56 +04:00
|
|
|
VALUE str;
|
2000-05-22 11:29:50 +04:00
|
|
|
ID id;
|
2009-09-14 11:39:16 +04:00
|
|
|
long last;
|
2007-10-03 11:58:50 +04:00
|
|
|
int mb;
|
2010-03-17 22:41:00 +03:00
|
|
|
st_data_t data;
|
2007-06-27 20:45:56 +04:00
|
|
|
struct RString fake_str;
|
|
|
|
fake_str.basic.flags = T_STRING|RSTRING_NOEMBED|FL_FREEZE;
|
|
|
|
fake_str.basic.klass = rb_cString;
|
|
|
|
fake_str.as.heap.len = len;
|
2007-06-27 21:05:03 +04:00
|
|
|
fake_str.as.heap.ptr = (char *)name;
|
2007-06-27 20:45:56 +04:00
|
|
|
fake_str.as.heap.aux.capa = len;
|
2007-09-26 13:39:08 +04:00
|
|
|
str = (VALUE)&fake_str;
|
|
|
|
rb_enc_associate(str, enc);
|
2007-06-27 20:45:56 +04:00
|
|
|
|
2010-03-16 19:26:04 +03:00
|
|
|
if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
|
|
|
|
rb_raise(rb_eEncodingError, "invalid encoding symbol");
|
|
|
|
}
|
|
|
|
|
2010-03-17 22:41:00 +03:00
|
|
|
if (st_lookup(global_symbols.sym_id, str, &data))
|
|
|
|
return (ID)data;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2008-02-29 12:19:15 +03:00
|
|
|
if (rb_cString && !rb_enc_asciicompat(enc)) {
|
|
|
|
id = ID_JUNK;
|
|
|
|
goto new_id;
|
|
|
|
}
|
2006-09-02 19:05:27 +04:00
|
|
|
last = len-1;
|
1999-01-20 07:59:39 +03:00
|
|
|
id = 0;
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
switch (*m) {
|
1998-01-16 15:13:05 +03:00
|
|
|
case '$':
|
|
|
|
id |= ID_GLOBAL;
|
2007-10-03 11:58:50 +04:00
|
|
|
if ((mb = is_special_global_name(++m, e, enc)) != 0) {
|
2008-01-28 12:03:09 +03:00
|
|
|
if (!--mb) enc = rb_ascii8bit_encoding();
|
2007-10-03 11:58:50 +04:00
|
|
|
goto new_id;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
case '@':
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (m[1] == '@') {
|
2001-06-05 11:50:59 +04:00
|
|
|
m++;
|
2000-03-23 11:37:35 +03:00
|
|
|
id |= ID_CLASS;
|
2001-06-05 11:50:59 +04:00
|
|
|
}
|
|
|
|
else {
|
2000-02-18 09:59:36 +03:00
|
|
|
id |= ID_INSTANCE;
|
2001-06-05 11:50:59 +04:00
|
|
|
}
|
|
|
|
m++;
|
1998-01-16 15:13:05 +03:00
|
|
|
break;
|
|
|
|
default:
|
2008-08-14 12:57:07 +04:00
|
|
|
c = m[0];
|
|
|
|
if (c != '_' && rb_enc_isascii(c, enc) && rb_enc_ispunct(c, enc)) {
|
2001-06-05 11:50:59 +04:00
|
|
|
/* operators */
|
1998-01-16 15:13:05 +03:00
|
|
|
int i;
|
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
if (len == 1) {
|
|
|
|
id = c;
|
|
|
|
goto id_register;
|
|
|
|
}
|
|
|
|
for (i = 0; i < op_tbl_count; i++) {
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (*op_tbl[i].name == *m &&
|
|
|
|
strcmp(op_tbl[i].name, m) == 0) {
|
1999-01-20 07:59:39 +03:00
|
|
|
id = op_tbl[i].token;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
goto id_register;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (m[last] == '=') {
|
1998-01-16 15:13:05 +03:00
|
|
|
/* attribute assignment */
|
2007-10-03 11:58:50 +04:00
|
|
|
id = rb_intern3(name, last, enc);
|
2002-12-24 11:53:56 +03:00
|
|
|
if (id > tLAST_TOKEN && !is_attrset_id(id)) {
|
2007-10-03 11:58:50 +04:00
|
|
|
enc = rb_enc_get(rb_id2str(id));
|
1999-01-20 07:59:39 +03:00
|
|
|
id = rb_id_attrset(id);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
goto id_register;
|
1999-01-20 07:59:39 +03:00
|
|
|
}
|
1999-10-12 08:53:36 +04:00
|
|
|
id = ID_ATTRSET;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
else if (rb_enc_isupper(m[0], enc)) {
|
1999-12-14 09:50:43 +03:00
|
|
|
id = ID_CONST;
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
else {
|
1999-01-20 07:59:39 +03:00
|
|
|
id = ID_LOCAL;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2007-10-03 11:58:50 +04:00
|
|
|
mb = 0;
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
if (!rb_enc_isdigit(*m, enc)) {
|
2007-09-06 16:33:45 +04:00
|
|
|
while (m <= name + last && is_identchar(m, e, enc)) {
|
2008-01-21 22:47:26 +03:00
|
|
|
if (ISASCII(*m)) {
|
|
|
|
m++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mb = 1;
|
|
|
|
m += rb_enc_mbclen(m, e, enc);
|
|
|
|
}
|
2007-06-19 23:43:59 +04:00
|
|
|
}
|
2001-06-05 11:50:59 +04:00
|
|
|
}
|
2007-06-21 18:16:00 +04:00
|
|
|
if (m - name < len) id = ID_JUNK;
|
2008-01-23 19:05:57 +03:00
|
|
|
if (enc != rb_usascii_encoding()) {
|
2007-12-05 09:25:56 +03:00
|
|
|
/*
|
|
|
|
* this clause makes sense only when called from other than
|
|
|
|
* rb_intern_str() taking care of code-range.
|
|
|
|
*/
|
2007-10-03 11:58:50 +04:00
|
|
|
if (!mb) {
|
|
|
|
for (; m <= name + len; ++m) {
|
|
|
|
if (!ISASCII(*m)) goto mbstr;
|
|
|
|
}
|
2008-01-23 19:05:57 +03:00
|
|
|
enc = rb_usascii_encoding();
|
2007-10-03 11:58:50 +04:00
|
|
|
}
|
|
|
|
mbstr:;
|
|
|
|
}
|
2005-10-22 08:09:24 +04:00
|
|
|
new_id:
|
2009-10-15 13:26:15 +04:00
|
|
|
if (global_symbols.last_id >= ~(ID)0 >> (ID_SCOPE_SHIFT+RUBY_SPECIAL_SHIFT)) {
|
2009-10-15 11:57:40 +04:00
|
|
|
if (len > 20) {
|
|
|
|
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.20s...)",
|
|
|
|
name);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rb_raise(rb_eRuntimeError, "symbol table overflow (symbol %.*s)",
|
|
|
|
(int)len, name);
|
|
|
|
}
|
|
|
|
}
|
2005-07-13 17:44:21 +04:00
|
|
|
id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 01:20:17 +04:00
|
|
|
id_register:
|
2008-08-14 12:57:07 +04:00
|
|
|
return register_symid(id, name, len, enc);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
ID
|
|
|
|
rb_intern2(const char *name, long len)
|
|
|
|
{
|
2008-02-11 20:46:52 +03:00
|
|
|
return rb_intern3(name, len, rb_usascii_encoding());
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
}
|
|
|
|
|
2008-01-04 20:21:53 +03:00
|
|
|
#undef rb_intern
|
2006-09-02 19:05:27 +04:00
|
|
|
ID
|
|
|
|
rb_intern(const char *name)
|
|
|
|
{
|
|
|
|
return rb_intern2(name, strlen(name));
|
|
|
|
}
|
|
|
|
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
ID
|
|
|
|
rb_intern_str(VALUE str)
|
|
|
|
{
|
2008-02-11 20:46:52 +03:00
|
|
|
rb_encoding *enc;
|
2007-09-26 23:46:58 +04:00
|
|
|
ID id;
|
|
|
|
|
2008-02-11 20:46:52 +03:00
|
|
|
if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
|
|
|
|
enc = rb_usascii_encoding();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
enc = rb_enc_get(str);
|
2007-09-26 23:46:58 +04:00
|
|
|
}
|
2008-02-11 20:46:52 +03:00
|
|
|
id = rb_intern3(RSTRING_PTR(str), RSTRING_LEN(str), enc);
|
2007-09-23 03:58:03 +04:00
|
|
|
RB_GC_GUARD(str);
|
|
|
|
return id;
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
}
|
|
|
|
|
2006-09-02 19:05:27 +04:00
|
|
|
VALUE
|
2007-02-02 16:19:44 +03:00
|
|
|
rb_id2str(ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2005-10-20 17:15:19 +04:00
|
|
|
st_data_t data;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-12-24 11:53:56 +03:00
|
|
|
if (id < tLAST_TOKEN) {
|
1998-01-16 15:13:05 +03:00
|
|
|
int i = 0;
|
|
|
|
|
2009-09-14 11:39:16 +04:00
|
|
|
if (id < INT_MAX && rb_ispunct((int)id)) {
|
2008-08-14 12:57:07 +04:00
|
|
|
VALUE str = global_symbols.op_sym[i = (int)id];
|
|
|
|
if (!str) {
|
|
|
|
char name[2];
|
|
|
|
name[0] = (char)id;
|
|
|
|
name[1] = 0;
|
|
|
|
str = rb_usascii_str_new(name, 1);
|
|
|
|
OBJ_FREEZE(str);
|
|
|
|
global_symbols.op_sym[i] = str;
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
for (i = 0; i < op_tbl_count; i++) {
|
2007-02-02 16:19:44 +03:00
|
|
|
if (op_tbl[i].token == id) {
|
|
|
|
VALUE str = global_symbols.op_sym[i];
|
|
|
|
if (!str) {
|
2008-01-28 17:51:23 +03:00
|
|
|
str = rb_usascii_str_new2(op_tbl[i].name);
|
2007-02-02 16:19:44 +03:00
|
|
|
OBJ_FREEZE(str);
|
|
|
|
global_symbols.op_sym[i] = str;
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-24 22:25:45 +03:00
|
|
|
if (st_lookup(global_symbols.id_str, id, &data)) {
|
|
|
|
VALUE str = (VALUE)data;
|
|
|
|
if (RBASIC(str)->klass == 0)
|
|
|
|
RBASIC(str)->klass = rb_cString;
|
|
|
|
return str;
|
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
if (is_attrset_id(id)) {
|
2000-06-05 12:46:59 +04:00
|
|
|
ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
|
2007-09-12 10:19:06 +04:00
|
|
|
VALUE str;
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-09-12 10:19:06 +04:00
|
|
|
while (!(str = rb_id2str(id2))) {
|
|
|
|
if (!is_local_id(id2)) return 0;
|
2000-06-05 12:46:59 +04:00
|
|
|
id2 = (id & ~ID_SCOPE_MASK) | ID_CONST;
|
|
|
|
}
|
2007-09-12 10:19:06 +04:00
|
|
|
str = rb_str_dup(str);
|
2007-09-13 08:47:10 +04:00
|
|
|
rb_str_cat(str, "=", 1);
|
2007-09-12 10:19:06 +04:00
|
|
|
rb_intern_str(str);
|
2007-12-24 22:25:45 +03:00
|
|
|
if (st_lookup(global_symbols.id_str, id, &data)) {
|
|
|
|
VALUE str = (VALUE)data;
|
|
|
|
if (RBASIC(str)->klass == 0)
|
|
|
|
RBASIC(str)->klass = rb_cString;
|
|
|
|
return str;
|
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
1999-01-20 07:59:39 +03:00
|
|
|
return 0;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2007-02-02 16:19:44 +03:00
|
|
|
const char *
|
|
|
|
rb_id2name(ID id)
|
|
|
|
{
|
|
|
|
VALUE str = rb_id2str(id);
|
|
|
|
|
|
|
|
if (!str) return 0;
|
|
|
|
return RSTRING_PTR(str);
|
|
|
|
}
|
|
|
|
|
2001-05-02 08:22:21 +04:00
|
|
|
static int
|
2006-09-02 19:05:27 +04:00
|
|
|
symbols_i(VALUE sym, ID value, VALUE ary)
|
2001-05-02 08:22:21 +04:00
|
|
|
{
|
2007-02-02 16:19:44 +03:00
|
|
|
rb_ary_push(ary, ID2SYM(value));
|
2001-05-02 08:22:21 +04:00
|
|
|
return ST_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2003-12-28 09:33:07 +03:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Symbol.all_symbols => array
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
*
|
2003-12-28 09:33:07 +03:00
|
|
|
* Returns an array of all the symbols currently in Ruby's symbol
|
|
|
|
* table.
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
*
|
2003-12-28 09:33:07 +03:00
|
|
|
* Symbol.all_symbols.size #=> 903
|
|
|
|
* Symbol.all_symbols[1,20] #=> [:floor, :ARGV, :Binding, :symlink,
|
* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci,
thread_pthread.ci, thread_win32.ci: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 08:25:10 +04:00
|
|
|
* :chown, :EOFError, :$;, :String,
|
|
|
|
* :LOCK_SH, :"setuid?", :$<,
|
|
|
|
* :default_proc, :compact, :extend,
|
2003-12-28 09:33:07 +03:00
|
|
|
* :Tms, :getwd, :$=, :ThreadGroup,
|
|
|
|
* :wait2, :$>]
|
|
|
|
*/
|
|
|
|
|
2001-05-02 08:22:21 +04:00
|
|
|
VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_sym_all_symbols(void)
|
2001-05-02 08:22:21 +04:00
|
|
|
{
|
2006-09-02 19:05:27 +04:00
|
|
|
VALUE ary = rb_ary_new2(global_symbols.sym_id->num_entries);
|
2001-05-02 08:22:21 +04:00
|
|
|
|
2006-09-02 19:05:27 +04:00
|
|
|
st_foreach(global_symbols.sym_id, symbols_i, ary);
|
2001-05-02 08:22:21 +04:00
|
|
|
return ary;
|
|
|
|
}
|
|
|
|
|
1999-11-17 10:30:37 +03:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_is_const_id(ID id)
|
1999-11-17 10:30:37 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return is_const_id(id);
|
1999-11-17 10:30:37 +03:00
|
|
|
}
|
|
|
|
|
2000-02-18 09:59:36 +03:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_is_class_id(ID id)
|
2000-02-18 09:59:36 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return is_class_id(id);
|
2000-02-18 09:59:36 +03:00
|
|
|
}
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_is_instance_id(ID id)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return is_instance_id(id);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
2001-09-20 10:23:50 +04:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_is_local_id(ID id)
|
2001-09-20 10:23:50 +04:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return is_local_id(id);
|
2001-09-20 10:23:50 +04:00
|
|
|
}
|
|
|
|
|
2002-10-23 14:17:30 +04:00
|
|
|
int
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_is_junk_id(ID id)
|
2002-10-23 14:17:30 +04:00
|
|
|
{
|
2009-09-14 11:39:16 +04:00
|
|
|
return is_junk_id(id);
|
2002-10-23 14:17:30 +04:00
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#endif /* !RIPPER */
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_initialize(struct parser_params *parser)
|
2004-09-17 13:24:13 +04:00
|
|
|
{
|
2004-12-29 23:41:04 +03:00
|
|
|
parser->eofp = Qfalse;
|
2004-09-17 13:24:13 +04:00
|
|
|
|
|
|
|
parser->parser_lex_strterm = 0;
|
|
|
|
parser->parser_cond_stack = 0;
|
|
|
|
parser->parser_cmdarg_stack = 0;
|
|
|
|
parser->parser_class_nest = 0;
|
2005-08-16 19:24:15 +04:00
|
|
|
parser->parser_paren_nest = 0;
|
|
|
|
parser->parser_lpar_beg = 0;
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_in_single = 0;
|
|
|
|
parser->parser_in_def = 0;
|
|
|
|
parser->parser_in_defined = 0;
|
|
|
|
parser->parser_compile_for_eval = 0;
|
|
|
|
parser->parser_cur_mid = 0;
|
|
|
|
parser->parser_tokenbuf = NULL;
|
|
|
|
parser->parser_tokidx = 0;
|
|
|
|
parser->parser_toksiz = 0;
|
|
|
|
parser->parser_heredoc_end = 0;
|
2009-09-14 11:39:16 +04:00
|
|
|
parser->parser_command_start = TRUE;
|
2008-08-04 11:48:52 +04:00
|
|
|
parser->parser_deferred_nodes = 0;
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_lex_pbeg = 0;
|
|
|
|
parser->parser_lex_p = 0;
|
|
|
|
parser->parser_lex_pend = 0;
|
2004-10-02 15:34:13 +04:00
|
|
|
parser->parser_lvtbl = 0;
|
2005-07-13 17:44:21 +04:00
|
|
|
parser->parser_ruby__end__seen = 0;
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
parser->parser_ruby_sourcefile = 0;
|
2007-12-25 15:34:21 +03:00
|
|
|
#ifndef RIPPER
|
|
|
|
parser->is_ripper = 0;
|
2004-12-29 23:41:04 +03:00
|
|
|
parser->parser_eval_tree_begin = 0;
|
|
|
|
parser->parser_eval_tree = 0;
|
|
|
|
#else
|
2007-12-25 15:34:21 +03:00
|
|
|
parser->is_ripper = 1;
|
|
|
|
parser->parser_ruby_sourcefile_string = Qnil;
|
2004-09-20 11:59:30 +04:00
|
|
|
parser->delayed = Qnil;
|
2004-12-29 23:41:04 +03:00
|
|
|
|
|
|
|
parser->result = Qnil;
|
|
|
|
parser->parsing_thread = Qnil;
|
2009-10-02 23:34:28 +04:00
|
|
|
parser->toplevel_p = TRUE;
|
2004-09-20 07:03:12 +04:00
|
|
|
#endif
|
2005-10-08 13:58:25 +04:00
|
|
|
#ifdef YYMALLOC
|
|
|
|
parser->heap = NULL;
|
|
|
|
#endif
|
2008-01-25 21:49:28 +03:00
|
|
|
parser->enc = rb_usascii_encoding();
|
2004-09-17 13:24:13 +04:00
|
|
|
}
|
|
|
|
|
2007-12-25 15:34:21 +03:00
|
|
|
#ifdef RIPPER
|
|
|
|
#define parser_mark ripper_parser_mark
|
|
|
|
#define parser_free ripper_parser_free
|
|
|
|
#endif
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_mark(void *ptr)
|
2004-09-17 13:24:13 +04:00
|
|
|
{
|
|
|
|
struct parser_params *p = (struct parser_params*)ptr;
|
|
|
|
|
|
|
|
rb_gc_mark((VALUE)p->parser_lex_strterm);
|
2008-08-04 11:48:52 +04:00
|
|
|
rb_gc_mark((VALUE)p->parser_deferred_nodes);
|
2004-09-17 13:24:13 +04:00
|
|
|
rb_gc_mark(p->parser_lex_input);
|
|
|
|
rb_gc_mark(p->parser_lex_lastline);
|
2007-11-09 17:33:18 +03:00
|
|
|
rb_gc_mark(p->parser_lex_nextline);
|
2004-12-29 23:41:04 +03:00
|
|
|
#ifndef RIPPER
|
2004-09-22 04:19:15 +04:00
|
|
|
rb_gc_mark((VALUE)p->parser_eval_tree_begin) ;
|
|
|
|
rb_gc_mark((VALUE)p->parser_eval_tree) ;
|
2005-07-13 17:44:21 +04:00
|
|
|
rb_gc_mark(p->debug_lines);
|
2004-12-29 23:41:04 +03:00
|
|
|
#else
|
2007-12-25 15:34:21 +03:00
|
|
|
rb_gc_mark(p->parser_ruby_sourcefile_string);
|
2004-12-29 23:41:04 +03:00
|
|
|
rb_gc_mark(p->delayed);
|
2005-11-29 17:57:18 +03:00
|
|
|
rb_gc_mark(p->value);
|
2004-12-29 23:41:04 +03:00
|
|
|
rb_gc_mark(p->result);
|
|
|
|
rb_gc_mark(p->parsing_thread);
|
2004-09-17 13:24:13 +04:00
|
|
|
#endif
|
2005-10-08 13:58:25 +04:00
|
|
|
#ifdef YYMALLOC
|
|
|
|
rb_gc_mark((VALUE)p->heap);
|
|
|
|
#endif
|
2004-09-17 13:24:13 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_free(void *ptr)
|
2004-09-17 13:24:13 +04:00
|
|
|
{
|
|
|
|
struct parser_params *p = (struct parser_params*)ptr;
|
2004-10-02 15:34:13 +04:00
|
|
|
struct local_vars *local, *prev;
|
2004-09-17 13:24:13 +04:00
|
|
|
|
|
|
|
if (p->parser_tokenbuf) {
|
2006-12-31 18:02:22 +03:00
|
|
|
xfree(p->parser_tokenbuf);
|
2004-10-02 15:34:13 +04:00
|
|
|
}
|
|
|
|
for (local = p->parser_lvtbl; local; local = prev) {
|
* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 14:15:15 +03:00
|
|
|
if (local->vars) xfree(local->vars);
|
2004-10-02 15:34:13 +04:00
|
|
|
prev = local->prev;
|
|
|
|
xfree(local);
|
2004-09-17 13:24:13 +04:00
|
|
|
}
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
#ifndef RIPPER
|
|
|
|
xfree(p->parser_ruby_sourcefile);
|
|
|
|
#endif
|
2004-10-02 15:34:13 +04:00
|
|
|
xfree(p);
|
2004-09-17 13:24:13 +04:00
|
|
|
}
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
static size_t
|
2009-09-09 06:11:35 +04:00
|
|
|
parser_memsize(const void *ptr)
|
2009-07-10 02:22:33 +04:00
|
|
|
{
|
|
|
|
struct parser_params *p = (struct parser_params*)ptr;
|
|
|
|
struct local_vars *local;
|
|
|
|
size_t size = sizeof(*p);
|
|
|
|
|
|
|
|
if (!ptr) return 0;
|
|
|
|
size += p->parser_toksiz;
|
|
|
|
for (local = p->parser_lvtbl; local; local = local->prev) {
|
|
|
|
size += sizeof(*local);
|
|
|
|
if (local->vars) size += local->vars->capa * sizeof(ID);
|
|
|
|
}
|
|
|
|
#ifndef RIPPER
|
|
|
|
if (p->parser_ruby_sourcefile) {
|
|
|
|
size += strlen(p->parser_ruby_sourcefile) + 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const rb_data_type_t parser_data_type = {
|
|
|
|
"parser",
|
|
|
|
parser_mark,
|
|
|
|
parser_free,
|
|
|
|
parser_memsize,
|
|
|
|
};
|
|
|
|
|
2007-11-13 15:41:41 +03:00
|
|
|
VALUE rb_parser_get_yydebug(VALUE);
|
|
|
|
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
|
|
|
|
2004-09-20 09:40:23 +04:00
|
|
|
#ifndef RIPPER
|
2009-05-16 04:30:16 +04:00
|
|
|
#undef rb_reserved_word
|
|
|
|
|
|
|
|
const struct kwtable *
|
|
|
|
rb_reserved_word(const char *str, unsigned int len)
|
|
|
|
{
|
|
|
|
return reserved_word(str, len);
|
|
|
|
}
|
|
|
|
|
2004-12-29 23:41:04 +03:00
|
|
|
static struct parser_params *
|
2005-09-26 16:01:29 +04:00
|
|
|
parser_new(void)
|
2004-09-17 13:24:13 +04:00
|
|
|
{
|
|
|
|
struct parser_params *p;
|
|
|
|
|
|
|
|
p = ALLOC_N(struct parser_params, 1);
|
|
|
|
MEMZERO(p, struct parser_params, 1);
|
|
|
|
parser_initialize(p);
|
|
|
|
return p;
|
|
|
|
}
|
2004-12-29 23:41:04 +03:00
|
|
|
|
2005-07-13 17:44:21 +04:00
|
|
|
VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_parser_new(void)
|
2004-12-29 23:41:04 +03:00
|
|
|
{
|
|
|
|
struct parser_params *p = parser_new();
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
return TypedData_Wrap_Struct(0, &parser_data_type, p);
|
2004-12-29 23:41:04 +03:00
|
|
|
}
|
2004-09-17 13:24:13 +04:00
|
|
|
|
2005-07-13 17:44:21 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#end_seen? -> Boolean
|
|
|
|
*
|
|
|
|
* Return if parsed source ended by +\_\_END\_\_+.
|
|
|
|
* This number starts from 1.
|
|
|
|
*/
|
|
|
|
VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
rb_parser_end_seen_p(VALUE vparser)
|
2005-07-13 17:44:21 +04:00
|
|
|
{
|
|
|
|
struct parser_params *parser;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
2005-07-13 17:44:21 +04:00
|
|
|
return ruby__end__seen ? Qtrue : Qfalse;
|
|
|
|
}
|
2005-10-08 13:58:25 +04:00
|
|
|
|
2007-10-17 00:07:20 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#encoding -> encoding
|
|
|
|
*
|
|
|
|
* Return encoding of the source.
|
|
|
|
*/
|
|
|
|
VALUE
|
|
|
|
rb_parser_encoding(VALUE vparser)
|
|
|
|
{
|
|
|
|
struct parser_params *parser;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
|
2007-10-17 00:07:20 +04:00
|
|
|
return rb_enc_from_encoding(parser->enc);
|
|
|
|
}
|
|
|
|
|
2007-11-13 15:41:41 +03:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper.yydebug -> true or false
|
|
|
|
*
|
|
|
|
* Get yydebug.
|
|
|
|
*/
|
|
|
|
VALUE
|
|
|
|
rb_parser_get_yydebug(VALUE self)
|
|
|
|
{
|
|
|
|
struct parser_params *parser;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2007-11-13 15:41:41 +03:00
|
|
|
return yydebug ? Qtrue : Qfalse;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper.yydebug = flag
|
|
|
|
*
|
|
|
|
* Set yydebug.
|
|
|
|
*/
|
|
|
|
VALUE
|
|
|
|
rb_parser_set_yydebug(VALUE self, VALUE flag)
|
|
|
|
{
|
|
|
|
struct parser_params *parser;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2007-11-13 15:41:41 +03:00
|
|
|
yydebug = RTEST(flag);
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
2005-10-08 13:58:25 +04:00
|
|
|
#ifdef YYMALLOC
|
2005-10-13 18:26:00 +04:00
|
|
|
#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
#define NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0)
|
|
|
|
#define ADD2HEAP(n, c, p) ((parser->heap = (n))->u1.node = (p), \
|
2005-11-30 17:52:30 +03:00
|
|
|
(n)->u3.cnt = (c), (p))
|
2005-10-08 13:58:25 +04:00
|
|
|
|
|
|
|
void *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_malloc(struct parser_params *parser, size_t size)
|
2005-10-08 13:58:25 +04:00
|
|
|
{
|
2005-11-30 17:52:30 +03:00
|
|
|
size_t cnt = HEAPCNT(1, size);
|
|
|
|
NODE *n = NEWHEAP();
|
|
|
|
void *ptr = xmalloc(size);
|
2005-10-08 13:58:25 +04:00
|
|
|
|
2005-11-30 17:52:30 +03:00
|
|
|
return ADD2HEAP(n, cnt, ptr);
|
2005-10-08 13:58:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_calloc(struct parser_params *parser, size_t nelem, size_t size)
|
2005-10-08 13:58:25 +04:00
|
|
|
{
|
2005-11-30 17:52:30 +03:00
|
|
|
size_t cnt = HEAPCNT(nelem, size);
|
|
|
|
NODE *n = NEWHEAP();
|
|
|
|
void *ptr = xcalloc(nelem, size);
|
2005-10-08 13:58:25 +04:00
|
|
|
|
2005-11-30 17:52:30 +03:00
|
|
|
return ADD2HEAP(n, cnt, ptr);
|
2005-10-08 13:58:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_realloc(struct parser_params *parser, void *ptr, size_t size)
|
2005-10-08 13:58:25 +04:00
|
|
|
{
|
|
|
|
NODE *n;
|
|
|
|
size_t cnt = HEAPCNT(1, size);
|
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
if (ptr && (n = parser->heap) != NULL) {
|
2005-10-08 13:58:25 +04:00
|
|
|
do {
|
|
|
|
if (n->u1.node == ptr) {
|
|
|
|
n->u1.node = ptr = xrealloc(ptr, size);
|
|
|
|
if (n->u3.cnt) n->u3.cnt = cnt;
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
} while ((n = n->u2.node) != NULL);
|
|
|
|
}
|
2005-11-30 17:52:30 +03:00
|
|
|
n = NEWHEAP();
|
|
|
|
ptr = xrealloc(ptr, size);
|
|
|
|
return ADD2HEAP(n, cnt, ptr);
|
2005-10-08 13:58:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
rb_parser_free(struct parser_params *parser, void *ptr)
|
2005-10-08 13:58:25 +04:00
|
|
|
{
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 12:12:18 +04:00
|
|
|
NODE **prev = &parser->heap, *n;
|
2005-10-08 13:58:25 +04:00
|
|
|
|
2005-10-20 17:15:19 +04:00
|
|
|
while ((n = *prev) != NULL) {
|
2005-10-08 13:58:25 +04:00
|
|
|
if (n->u1.node == ptr) {
|
|
|
|
*prev = n->u2.node;
|
|
|
|
rb_gc_force_recycle((VALUE)n);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
prev = &n->u2.node;
|
|
|
|
}
|
|
|
|
xfree(ptr);
|
|
|
|
}
|
|
|
|
#endif
|
2005-07-28 16:49:31 +04:00
|
|
|
#endif
|
2005-07-13 17:44:21 +04:00
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER
|
|
|
|
#ifdef RIPPER_DEBUG
|
2005-09-25 04:39:22 +04:00
|
|
|
extern int rb_is_pointer_to_heap(VALUE);
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2004-10-20 05:38:04 +04:00
|
|
|
/* :nodoc: */
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_validate_object(VALUE self, VALUE x)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
if (x == Qfalse) return x;
|
|
|
|
if (x == Qtrue) return x;
|
|
|
|
if (x == Qnil) return x;
|
|
|
|
if (x == Qundef)
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "Qundef given");
|
2004-09-12 19:21:49 +04:00
|
|
|
if (FIXNUM_P(x)) return x;
|
|
|
|
if (SYMBOL_P(x)) return x;
|
|
|
|
if (!rb_is_pointer_to_heap(x))
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "invalid pointer: %p", x);
|
2004-09-12 19:21:49 +04:00
|
|
|
switch (TYPE(x)) {
|
|
|
|
case T_STRING:
|
|
|
|
case T_OBJECT:
|
|
|
|
case T_ARRAY:
|
|
|
|
case T_BIGNUM:
|
|
|
|
case T_FLOAT:
|
2006-12-31 18:02:22 +03:00
|
|
|
return x;
|
2004-09-12 19:21:49 +04:00
|
|
|
case T_NODE:
|
2009-10-02 15:37:44 +04:00
|
|
|
if (nd_type(x) != NODE_LASGN) {
|
|
|
|
rb_raise(rb_eArgError, "NODE given: %p", x);
|
|
|
|
}
|
|
|
|
return ((NODE *)x)->nd_rval;
|
2004-09-12 19:21:49 +04:00
|
|
|
default:
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "wrong type of ruby object: %p (%s)",
|
|
|
|
x, rb_obj_classname(x));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
#define validate(x) (x = get_value(x))
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch0(struct parser_params *parser, ID mid)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
return rb_funcall(parser->value, mid, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch1(struct parser_params *parser, ID mid, VALUE a)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
validate(a);
|
|
|
|
return rb_funcall(parser->value, mid, 1, a);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch2(struct parser_params *parser, ID mid, VALUE a, VALUE b)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
validate(a);
|
|
|
|
validate(b);
|
|
|
|
return rb_funcall(parser->value, mid, 2, a, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch3(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
validate(a);
|
|
|
|
validate(b);
|
|
|
|
validate(c);
|
|
|
|
return rb_funcall(parser->value, mid, 3, a, b, c);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch4(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c, VALUE d)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
validate(a);
|
|
|
|
validate(b);
|
|
|
|
validate(c);
|
|
|
|
validate(d);
|
|
|
|
return rb_funcall(parser->value, mid, 4, a, b, c, d);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_dispatch5(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c, VALUE d, VALUE e)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
validate(a);
|
|
|
|
validate(b);
|
|
|
|
validate(c);
|
|
|
|
validate(d);
|
|
|
|
validate(e);
|
|
|
|
return rb_funcall(parser->value, mid, 5, a, b, c, d, e);
|
|
|
|
}
|
|
|
|
|
2007-07-06 09:57:14 +04:00
|
|
|
static const struct kw_assoc {
|
2004-09-12 19:21:49 +04:00
|
|
|
ID id;
|
|
|
|
const char *name;
|
|
|
|
} keyword_to_name[] = {
|
2006-06-26 18:15:49 +04:00
|
|
|
{keyword_class, "class"},
|
|
|
|
{keyword_module, "module"},
|
|
|
|
{keyword_def, "def"},
|
|
|
|
{keyword_undef, "undef"},
|
|
|
|
{keyword_begin, "begin"},
|
|
|
|
{keyword_rescue, "rescue"},
|
|
|
|
{keyword_ensure, "ensure"},
|
|
|
|
{keyword_end, "end"},
|
|
|
|
{keyword_if, "if"},
|
|
|
|
{keyword_unless, "unless"},
|
|
|
|
{keyword_then, "then"},
|
|
|
|
{keyword_elsif, "elsif"},
|
|
|
|
{keyword_else, "else"},
|
|
|
|
{keyword_case, "case"},
|
|
|
|
{keyword_when, "when"},
|
|
|
|
{keyword_while, "while"},
|
|
|
|
{keyword_until, "until"},
|
|
|
|
{keyword_for, "for"},
|
|
|
|
{keyword_break, "break"},
|
|
|
|
{keyword_next, "next"},
|
|
|
|
{keyword_redo, "redo"},
|
|
|
|
{keyword_retry, "retry"},
|
|
|
|
{keyword_in, "in"},
|
|
|
|
{keyword_do, "do"},
|
|
|
|
{keyword_do_cond, "do"},
|
|
|
|
{keyword_do_block, "do"},
|
|
|
|
{keyword_return, "return"},
|
|
|
|
{keyword_yield, "yield"},
|
|
|
|
{keyword_super, "super"},
|
|
|
|
{keyword_self, "self"},
|
|
|
|
{keyword_nil, "nil"},
|
|
|
|
{keyword_true, "true"},
|
|
|
|
{keyword_false, "false"},
|
|
|
|
{keyword_and, "and"},
|
|
|
|
{keyword_or, "or"},
|
|
|
|
{keyword_not, "not"},
|
|
|
|
{modifier_if, "if"},
|
|
|
|
{modifier_unless, "unless"},
|
|
|
|
{modifier_while, "while"},
|
|
|
|
{modifier_until, "until"},
|
|
|
|
{modifier_rescue, "rescue"},
|
|
|
|
{keyword_alias, "alias"},
|
|
|
|
{keyword_defined, "defined?"},
|
|
|
|
{keyword_BEGIN, "BEGIN"},
|
|
|
|
{keyword_END, "END"},
|
|
|
|
{keyword__LINE__, "__LINE__"},
|
|
|
|
{keyword__FILE__, "__FILE__"},
|
2008-01-26 17:42:17 +03:00
|
|
|
{keyword__ENCODING__, "__ENCODING__"},
|
2004-09-12 19:21:49 +04:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char*
|
2005-09-26 16:01:29 +04:00
|
|
|
keyword_id_to_str(ID id)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2007-07-06 09:57:14 +04:00
|
|
|
const struct kw_assoc *a;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
for (a = keyword_to_name; a->id; a++) {
|
2006-12-31 18:02:22 +03:00
|
|
|
if (a->id == id)
|
|
|
|
return a->name;
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
#undef ripper_id2sym
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_id2sym(ID id)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
char buf[8];
|
|
|
|
|
|
|
|
if (id <= 256) {
|
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 04:29:17 +03:00
|
|
|
buf[0] = (char)id;
|
2006-12-31 18:02:22 +03:00
|
|
|
buf[1] = '\0';
|
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 04:29:17 +03:00
|
|
|
return ID2SYM(rb_intern2(buf, 1));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
if ((name = keyword_id_to_str(id))) {
|
2006-12-31 18:02:22 +03:00
|
|
|
return ID2SYM(rb_intern(name));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
switch (id) {
|
2007-06-19 23:43:59 +04:00
|
|
|
case tOROP:
|
2006-12-31 18:02:22 +03:00
|
|
|
name = "||";
|
|
|
|
break;
|
2007-06-19 23:43:59 +04:00
|
|
|
case tANDOP:
|
2006-12-31 18:02:22 +03:00
|
|
|
name = "&&";
|
|
|
|
break;
|
2007-06-19 23:43:59 +04:00
|
|
|
default:
|
2006-12-31 18:02:22 +03:00
|
|
|
name = rb_id2name(id);
|
|
|
|
if (!name) {
|
|
|
|
rb_bug("cannot convert ID to string: %ld", (unsigned long)id);
|
|
|
|
}
|
2009-08-15 05:40:10 +04:00
|
|
|
return ID2SYM(id);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
return ID2SYM(rb_intern(name));
|
|
|
|
}
|
|
|
|
|
2009-10-02 15:37:44 +04:00
|
|
|
static ID
|
|
|
|
ripper_get_id(VALUE v)
|
|
|
|
{
|
|
|
|
NODE *nd;
|
|
|
|
if (!RB_TYPE_P(v, T_NODE)) return 0;
|
|
|
|
nd = (NODE *)v;
|
|
|
|
if (nd_type(nd) != NODE_LASGN) return 0;
|
|
|
|
return nd->nd_vid;
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
|
|
|
ripper_get_value(VALUE v)
|
|
|
|
{
|
|
|
|
NODE *nd;
|
|
|
|
if (!RB_TYPE_P(v, T_NODE)) return v;
|
|
|
|
nd = (NODE *)v;
|
|
|
|
if (nd_type(nd) != NODE_LASGN) return Qnil;
|
|
|
|
return nd->nd_rval;
|
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
static void
|
2004-09-17 13:24:13 +04:00
|
|
|
ripper_compile_error(struct parser_params *parser, const char *fmt, ...)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2005-07-23 05:02:18 +04:00
|
|
|
VALUE str;
|
2004-09-12 19:21:49 +04:00
|
|
|
va_list args;
|
|
|
|
|
2005-09-26 16:01:29 +04:00
|
|
|
va_start(args, fmt);
|
2005-07-23 05:02:18 +04:00
|
|
|
str = rb_vsprintf(fmt, args);
|
2004-09-12 19:21:49 +04:00
|
|
|
va_end(args);
|
2005-07-23 05:02:18 +04:00
|
|
|
rb_funcall(parser->value, rb_intern("compile_error"), 1, str);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_warn0(struct parser_params *parser, const char *fmt)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
rb_funcall(parser->value, rb_intern("warn"), 1, STR_NEW2(fmt));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_warnI(struct parser_params *parser, const char *fmt, int a)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
rb_funcall(parser->value, rb_intern("warn"), 2,
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
STR_NEW2(fmt), INT2NUM(a));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
2008-05-17 06:39:43 +04:00
|
|
|
#if 0
|
2004-09-12 19:21:49 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_warnS(struct parser_params *parser, const char *fmt, const char *str)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
rb_funcall(parser->value, rb_intern("warn"), 2,
|
2008-05-17 06:39:43 +04:00
|
|
|
STR_NEW2(fmt), STR_NEW2(str));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2008-05-17 06:39:43 +04:00
|
|
|
#endif
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_warning0(struct parser_params *parser, const char *fmt)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 07:29:39 +04:00
|
|
|
rb_funcall(parser->value, rb_intern("warning"), 1, STR_NEW2(fmt));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
2005-07-28 06:33:28 +04:00
|
|
|
static void
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_warningS(struct parser_params *parser, const char *fmt, const char *str)
|
2005-07-28 06:33:28 +04:00
|
|
|
{
|
|
|
|
rb_funcall(parser->value, rb_intern("warning"), 2,
|
2008-05-15 17:38:21 +04:00
|
|
|
STR_NEW2(fmt), STR_NEW2(str));
|
2005-07-28 06:33:28 +04:00
|
|
|
}
|
|
|
|
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_lex_get_generic(struct parser_params *parser, VALUE src)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
return rb_funcall(src, ripper_id_gets, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_s_allocate(VALUE klass)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *p;
|
2004-09-12 19:21:49 +04:00
|
|
|
VALUE self;
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
p = ALLOC_N(struct parser_params, 1);
|
|
|
|
MEMZERO(p, struct parser_params, 1);
|
2009-07-10 02:22:33 +04:00
|
|
|
self = TypedData_Wrap_Struct(klass, &parser_data_type, p);
|
2004-09-12 19:21:49 +04:00
|
|
|
p->value = self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2004-09-17 13:24:13 +04:00
|
|
|
#define ripper_initialized_p(r) ((r)->parser_lex_input != 0)
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2004-09-14 17:11:29 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Ripper.new(src, filename="(ripper)", lineno=1) -> ripper
|
|
|
|
*
|
|
|
|
* Create a new Ripper object.
|
2008-12-13 02:59:36 +03:00
|
|
|
* _src_ must be a String, an IO, or an Object which has #gets method.
|
2004-09-14 17:11:29 +04:00
|
|
|
*
|
|
|
|
* This method does not starts parsing.
|
|
|
|
* See also Ripper#parse and Ripper.parse.
|
|
|
|
*/
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_initialize(int argc, VALUE *argv, VALUE self)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
VALUE src, fname, lineno;
|
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
|
2005-10-11 16:42:50 +04:00
|
|
|
if (rb_obj_respond_to(src, ripper_id_gets, 0)) {
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_lex_gets = ripper_lex_get_generic;
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
else {
|
2006-12-31 18:02:22 +03:00
|
|
|
StringValue(src);
|
|
|
|
parser->parser_lex_gets = lex_get_str;
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_lex_input = src;
|
2004-09-12 19:21:49 +04:00
|
|
|
parser->eofp = Qfalse;
|
|
|
|
if (NIL_P(fname)) {
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
fname = STR_NEW2("(ripper)");
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
else {
|
2006-12-31 18:02:22 +03:00
|
|
|
StringValue(fname);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
2004-09-17 13:24:13 +04:00
|
|
|
parser_initialize(parser);
|
2007-12-25 15:34:21 +03:00
|
|
|
|
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 07:41:51 +04:00
|
|
|
parser->parser_ruby_sourcefile_string = fname;
|
|
|
|
parser->parser_ruby_sourcefile = RSTRING_PTR(fname);
|
2004-09-17 13:24:13 +04:00
|
|
|
parser->parser_ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
return Qnil;
|
|
|
|
}
|
|
|
|
|
2005-09-25 04:39:22 +04:00
|
|
|
extern VALUE rb_thread_pass(void);
|
2004-09-12 19:21:49 +04:00
|
|
|
|
|
|
|
struct ripper_args {
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
int argc;
|
|
|
|
VALUE *argv;
|
|
|
|
};
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_parse0(VALUE parser_v)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, parser);
|
2005-05-14 06:48:07 +04:00
|
|
|
parser_prepare(parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
ripper_yyparse((void*)parser);
|
|
|
|
return parser->result;
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_ensure(VALUE parser_v)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
parser->parsing_thread = Qnil;
|
|
|
|
return Qnil;
|
|
|
|
}
|
|
|
|
|
2004-09-14 17:11:29 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#parse
|
|
|
|
*
|
|
|
|
* Start parsing and returns the value of the root action.
|
|
|
|
*/
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_parse(VALUE self)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
if (!ripper_initialized_p(parser)) {
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "method called for uninitialized object");
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
if (!NIL_P(parser->parsing_thread)) {
|
2006-12-31 18:02:22 +03:00
|
|
|
if (parser->parsing_thread == rb_thread_current())
|
|
|
|
rb_raise(rb_eArgError, "Ripper#parse is not reentrant");
|
|
|
|
else
|
|
|
|
rb_raise(rb_eArgError, "Ripper#parse is not multithread-safe");
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
parser->parsing_thread = rb_thread_current();
|
|
|
|
rb_ensure(ripper_parse0, self, ripper_ensure, self);
|
|
|
|
|
|
|
|
return parser->result;
|
|
|
|
}
|
|
|
|
|
2004-09-14 17:11:29 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#column -> Integer
|
|
|
|
*
|
|
|
|
* Return column number of current parsing line.
|
|
|
|
* This number starts from 0.
|
|
|
|
*/
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_column(VALUE self)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-20 07:03:12 +04:00
|
|
|
long col;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
if (!ripper_initialized_p(parser)) {
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "method called for uninitialized object");
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
if (NIL_P(parser->parsing_thread)) return Qnil;
|
2004-09-20 08:23:18 +04:00
|
|
|
col = parser->tokp - parser->parser_lex_pbeg;
|
2004-09-20 07:03:12 +04:00
|
|
|
return LONG2NUM(col);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
2009-10-27 02:11:59 +03:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#filename -> String
|
|
|
|
*
|
|
|
|
* Return current parsing filename.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
ripper_filename(VALUE self)
|
|
|
|
{
|
|
|
|
struct parser_params *parser;
|
|
|
|
|
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
|
|
|
if (!ripper_initialized_p(parser)) {
|
|
|
|
rb_raise(rb_eArgError, "method called for uninitialized object");
|
|
|
|
}
|
|
|
|
return parser->parser_ruby_sourcefile_string;
|
|
|
|
}
|
|
|
|
|
2004-09-14 17:11:29 +04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* ripper#lineno -> Integer
|
|
|
|
*
|
|
|
|
* Return line number of current parsing line.
|
|
|
|
* This number starts from 1.
|
|
|
|
*/
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_lineno(VALUE self)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
2004-09-17 13:24:13 +04:00
|
|
|
struct parser_params *parser;
|
2004-09-12 19:21:49 +04:00
|
|
|
|
2009-07-10 02:22:33 +04:00
|
|
|
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
|
2004-09-12 19:21:49 +04:00
|
|
|
if (!ripper_initialized_p(parser)) {
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_raise(rb_eArgError, "method called for uninitialized object");
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
if (NIL_P(parser->parsing_thread)) return Qnil;
|
2004-09-17 13:24:13 +04:00
|
|
|
return INT2NUM(parser->parser_ruby_sourceline);
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef RIPPER_DEBUG
|
2004-10-20 05:38:04 +04:00
|
|
|
/* :nodoc: */
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_assert_Qundef(VALUE self, VALUE obj, VALUE msg)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
StringValue(msg);
|
|
|
|
if (obj == Qundef) {
|
2006-10-14 18:33:10 +04:00
|
|
|
rb_raise(rb_eArgError, "%s", RSTRING_PTR(msg));
|
2004-09-12 19:21:49 +04:00
|
|
|
}
|
|
|
|
return Qnil;
|
|
|
|
}
|
|
|
|
|
2004-10-20 05:38:04 +04:00
|
|
|
/* :nodoc: */
|
2004-09-12 19:21:49 +04:00
|
|
|
static VALUE
|
2005-09-26 16:01:29 +04:00
|
|
|
ripper_value(VALUE self, VALUE obj)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
return ULONG2NUM(obj);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
2005-09-24 01:37:38 +04:00
|
|
|
Init_ripper(void)
|
2004-09-12 19:21:49 +04:00
|
|
|
{
|
|
|
|
VALUE Ripper;
|
|
|
|
|
|
|
|
Ripper = rb_define_class("Ripper", rb_cObject);
|
2008-01-28 17:51:23 +03:00
|
|
|
rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_define_alloc_func(Ripper, ripper_s_allocate);
|
|
|
|
rb_define_method(Ripper, "initialize", ripper_initialize, -1);
|
|
|
|
rb_define_method(Ripper, "parse", ripper_parse, 0);
|
|
|
|
rb_define_method(Ripper, "column", ripper_column, 0);
|
2009-10-27 02:11:59 +03:00
|
|
|
rb_define_method(Ripper, "filename", ripper_filename, 0);
|
2004-09-12 19:21:49 +04:00
|
|
|
rb_define_method(Ripper, "lineno", ripper_lineno, 0);
|
2005-07-13 17:44:21 +04:00
|
|
|
rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
|
2007-10-17 00:07:20 +04:00
|
|
|
rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
|
2007-11-13 15:41:41 +03:00
|
|
|
rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
|
|
|
|
rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
|
2004-09-12 19:21:49 +04:00
|
|
|
#ifdef RIPPER_DEBUG
|
|
|
|
rb_define_method(rb_mKernel, "assert_Qundef", ripper_assert_Qundef, 2);
|
|
|
|
rb_define_method(rb_mKernel, "rawVALUE", ripper_value, 1);
|
|
|
|
rb_define_method(rb_mKernel, "validate_object", ripper_validate_object, 1);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ripper_id_gets = rb_intern("gets");
|
2005-09-24 01:37:38 +04:00
|
|
|
ripper_init_eventids1(Ripper);
|
|
|
|
ripper_init_eventids2(Ripper);
|
2004-09-12 19:21:49 +04:00
|
|
|
/* ensure existing in symbol table */
|
|
|
|
rb_intern("||");
|
|
|
|
rb_intern("&&");
|
|
|
|
}
|
|
|
|
#endif /* RIPPER */
|