зеркало из https://github.com/github/ruby.git
* debug.c, parse.y: fixed types.
* node.h (nd_line): limit to int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3ab03a234d
Коммит
4f041dafbe
|
@ -1,3 +1,9 @@
|
|||
Mon Sep 14 16:39:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* debug.c, parse.y: fixed types.
|
||||
|
||||
* node.h (nd_line): limit to int.
|
||||
|
||||
Mon Sep 14 11:23:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in, common.mk, */configure.bat (rdoc): make before
|
||||
|
|
6
debug.c
6
debug.c
|
@ -77,9 +77,9 @@ ruby_debug_print_indent(int level, int debug_level, int indent_level)
|
|||
if (level < debug_level) {
|
||||
fprintf(stderr, "%*s", indent_level, "");
|
||||
fflush(stderr);
|
||||
return Qtrue;
|
||||
return TRUE;
|
||||
}
|
||||
return Qfalse;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -124,7 +124,7 @@ NODE *
|
|||
ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
|
||||
{
|
||||
if (level < debug_level) {
|
||||
fprintf(stderr, "DBG> %s: %s (%lu)\n", header,
|
||||
fprintf(stderr, "DBG> %s: %s (%u)\n", header,
|
||||
ruby_node_name(nd_type(node)), nd_line(node));
|
||||
}
|
||||
return (NODE *)node;
|
||||
|
|
|
@ -170,6 +170,7 @@ int rb_enc_tolower(int c, rb_encoding *enc);
|
|||
ID rb_intern3(const char*, long, rb_encoding*);
|
||||
ID rb_interned_id_p(const char *, long, rb_encoding *);
|
||||
int rb_enc_symname_p(const char*, rb_encoding*);
|
||||
int rb_enc_symname2_p(const char*, long, rb_encoding*);
|
||||
int rb_enc_str_coderange(VALUE);
|
||||
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
|
||||
int rb_enc_str_asciionly_p(VALUE);
|
||||
|
|
2
node.h
2
node.h
|
@ -272,7 +272,7 @@ typedef struct RNode {
|
|||
|
||||
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
|
||||
#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
|
||||
#define nd_line(n) (RNODE(n)->flags>>NODE_LSHIFT)
|
||||
#define nd_line(n) (int)(RNODE(n)->flags>>NODE_LSHIFT)
|
||||
#define nd_set_line(n,l) \
|
||||
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
|
||||
|
||||
|
|
144
parse.y
144
parse.y
|
@ -26,6 +26,8 @@
|
|||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
|
||||
|
||||
#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)
|
||||
|
@ -443,7 +445,6 @@ 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)
|
||||
int rb_enc_symname2_p(const char *, int, rb_encoding *);
|
||||
#else
|
||||
#define remove_begin(node) (node)
|
||||
#endif /* !RIPPER */
|
||||
|
@ -3344,7 +3345,7 @@ block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_f_block_arg
|
|||
opt_block_param : none
|
||||
| block_param_def
|
||||
{
|
||||
command_start = Qtrue;
|
||||
command_start = TRUE;
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -4174,7 +4175,7 @@ f_arglist : '(' f_args rparen
|
|||
$$ = dispatch1(paren, $2);
|
||||
%*/
|
||||
lex_state = EXPR_BEG;
|
||||
command_start = Qtrue;
|
||||
command_start = TRUE;
|
||||
}
|
||||
| f_args term
|
||||
{
|
||||
|
@ -4968,9 +4969,7 @@ coverage(const char *f, int n)
|
|||
static int
|
||||
e_option_supplied(struct parser_params *parser)
|
||||
{
|
||||
if (strcmp(ruby_sourcefile, "-e") == 0)
|
||||
return Qtrue;
|
||||
return Qfalse;
|
||||
return strcmp(ruby_sourcefile, "-e") == 0;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -5023,7 +5022,7 @@ yycompile(struct parser_params *parser, const char *f, int line)
|
|||
{
|
||||
ruby_sourcefile = ruby_strdup(f);
|
||||
ruby_sourceline = line - 1;
|
||||
return (NODE *)ruby_suppress_tracing(yycompile0, (VALUE)parser, Qtrue);
|
||||
return (NODE *)ruby_suppress_tracing(yycompile0, (VALUE)parser, TRUE);
|
||||
}
|
||||
#endif /* !RIPPER */
|
||||
|
||||
|
@ -5445,7 +5444,7 @@ parser_read_escape(struct parser_params *parser, int flags,
|
|||
case '4': case '5': case '6': case '7':
|
||||
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
|
||||
pushback(c);
|
||||
c = ruby_scan_oct(lex_p, 3, &numlen);
|
||||
c = scan_oct(lex_p, 3, &numlen);
|
||||
lex_p += numlen;
|
||||
return c;
|
||||
|
||||
|
@ -5778,7 +5777,7 @@ parser_tokadd_string(struct parser_params *parser,
|
|||
static int
|
||||
parser_parse_string(struct parser_params *parser, NODE *quote)
|
||||
{
|
||||
int func = quote->nd_func;
|
||||
int func = (int)quote->nd_func;
|
||||
int term = nd_term(quote);
|
||||
int paren = nd_paren(quote);
|
||||
int c, space = 0;
|
||||
|
@ -5839,7 +5838,8 @@ parser_parse_string(struct parser_params *parser, NODE *quote)
|
|||
static int
|
||||
parser_heredoc_identifier(struct parser_params *parser)
|
||||
{
|
||||
int c = nextc(), term, func = 0, len;
|
||||
int c = nextc(), term, func = 0;
|
||||
long len;
|
||||
|
||||
if (c == '-') {
|
||||
c = nextc();
|
||||
|
@ -5927,18 +5927,17 @@ parser_heredoc_restore(struct parser_params *parser, NODE *here)
|
|||
|
||||
static int
|
||||
parser_whole_match_p(struct parser_params *parser,
|
||||
const char *eos, int len, int indent)
|
||||
const char *eos, long len, int indent)
|
||||
{
|
||||
const char *p = lex_pbeg;
|
||||
int n;
|
||||
long n;
|
||||
|
||||
if (indent) {
|
||||
while (*p && ISSPACE(*p)) p++;
|
||||
}
|
||||
n= lex_pend - (p + len);
|
||||
if (n < 0 || (n > 0 && p[len] != '\n' && p[len] != '\r')) return Qfalse;
|
||||
if (strncmp(eos, p, len) == 0) return Qtrue;
|
||||
return Qfalse;
|
||||
n = lex_pend - (p + len);
|
||||
if (n < 0 || (n > 0 && p[len] != '\n' && p[len] != '\r')) return FALSE;
|
||||
return strncmp(eos, p, len) == 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -6058,10 +6057,10 @@ lvar_defined_gen(struct parser_params *parser, ID id)
|
|||
}
|
||||
|
||||
/* emacsen -*- hack */
|
||||
static int
|
||||
parser_encode_length(struct parser_params *parser, const char *name, int len)
|
||||
static long
|
||||
parser_encode_length(struct parser_params *parser, const char *name, long len)
|
||||
{
|
||||
int nlen;
|
||||
long nlen;
|
||||
|
||||
if (len > 5 && name[nlen = len - 5] == '-') {
|
||||
if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0)
|
||||
|
@ -6115,7 +6114,7 @@ comment_at_top(struct parser_params *parser)
|
|||
}
|
||||
|
||||
#ifndef RIPPER
|
||||
typedef int (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, int len);
|
||||
typedef long (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);
|
||||
typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);
|
||||
|
||||
static void
|
||||
|
@ -6140,9 +6139,9 @@ static const struct magic_comment magic_comments[] = {
|
|||
#endif
|
||||
|
||||
static const char *
|
||||
magic_comment_marker(const char *str, int len)
|
||||
magic_comment_marker(const char *str, long len)
|
||||
{
|
||||
int i = 2;
|
||||
long i = 2;
|
||||
|
||||
while (i < len) {
|
||||
switch (str[i]) {
|
||||
|
@ -6173,7 +6172,7 @@ magic_comment_marker(const char *str, int len)
|
|||
}
|
||||
|
||||
static int
|
||||
parser_magic_comment(struct parser_params *parser, const char *str, int len)
|
||||
parser_magic_comment(struct parser_params *parser, const char *str, long len)
|
||||
{
|
||||
VALUE name = 0, val = 0;
|
||||
const char *beg, *end, *vbeg, *vend;
|
||||
|
@ -6182,9 +6181,9 @@ parser_magic_comment(struct parser_params *parser, const char *str, int len)
|
|||
MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
|
||||
: ((_s) = STR_NEW((_p), (_n))))
|
||||
|
||||
if (len <= 7) return Qfalse;
|
||||
if (!(beg = magic_comment_marker(str, len))) return Qfalse;
|
||||
if (!(end = magic_comment_marker(beg, str + len - beg))) return Qfalse;
|
||||
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;
|
||||
str = beg;
|
||||
len = end - beg - 3;
|
||||
|
||||
|
@ -6194,7 +6193,8 @@ parser_magic_comment(struct parser_params *parser, const char *str, int len)
|
|||
const struct magic_comment *p = magic_comments;
|
||||
#endif
|
||||
char *s;
|
||||
int i, n = 0;
|
||||
int i;
|
||||
long n = 0;
|
||||
|
||||
for (; len > 0 && *str; str++, --len) {
|
||||
switch (*str) {
|
||||
|
@ -6255,13 +6255,13 @@ parser_magic_comment(struct parser_params *parser, const char *str, int len)
|
|||
(*p->func)(parser, s, RSTRING_PTR(val));
|
||||
break;
|
||||
}
|
||||
} while (++p < magic_comments + sizeof(magic_comments) / sizeof(*p));
|
||||
} while (++p < magic_comments + numberof(magic_comments));
|
||||
#else
|
||||
dispatch2(magic_comment, name, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
return Qtrue;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -6368,7 +6368,7 @@ parser_yylex(struct parser_params *parser)
|
|||
return token;
|
||||
}
|
||||
cmd_state = command_start;
|
||||
command_start = Qfalse;
|
||||
command_start = FALSE;
|
||||
retry:
|
||||
switch (c = nextc()) {
|
||||
case '\0': /* NUL */
|
||||
|
@ -6454,7 +6454,7 @@ parser_yylex(struct parser_params *parser)
|
|||
}
|
||||
}
|
||||
normal_newline:
|
||||
command_start = Qtrue;
|
||||
command_start = TRUE;
|
||||
lex_state = EXPR_BEG;
|
||||
return '\n';
|
||||
|
||||
|
@ -6905,7 +6905,7 @@ parser_yylex(struct parser_params *parser)
|
|||
yyerror("numeric literal without digits");
|
||||
}
|
||||
else if (nondigit) goto trailing_uc;
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 16, Qfalse));
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 16, FALSE));
|
||||
return tINTEGER;
|
||||
}
|
||||
if (c == 'b' || c == 'B') {
|
||||
|
@ -6929,7 +6929,7 @@ parser_yylex(struct parser_params *parser)
|
|||
yyerror("numeric literal without digits");
|
||||
}
|
||||
else if (nondigit) goto trailing_uc;
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 2, Qfalse));
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 2, FALSE));
|
||||
return tINTEGER;
|
||||
}
|
||||
if (c == 'd' || c == 'D') {
|
||||
|
@ -6953,7 +6953,7 @@ parser_yylex(struct parser_params *parser)
|
|||
yyerror("numeric literal without digits");
|
||||
}
|
||||
else if (nondigit) goto trailing_uc;
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 10, Qfalse));
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE));
|
||||
return tINTEGER;
|
||||
}
|
||||
if (c == '_') {
|
||||
|
@ -6985,7 +6985,7 @@ parser_yylex(struct parser_params *parser)
|
|||
pushback(c);
|
||||
tokfix();
|
||||
if (nondigit) goto trailing_uc;
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 8, Qfalse));
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 8, FALSE));
|
||||
return tINTEGER;
|
||||
}
|
||||
if (nondigit) {
|
||||
|
@ -7084,7 +7084,7 @@ parser_yylex(struct parser_params *parser)
|
|||
set_yylval_literal(DBL2NUM(d));
|
||||
return tFLOAT;
|
||||
}
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 10, Qfalse));
|
||||
set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE));
|
||||
return tINTEGER;
|
||||
}
|
||||
|
||||
|
@ -7173,7 +7173,7 @@ parser_yylex(struct parser_params *parser)
|
|||
|
||||
case ';':
|
||||
lex_state = EXPR_BEG;
|
||||
command_start = Qtrue;
|
||||
command_start = TRUE;
|
||||
return ';';
|
||||
|
||||
case ',':
|
||||
|
@ -7248,7 +7248,7 @@ parser_yylex(struct parser_params *parser)
|
|||
COND_PUSH(0);
|
||||
CMDARG_PUSH(0);
|
||||
lex_state = EXPR_BEG;
|
||||
if (c != tLBRACE) command_start = Qtrue;
|
||||
if (c != tLBRACE) command_start = TRUE;
|
||||
return c;
|
||||
|
||||
case '\\':
|
||||
|
@ -7569,7 +7569,7 @@ parser_yylex(struct parser_params *parser)
|
|||
return kw->id[0];
|
||||
}
|
||||
if (kw->id[0] == keyword_do) {
|
||||
command_start = Qtrue;
|
||||
command_start = TRUE;
|
||||
if (lpar_beg && lpar_beg == paren_nest) {
|
||||
lpar_beg = 0;
|
||||
--paren_nest;
|
||||
|
@ -8234,7 +8234,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
|
|||
case NODE_DEFN:
|
||||
case NODE_DEFS:
|
||||
parser_warning(node, "void value expression");
|
||||
return Qfalse;
|
||||
return FALSE;
|
||||
|
||||
case NODE_RETURN:
|
||||
case NODE_BREAK:
|
||||
|
@ -8243,7 +8243,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
|
|||
case NODE_RETRY:
|
||||
if (!cond) yyerror("void value expression");
|
||||
/* or "control never reach"? */
|
||||
return Qfalse;
|
||||
return FALSE;
|
||||
|
||||
case NODE_BLOCK:
|
||||
while (node->nd_next) {
|
||||
|
@ -8265,7 +8265,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
|
|||
node = node->nd_body;
|
||||
break;
|
||||
}
|
||||
if (!value_expr(node->nd_body)) return Qfalse;
|
||||
if (!value_expr(node->nd_body)) return FALSE;
|
||||
node = node->nd_else;
|
||||
break;
|
||||
|
||||
|
@ -8276,11 +8276,11 @@ value_expr_gen(struct parser_params *parser, NODE *node)
|
|||
break;
|
||||
|
||||
default:
|
||||
return Qtrue;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return Qtrue;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -8411,7 +8411,7 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
|
|||
(reduce_nodes(&node->n1), body = &node->n2, 1))
|
||||
|
||||
while (node) {
|
||||
int newline = node->flags & NODE_FL_NEWLINE;
|
||||
int newline = (int)(node->flags & NODE_FL_NEWLINE);
|
||||
switch (nd_type(node)) {
|
||||
end:
|
||||
case NODE_NIL:
|
||||
|
@ -8521,7 +8521,7 @@ fixup_nodes(NODE **rootnode)
|
|||
case NODE_DOT2:
|
||||
case NODE_DOT3:
|
||||
val = rb_range_new(head->nd_beg->nd_lit, head->nd_end->nd_lit,
|
||||
type == NODE_DOT3 ? Qtrue : Qfalse);
|
||||
type == NODE_DOT3);
|
||||
rb_gc_force_recycle((VALUE)head->nd_beg);
|
||||
rb_gc_force_recycle((VALUE)head->nd_end);
|
||||
nd_set_type(head, NODE_LIT);
|
||||
|
@ -8640,9 +8640,9 @@ static NODE*
|
|||
logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *right)
|
||||
{
|
||||
value_expr(left);
|
||||
if (left && nd_type(left) == type) {
|
||||
if (left && (enum node_type)nd_type(left) == type) {
|
||||
NODE *node = left, *second;
|
||||
while ((second = node->nd_2nd) != 0 && nd_type(second) == type) {
|
||||
while ((second = node->nd_2nd) != 0 && (enum node_type)nd_type(second) == type) {
|
||||
node = second;
|
||||
}
|
||||
node->nd_2nd = NEW_NODE(type, second, right, 0);
|
||||
|
@ -8963,7 +8963,7 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
|
|||
reg_named_capture_assign_t *arg = (reg_named_capture_assign_t*)arg0;
|
||||
struct parser_params* parser = arg->parser;
|
||||
rb_encoding *enc = arg->enc;
|
||||
int len = name_end - name;
|
||||
long len = name_end - name;
|
||||
const char *s = (const char *)name;
|
||||
ID var;
|
||||
|
||||
|
@ -8975,7 +8975,8 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
|
|||
}
|
||||
|
||||
if (!len || (*name != '_' && ISASCII(*name) && !rb_enc_islower(*name, enc)) ||
|
||||
rb_reserved_word(s, len) || !rb_enc_symname2_p(s, len, enc)) {
|
||||
(len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) ||
|
||||
!rb_enc_symname2_p(s, len, enc)) {
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
var = rb_intern3(s, len, enc);
|
||||
|
@ -9155,7 +9156,7 @@ static const struct {
|
|||
{tCOLON2, "::"},
|
||||
};
|
||||
|
||||
#define op_tbl_count (sizeof(op_tbl) / sizeof(op_tbl[0]))
|
||||
#define op_tbl_count numberof(op_tbl)
|
||||
|
||||
#ifndef ENABLE_SELECTOR_NAMESPACE
|
||||
#define ENABLE_SELECTOR_NAMESPACE 0
|
||||
|
@ -9277,19 +9278,19 @@ rb_enc_symname_p(const char *name, rb_encoding *enc)
|
|||
}
|
||||
|
||||
int
|
||||
rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
|
||||
rb_enc_symname2_p(const char *name, long len, rb_encoding *enc)
|
||||
{
|
||||
const char *m = name;
|
||||
const char *e = m + len;
|
||||
int localid = Qfalse;
|
||||
int localid = FALSE;
|
||||
|
||||
if (!m) return Qfalse;
|
||||
if (!m) return FALSE;
|
||||
switch (*m) {
|
||||
case '\0':
|
||||
return Qfalse;
|
||||
return FALSE;
|
||||
|
||||
case '$':
|
||||
if (is_special_global_name(++m, e, enc)) return Qtrue;
|
||||
if (is_special_global_name(++m, e, enc)) return TRUE;
|
||||
goto id;
|
||||
|
||||
case '@':
|
||||
|
@ -9314,7 +9315,7 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
|
|||
switch (*++m) {
|
||||
case '~': ++m; break;
|
||||
case '=': if (*++m == '=') ++m; break;
|
||||
default: return Qfalse;
|
||||
default: return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -9331,15 +9332,15 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
|
|||
break;
|
||||
|
||||
case '[':
|
||||
if (*++m != ']') return Qfalse;
|
||||
if (*++m != ']') return FALSE;
|
||||
if (*++m == '=') ++m;
|
||||
break;
|
||||
|
||||
case '!':
|
||||
switch (*++m) {
|
||||
case '\0': return Qtrue;
|
||||
case '\0': return TRUE;
|
||||
case '=': case '~': ++m; break;
|
||||
default: return Qfalse;
|
||||
default: return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -9347,7 +9348,7 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
|
|||
localid = !rb_enc_isupper(*m, enc);
|
||||
id:
|
||||
if (m >= e || (*m != '_' && !rb_enc_isalpha(*m, enc) && ISASCII(*m)))
|
||||
return Qfalse;
|
||||
return FALSE;
|
||||
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
|
||||
if (localid) {
|
||||
switch (*m) {
|
||||
|
@ -9377,7 +9378,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
|
|||
unsigned char c;
|
||||
VALUE str;
|
||||
ID id;
|
||||
int last;
|
||||
long last;
|
||||
int mb;
|
||||
struct RString fake_str;
|
||||
fake_str.basic.flags = T_STRING|RSTRING_NOEMBED|FL_FREEZE;
|
||||
|
@ -9522,7 +9523,7 @@ rb_id2str(ID id)
|
|||
if (id < tLAST_TOKEN) {
|
||||
int i = 0;
|
||||
|
||||
if (rb_ispunct(id)) {
|
||||
if (id < INT_MAX && rb_ispunct((int)id)) {
|
||||
VALUE str = global_symbols.op_sym[i = (int)id];
|
||||
if (!str) {
|
||||
char name[2];
|
||||
|
@ -9619,36 +9620,31 @@ rb_sym_all_symbols(void)
|
|||
int
|
||||
rb_is_const_id(ID id)
|
||||
{
|
||||
if (is_const_id(id)) return Qtrue;
|
||||
return Qfalse;
|
||||
return is_const_id(id);
|
||||
}
|
||||
|
||||
int
|
||||
rb_is_class_id(ID id)
|
||||
{
|
||||
if (is_class_id(id)) return Qtrue;
|
||||
return Qfalse;
|
||||
return is_class_id(id);
|
||||
}
|
||||
|
||||
int
|
||||
rb_is_instance_id(ID id)
|
||||
{
|
||||
if (is_instance_id(id)) return Qtrue;
|
||||
return Qfalse;
|
||||
return is_instance_id(id);
|
||||
}
|
||||
|
||||
int
|
||||
rb_is_local_id(ID id)
|
||||
{
|
||||
if (is_local_id(id)) return Qtrue;
|
||||
return Qfalse;
|
||||
return is_local_id(id);
|
||||
}
|
||||
|
||||
int
|
||||
rb_is_junk_id(ID id)
|
||||
{
|
||||
if (is_junk_id(id)) return Qtrue;
|
||||
return Qfalse;
|
||||
return is_junk_id(id);
|
||||
}
|
||||
|
||||
#endif /* !RIPPER */
|
||||
|
@ -9673,7 +9669,7 @@ parser_initialize(struct parser_params *parser)
|
|||
parser->parser_tokidx = 0;
|
||||
parser->parser_toksiz = 0;
|
||||
parser->parser_heredoc_end = 0;
|
||||
parser->parser_command_start = Qtrue;
|
||||
parser->parser_command_start = TRUE;
|
||||
parser->parser_deferred_nodes = 0;
|
||||
parser->parser_lex_pbeg = 0;
|
||||
parser->parser_lex_p = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче