Sha256: 84d39a252fbecdbb01d4c772be4be1eba20d60c61d76cf644b741b55ef49001f

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

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 SlimLint::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 SlimLint::Filters::Interpolation
    use SlimLint::Filters::SplatProcessor
    use SlimLint::Filters::DoInserter
    use SlimLint::Filters::EndInserter
    use SlimLint::Filters::AutoIndenter
    use SlimLint::Filters::ControlProcessor
    use SlimLint::Filters::AttributeProcessor
    use SlimLint::Filters::MultiFlattener
    use SlimLint::Filters::StaticMerger
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slim_lint_standard-0.0.2.2 lib/slim_lint/ruby_extract_engine.rb
slim_lint_standard-0.0.2.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint_standard-0.0.2 lib/slim_lint/ruby_extract_engine.rb
slim_lint_standard-0.0.1 lib/slim_lint/ruby_extract_engine.rb
slim_lint_standard-0.0.0 lib/slim_lint/ruby_extract_engine.rb