Class: Hamlit::Parser

Constant Summary collapse

SKIP_NEWLINE_EXPS =
%i[newline code multi].freeze
SKIP_NEWLINE_FILTERS =
%w[ruby markdown erb].freeze

Constants included from Hamlit::Parsers::Tag

Hamlit::Parsers::Tag::DEFAULT_TAG, Hamlit::Parsers::Tag::TAG_ID_CLASS_REGEXP, Hamlit::Parsers::Tag::TAG_REGEXP

Constants included from Hamlit::Parsers::Script

Hamlit::Parsers::Script::DEFAULT_SCRIPT_OPTIONS, Hamlit::Parsers::Script::INTERNAL_STATEMENTS

Instance Method Summary collapse

Methods included from Hamlit::Parsers::Whitespace

#parse_whitespace_removal

Methods included from Hamlit::Parsers::Text

#parse_text

Methods included from Hamlit::Parsers::Tag

#parse_tag

Methods included from Concerns::Indentable

#count_indent, #count_width, #indent_label, #next_indent, #next_width, #replace_hard_tabs, #reset_indent, #same_indent?, #validate_indentation!, #with_indented

Methods included from Concerns::Error

#assert_scan!, #copmile_error!, #syntax_error, #syntax_error!

Methods included from Hamlit::Parsers::Script

#parse_script, #parse_silent_script

Methods included from Concerns::Included

extended

Methods included from Hamlit::Parsers::Multiline

#preprocess_multilines

Methods included from Concerns::LineReader

#current_line, #empty_line?, #next_line, #read_lines, #reset_lines, #skip_lines

Methods included from Hamlit::Parsers::Filter

#parse_filter

Methods included from Hamlit::Parsers::Doctype

#parse_doctype

Methods included from Hamlit::Parsers::Comment

#parse_comment

Methods included from Hamlit::Parsers::Attribute

#parse_attributes

Methods included from Concerns::Balanceable

#balanced_braces_exist?, #balanced_parens_exist?, #fetch_balanced_braces, #fetch_balanced_parentheses

Instance Method Details

#call(template) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/hamlit/parser.rb', line 30

def call(template)
  reset(template)

  ast = [:multi]
  ast += parse_lines
  ast
end