mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
* parse.y (parser_yylex): dot at the head of the line denote line
continuation from previous one to support fluent interface. [experimental] * misc/ruby-mode.el (ruby-calculate-indent): support fluent dot. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
012b58b121
commit
bbe0af6be1
3 changed files with 37 additions and 6 deletions
19
parse.y
19
parse.y
|
@ -5863,6 +5863,25 @@ parser_yylex(struct parser_params *parser)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
while ((c = nextc())) {
|
||||
switch (c) {
|
||||
case ' ': case '\t': case '\f': case '\r':
|
||||
case '\13': /* '\v' */
|
||||
space_seen++;
|
||||
break;
|
||||
case '.': {
|
||||
if ((c = nextc()) != '.') {
|
||||
pushback(c);
|
||||
pushback('.');
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
default:
|
||||
pushback(c);
|
||||
goto normal_newline;
|
||||
}
|
||||
}
|
||||
normal_newline:
|
||||
command_start = Qtrue;
|
||||
lex_state = EXPR_BEG;
|
||||
return '\n';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue