Module: ParseJS

Defined in:
lib/parsejs.rb,
lib/parsejs/ast.rb,
lib/parsejs/docs.rb,
lib/parsejs/scope.rb,
lib/parsejs/version.rb,
lib/parsejs/visitor.rb,
lib/parsejs/stringifier.rb

Defined Under Namespace

Modules: AST Classes: CommentScanner, ExtractDocs, FindVars, Stringifier, Visitor

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object



8
9
10
11
12
13
# File 'lib/parsejs.rb', line 8

def self.parse(string)
  string = string.force_encoding('BINARY') if string.respond_to?(:force_encoding)
  parser = ParseJS::Parser.new(string)
  parser.parse
  parser.result
end