Lines Matching defs:stmt
344 bool Analysis::DetectVarDeclarationWithoutScope(const Statement& stmt, ErrorReporter* errors) {
348 if (stmt.is<VarDeclaration>()) {
350 var = &stmt.as<VarDeclaration>().var();
351 } else if (stmt.is<Block>()) {
353 const Block& block = stmt.as<Block>();
371 errors->error(stmt.fLine, "variable '" + var->name() + "' must be created in a scope");
380 bool Analysis::StatementWritesToVariable(const Statement& stmt, const Variable& var) {
381 return VariableWriteVisitor(&var).visit(stmt);
550 bool visitStatement(const Statement& stmt) override {
552 switch (stmt.kind()) {
554 if (stmt.as<IfStatement>().isStatic()) {
555 fContext.fErrors->error(stmt.fLine, "static if has non-static test");
560 if (stmt.as<SwitchStatement>().isStatic()) {
561 fContext.fErrors->error(stmt.fLine,
570 return INHERITED::visitStatement(stmt);
720 for (auto& stmt : s.template as<Block>().children()) {
721 if (stmt && this->visitStatementPtr(stmt)) {