_VariableStatement

in doc-src/parsejs/lib/parsejs/grammar.kpeg.rb [2591:2664]


  def _VariableStatement

    _save = self.pos
    while true # sequence
      _tmp = apply(:_VarTok)
      unless _tmp
        self.pos = _save
        break
      end
      _tmp = apply(:__hyphen_)
      unless _tmp
        self.pos = _save
        break
      end
      _tmp = apply(:_VariableDeclaration)
      decl = @result
      unless _tmp
        self.pos = _save
        break
      end
      _ary = []
      while true

        _save2 = self.pos
        while true # sequence
          _tmp = apply(:__hyphen_)
          unless _tmp
            self.pos = _save2
            break
          end
          _tmp = match_string(",")
          unless _tmp
            self.pos = _save2
            break
          end
          _tmp = apply(:__hyphen_)
          unless _tmp
            self.pos = _save2
            break
          end
          _tmp = apply(:_VariableDeclaration)
          unless _tmp
            self.pos = _save2
          end
          break
        end # end sequence

        _ary << @result if _tmp
        break unless _tmp
      end
      _tmp = true
      @result = _ary
      decls = @result
      unless _tmp
        self.pos = _save
        break
      end
      _tmp = apply(:_EOS)
      unless _tmp
        self.pos = _save
        break
      end
      @result = begin; variable_declaration("var", [decl] + decls, true); end
      _tmp = true
      unless _tmp
        self.pos = _save
      end
      break
    end # end sequence

    set_failed_rule :_VariableStatement unless _tmp
    return _tmp
  end