visitStmt()

in lib/generator.js [1137:1173]


  visitStmt(ast, level, env) {
    let comments = DSL.comment.getFrontComments(this.comments, ast.tokenRange[0]);
    this.visitComments(comments, level);
    if (ast.type === 'return') {
      this.visitReturn(ast, level, env);
    } else if (ast.type === 'yield') {
      this.visitYield(ast, level, env);
    } else if (ast.type === 'if') {
      this.visitIf(ast, level, env);
    } else if (ast.type === 'throw') {
      this.visitThrow(ast, level, env);
    } else if (ast.type === 'assign') {
      this.visitAssign(ast, level, env);
    } else if (ast.type === 'retry') {
      this.visitRetry(ast, level);
    } else if (ast.type === 'break') {
      this.emit('break;\n', level);
    } else if (ast.type === 'declare') {
      this.visitDeclare(ast, level, env);
    } else if (ast.type === 'while') {
      this.visitWhile(ast, level, env);
    } else if (ast.type === 'for') {
      this.visitFor(ast, level, env);
    } else if (ast.type === 'call') {
      this.emit('', level);
      this.visitExpr(ast, level, env);
      this.emit(';\n');
    } else if (ast.type === 'super') {
      //no need
    } else if (ast.type === 'try') {
      this.visitTry(ast, level, env);
    } else {
      this.emit('', level);
      this.visitExpr(ast, level, env);
      this.emit(';\n');
    }
  }