empty heredoc node

This commit is contained in:
vadim 2017-12-06 14:52:40 +02:00
parent 6fd73af4a1
commit c744a6c170
2 changed files with 2 additions and 2 deletions

View File

@ -4510,7 +4510,7 @@ yydefault:
yyDollar = yyS[yypt-2 : yypt+1]
//line parser/parser.y:1011
{
yyVAL.node = node.NewSimpleNode("Scalar").Append(node.TokenNode("Heredoc", yyDollar[1].token)).Append(node.TokenNode("HeredocEnd", yyDollar[2].token))
yyVAL.node = scalar.NewEncapsed(yyDollar[1].token, nil, yyDollar[2].token)
}
case 407:
yyDollar = yyS[yypt-3 : yypt+1]

View File

@ -1008,7 +1008,7 @@ scalar:
| T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC
{ $$ = scalar.NewString($2) /* TODO: mark as Heredoc*/ }
| T_START_HEREDOC T_END_HEREDOC
{ $$ = node.NewSimpleNode("Scalar").Append(node.TokenNode("Heredoc", $1)).Append(node.TokenNode("HeredocEnd", $2)) }
{ $$ = scalar.NewEncapsed($1, nil, $2) }
| '"' encaps_list '"' { $$ = scalar.NewEncapsed($1, $2, $3) }
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = scalar.NewEncapsed($1, $2, $3) }
| dereferencable_scalar { $$ = $1; }