# frozen_string_literal: true

begin
  require 'c_lexer'
rescue LoadError
  $stderr.puts 'Failed to load WithCLexer, using pure Ruby lexer'
end

if defined? Parser::Ruby25WithWithCLexer
  class Opal::Parser::WithCLexer < Parser::Ruby25WithWithCLexer
    include Opal::Parser::DefaultConfig
    Opal::Parser.default_parser_class = self
  end
end

# frozen_string_literal: true

# There's no compatible c_lexer for parser 3.0.0.0 at this point...
begin
  require 'c_lexer'
rescue LoadError
  $stderr.puts 'Failed to load WithCLexer, using pure Ruby lexer' if $DEBUG
end

if defined? Parser::Ruby25WithWithCLexer
  class Opal::Parser::WithCLexer < Parser::Ruby25WithWithCLexer
    include Opal::Parser::DefaultConfig
    Opal::Parser.default_parser_class = self
  end
end

Hide the "Failed to load WithCLexer, using pure Ruby lexer" warning.
Hide the "Failed to load WithCLexer, using pure Ruby lexer" warning.

The rationale behind this is that we don't have a matching c_lexer for
parser 3.0.0.0 and this warning can be misleading. It isn't code removal,
as we may want to reenable this warning once c_lexer becomes compatible.
