no assignment of function expression statements to script result
This commit is contained in:
igor%mir2.org 2003-02-25 09:15:08 +00:00
Родитель 058ee62667
Коммит 8ebcc7f9af
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -102,6 +102,10 @@ public class IRFactory {
return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno); return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno);
} }
public Object createExprStatementNoReturn(Object expr, int lineno) {
return new Node(TokenStream.POP, (Node) expr, lineno);
}
/** /**
* Name * Name
*/ */

Просмотреть файл

@ -300,7 +300,7 @@ class Parser {
// The following can be removed but then code generators should // The following can be removed but then code generators should
// be modified not to push on the stack function expression // be modified not to push on the stack function expression
// statements // statements
pn = nf.createExprStatement(pn, baseLineno); pn = nf.createExprStatementNoReturn(pn, baseLineno);
} }
// Add EOL but only if function is not part of expression, in which // Add EOL but only if function is not part of expression, in which
// case it gets SEMI + EOL from Statement. // case it gets SEMI + EOL from Statement.