Class: SlimLint::Filters::InjectLineNumbers
- Inherits:
-
Temple::Filter
- Object
- Temple::Filter
- SlimLint::Filters::InjectLineNumbers
- Defined in:
- lib/slim_lint/filters/inject_line_numbers.rb
Overview
Traverses a Temple S-expression (that has already been converted to Sexp instances) and annotates them with line numbers.
This is a hack that allows us to access line information directly from the S-expressions, which makes a lot of other tasks easier.
Constant Summary collapse
Instance Method Summary collapse
-
#call(sexp) ⇒ SlimLint::Sexp
Annotates the given Sexp with line number information.
Instance Method Details
#call(sexp) ⇒ SlimLint::Sexp
Annotates the given Sexp with line number information.
17 18 19 20 21 |
# File 'lib/slim_lint/filters/inject_line_numbers.rb', line 17 def call(sexp) @line_number = 1 traverse(sexp) sexp end |