mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (parser_encoding_name): defined.
(parser_tokadd_mbchar): show encoding in the message of "invalid multibyte char" error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
03e778757b
commit
2eb763857d
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Sep 3 20:01:01 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* parse.y (parser_encoding_name): defined.
|
||||
(parser_tokadd_mbchar): show encoding in the message of
|
||||
"invalid multibyte char" error.
|
||||
|
||||
Wed Sep 3 19:28:04 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (vm_method_missing): C99.
|
||||
|
|
3
parse.y
3
parse.y
|
@ -4670,6 +4670,7 @@ ripper_dispatch_delayed_token(struct parser_params *parser, int t)
|
|||
# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
|
||||
#endif
|
||||
|
||||
#define parser_encoding_name() (parser->enc->name)
|
||||
#define parser_mbclen() mbclen((lex_p-1),lex_pend,parser->enc)
|
||||
#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))
|
||||
|
@ -5498,7 +5499,7 @@ parser_tokadd_mbchar(struct parser_params *parser, int c)
|
|||
{
|
||||
int len = parser_precise_mbclen();
|
||||
if (!MBCLEN_CHARFOUND_P(len)) {
|
||||
compile_error(PARSER_ARG "invalid multibyte char");
|
||||
compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
|
||||
return -1;
|
||||
}
|
||||
tokadd(c);
|
||||
|
|
Loading…
Add table
Reference in a new issue