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

parse.y (parser_heredoc_dedent): Removed

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2018-01-14 14:44:46 +00:00
parent 07d356ee28
commit 5c0748b627

14
parse.y
View file

@ -440,8 +440,7 @@ static void reg_fragment_setenc(struct parser_params*, VALUE, int);
static int reg_fragment_check(struct parser_params*, VALUE, int); static int reg_fragment_check(struct parser_params*, VALUE, int);
static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc); static NODE *reg_named_capture_assign(struct parser_params* p, VALUE regexp, const YYLTYPE *loc);
static NODE *parser_heredoc_dedent(struct parser_params*,NODE*); static NODE *heredoc_dedent(struct parser_params*,NODE*);
# define heredoc_dedent(str) parser_heredoc_dedent(p, (str))
#define get_id(id) (id) #define get_id(id) (id)
#define get_value(val) (val) #define get_value(val) (val)
@ -710,8 +709,7 @@ new_args_tail(struct parser_params *p, VALUE k, VALUE kr, VALUE b, YYLTYPE *loc)
#define new_defined(p,expr,loc) dispatch1(defined, (expr)) #define new_defined(p,expr,loc) dispatch1(defined, (expr))
static VALUE parser_heredoc_dedent(struct parser_params*,VALUE); static VALUE heredoc_dedent(struct parser_params*,VALUE);
# define heredoc_dedent(str) parser_heredoc_dedent(p, (str))
#else #else
#define ID2VAL(id) ((VALUE)(id)) #define ID2VAL(id) ((VALUE)(id))
@ -3630,7 +3628,7 @@ string : tCHAR
string1 : tSTRING_BEG string_contents tSTRING_END string1 : tSTRING_BEG string_contents tSTRING_END
{ {
$$ = new_string1(heredoc_dedent($2)); $$ = new_string1(heredoc_dedent(p, $2));
/*%%%*/ /*%%%*/
if ($$) nd_set_loc($$, &@$); if ($$) nd_set_loc($$, &@$);
/*% /*%
@ -3640,7 +3638,7 @@ string1 : tSTRING_BEG string_contents tSTRING_END
xstring : tXSTRING_BEG xstring_contents tSTRING_END xstring : tXSTRING_BEG xstring_contents tSTRING_END
{ {
$$ = new_xstring(p, heredoc_dedent($2), &@$); $$ = new_xstring(p, heredoc_dedent(p, $2), &@$);
} }
; ;
@ -6473,7 +6471,7 @@ dedent_string(VALUE string, int width)
#ifndef RIPPER #ifndef RIPPER
static NODE * static NODE *
parser_heredoc_dedent(struct parser_params *p, NODE *root) heredoc_dedent(struct parser_params *p, NODE *root)
{ {
NODE *node, *str_node; NODE *node, *str_node;
int bol = TRUE; int bol = TRUE;
@ -6505,7 +6503,7 @@ parser_heredoc_dedent(struct parser_params *p, NODE *root)
} }
#else /* RIPPER */ #else /* RIPPER */
static VALUE static VALUE
parser_heredoc_dedent(struct parser_params *p, VALUE array) heredoc_dedent(struct parser_params *p, VALUE array)
{ {
int indent = p->heredoc_indent; int indent = p->heredoc_indent;