Commit ff6e4f8f authored by Chris Toshok's avatar Chris Toshok

skip expression statements that are constant strings (docstrings)

parent 704ec9a5
......@@ -611,7 +611,11 @@ Value ASTInterpreter::visit_stmt(AST_stmt* node) {
case AST_TYPE::Delete:
return visit_delete((AST_Delete*)node);
case AST_TYPE::Expr:
return visit_expr((AST_Expr*)node);
// docstrings are str constant expression statements.
// ignore those while interpreting.
if ((((AST_Expr*)node)->value)->type != AST_TYPE::Str)
return visit_expr((AST_Expr*)node);
break;
case AST_TYPE::FunctionDef:
return visit_functionDef((AST_FunctionDef*)node);
case AST_TYPE::Pass:
......
......@@ -1991,7 +1991,8 @@ private:
doDelete(ast_cast<AST_Delete>(node), unw_info);
break;
case AST_TYPE::Expr:
doExpr(ast_cast<AST_Expr>(node), unw_info);
if ((((AST_Expr*)node)->value)->type != AST_TYPE::Str)
doExpr(ast_cast<AST_Expr>(node), unw_info);
break;
case AST_TYPE::FunctionDef:
doFunctionDef(ast_cast<AST_FunctionDef>(node), unw_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment