Sha256: d27d5b22d3f9a9c0ad2a05ded4bdfed60ea10b9b92f41415c7c1be7f008de610

Contents?: true

Size: 1.15 KB

Versions: 19

Compression:

Stored size: 1.15 KB

Contents

module SlimLint
  # Generates a {SlimLint::Sexp} suitable for consumption by the
  # {RubyExtractor}.
  #
  # This is mostly copied from Slim::Engine, with some filters and generators
  # omitted.
  class RubyExtractEngine < Temple::Engine
    filter :Encoding
    filter :RemoveBOM

    # Parse into S-expression using Slim parser
    use Slim::Parser

    # Perform additional processing so extracting Ruby code in {RubyExtractor}
    # is easier. We don't do this for regular linters because some information
    # about the original syntax tree is lost in the process, but that doesn't
    # matter in this case.
    use Slim::Embedded
    use Slim::Interpolation
    use SlimLint::Filters::SplatProcessor
    use Slim::DoInserter
    use Slim::EndInserter
    use SlimLint::Filters::ControlProcessor
    use SlimLint::Filters::AttributeProcessor
    filter :MultiFlattener
    filter :StaticMerger

    # Converts Array-based S-expressions into SlimLint::Sexp objects, and gives
    # them line numbers so we can easily map from the Ruby source to the
    # original source
    use SlimLint::Filters::SexpConverter
    use SlimLint::Filters::InjectLineNumbers
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
slim_lint-0.15.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.15.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.14.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.13.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.12.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.11.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.10.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.9.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.8.3 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.8.2 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.8.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.8.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.7.2 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.7.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.7.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.6.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.6.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.5.0 lib/slim_lint/ruby_extract_engine.rb
slim_lint-0.4.0 lib/slim_lint/ruby_extract_engine.rb