summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 14:46:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 14:46:25 +0000
commit306cf3ac0328cb52fad1371115aa5c3ab226b982 (patch)
treef48d4853223b8d310841e3cfa71155997220b73d /parse.y
parent57d06d7b3f019bf3823548630da41c785828da22 (diff)
parse.y: valid suffix word only
* parse.y (parser_str_options): use valid suffix word only, as well as numeric literal, for the backward comatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 3 insertions, 10 deletions
diff --git a/parse.y b/parse.y
index a167d8c087..064e977e9a 100644
--- a/parse.y
+++ b/parse.y
@@ -6000,8 +6000,8 @@ static int
parser_str_options(struct parser_params *parser)
{
int c, options = 0;
+ const char *save_p = lex_p;
- newtok();
while (c = nextc(), ISALPHA(c)) {
switch (c) {
#if STR_OPTION_FROZEN
@@ -6015,18 +6015,11 @@ parser_str_options(struct parser_params *parser)
break;
#endif
default:
- tokadd(c);
- break;
+ lex_p = save_p;
+ return 0;
}
}
pushback(c);
-
- if (toklen()) {
- tokfix();
- compile_error(PARSER_ARG "unknown string option%s - %s",
- toklen() > 1 ? "s" : "", tok());
- }
-
return options;
}