1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (struct parser_params): lex_gets_ptr should be long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-05-27 14:00:40 +00:00
parent 6fc35dffb4
commit 51bf0388aa
2 changed files with 12 additions and 13 deletions

View file

@ -1,3 +1,7 @@
Wed May 27 23:00:38 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (struct parser_params): lex_gets_ptr should be long.
Wed May 27 02:31:38 2009 NARUSE, Yui <naruse@ruby-lang.org>
* ext/readline/readline.c (readline_getc): the function for

21
parse.y
View file

@ -221,7 +221,7 @@ struct parser_params {
int parser_heredoc_end;
int parser_command_start;
NODE *parser_deferred_nodes;
int parser_lex_gets_ptr;
long parser_lex_gets_ptr;
VALUE (*parser_lex_gets)(struct parser_params*,VALUE);
struct local_vars *parser_lvtbl;
int parser_ruby__end__seen;
@ -5347,7 +5347,7 @@ parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp,
}
lex_p += numlen;
if (regexp_literal) {
tokcopy(numlen);
tokcopy((int)numlen);
}
else if (codepoint >= 0x80) {
*encp = UTF8_ENC();
@ -5504,6 +5504,7 @@ parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
{
int c;
int flags = 0;
size_t numlen;
first:
switch (c = nextc()) {
@ -5514,25 +5515,19 @@ parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
case '4': case '5': case '6': case '7':
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
{
size_t numlen;
int oct;
oct = scan_oct(--lex_p, 3, &numlen);
scan_oct(--lex_p, 3, &numlen);
if (numlen == 0) goto eof;
lex_p += numlen;
tokcopy(numlen + 1);
tokcopy((int)numlen + 1);
}
return 0;
case 'x': /* hex constant */
if (flags & (ESCAPE_CONTROL|ESCAPE_META)) goto eof;
{
size_t numlen;
int hex;
hex = tok_hex(&numlen);
tok_hex(&numlen);
if (numlen == 0) goto eof;
tokcopy(numlen + 2);
tokcopy((int)numlen + 2);
}
return 0;
@ -5647,7 +5642,7 @@ parser_tokadd_string(struct parser_params *parser,
static const char mixed_msg[] = "%s mixed within %s source";
#define mixed_error(enc1, enc2) if (!errbuf) { \
int len = sizeof(mixed_msg) - 4; \
size_t len = sizeof(mixed_msg) - 4; \
len += strlen(rb_enc_name(enc1)); \
len += strlen(rb_enc_name(enc2)); \
errbuf = ALLOCA_N(char, len); \