diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 07:25:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 07:25:08 +0000 |
commit | a6a85a0cb755f4e65fd15c2554c5bcd529c66ed9 () | |
tree | 35754fad15d6ece5bf7871c0bdea66aff4581494 | |
parent | 1a3bcf103c582b20e9ea70dfed0ee68b24243f55 (diff) |
parse.y: warn CR
* parse.y (parser_nextc): warn carriage return in middle of line. [ruby-core:56240] [Feature #8699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 15 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 7 |
3 files changed, 24 insertions, 3 deletions
@@ -1,3 +1,8 @@ Mon Aug 26 15:27:39 2013 Nobuyoshi Nakada <[email protected]> * lib/timeout.rb (Timeout#timeout): should not be caught by rescue @@ -270,6 +270,8 @@ struct parser_params { int parser_yydebug; #ifndef RIPPER /* Ruby core only */ NODE *parser_eval_tree_begin; @@ -5329,6 +5331,7 @@ yycompile0(VALUE arg) ruby_coverage = coverage(ruby_sourcefile_string, ruby_sourceline); } } parser_prepare(parser); deferred_nodes = 0; @@ -5611,9 +5614,15 @@ parser_nextc(struct parser_params *parser) } } c = (unsigned char)*lex_p++; - if (c == '\r' && peek('\n')) { - lex_p++; - c = '\n'; } return c; @@ -385,6 +385,13 @@ eom assert_syntax_error("__END__\r<<<<<\n", /unexpected <</) end private def not_label(x) @result = x; @not_label ||= nil end |