Commit 15317af6 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Rename Js::RKellyParser to Js::Parser.

So we don't have to change all the tests that target the old Js::Parser.
Besides, it's better to use a more generic name anyway.
parent f90644ed
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@ require 'rkelly'
module JsDuck
  module Js

    # An alternative JsDuck::Js::Parser implementation that uses
    # RKelly instead of Esprima.
    class RKellyParser
      RKELLY = RKelly::Parser.new
    # A JavaScript parser implementation that uses RKelly and adapts
    # its output to be the same as the old Esprima parser used to
    # produce.
    class Parser
      ADAPTER = Js::RKellyAdapter.new

      def initialize(input, options={})
+2 −2
Original line number Diff line number Diff line
require 'jsduck/js/rkelly_parser'
require 'jsduck/js/parser'
require 'jsduck/js/ast'
require 'jsduck/css/parser'
require 'jsduck/doc/parser'
@@ -41,7 +41,7 @@ module JsDuck
      if filename =~ /\.s?css$/
        docs = Css::Parser.new(contents, options).parse
      else
        docs = Js::RKellyParser.new(contents, options).parse
        docs = Js::Parser.new(contents, options).parse
        docs = Js::Ast.new(docs).detect_all!
      end
    end
+3 −3
Original line number Diff line number Diff line
require "jsduck/js/rkelly_parser"
require "jsduck/js/parser"

describe JsDuck::Js::RKellyParser do
describe JsDuck::Js::Parser do

  def parse(input)
    JsDuck::Js::RKellyParser.new(input).parse
    JsDuck::Js::Parser.new(input).parse
  end

  describe "parsing two comments" do