Module Haml::Precompiler
In: lib/haml/precompiler.rb
lib/haml/template/plugin.rb

Handles the internal pre-compilation from Haml into Ruby code, which then runs the final creation of the HTML string.

Methods

Included Modules

Haml::Util

Classes and Modules

Class Haml::Precompiler::Line

Constants

ELEMENT = ?%   Designates an XHTML/XML element.
DIV_CLASS = ?.   Designates a `<div>` element with the given class.
DIV_ID = ?#   Designates a `<div>` element with the given id.
COMMENT = ?/   Designates an XHTML/XML comment.
DOCTYPE = ?!   Designates an XHTML doctype or script that is never HTML-escaped.
SCRIPT = ?=   Designates script, the result of which is output.
SANITIZE = ?&   Designates script that is always HTML-escaped.
FLAT_SCRIPT = ?~   Designates script, the result of which is flattened and output.
SILENT_SCRIPT = ?-   Designates script which is run but not output.
SILENT_COMMENT = ?#   When following SILENT_SCRIPT, designates a comment that is not output.
ESCAPE = ?\\   Designates a non-parsed line.
FILTER = ?:   Designates a block of filtered text.
PLAIN_TEXT = -1   Designates a non-parsed line. Not actually a character.
SPECIAL_CHARACTERS = [ ELEMENT, DIV_CLASS, DIV_ID, COMMENT, DOCTYPE, SCRIPT, SANITIZE, FLAT_SCRIPT, SILENT_SCRIPT, ESCAPE, FILTER   Keeps track of the ASCII values of the characters that begin a specially-interpreted line.
MULTILINE_CHAR_VALUE = ?|   The value of the character that designates that a line is part of a multiline string.
MID_BLOCK_KEYWORD_REGEX = /^-\s*(#{%w[else elsif rescue ensure when end].join('|')})\b/   Regex to match keywords that appear in the middle of a Ruby block with lowered indentation. If a block has been started using indentation, lowering the indentation with one of these won‘t end the block. For example:
  - if foo
    %p yes!
  - else
    %p no!

The block is ended after `%p no!`, because `else` is a member of this array.

DOCTYPE_REGEX = /(\d(?:\.\d)?)?[\s]*([a-z]*)/i   The Regex that matches a Doctype command.
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?![\\#]|\2).|\\.)*\2/   The Regex that matches a literal string or symbol value

Public Instance methods

push_silent(text, can_suppress = false)
push_silent_without_haml_block_deprecation(text, can_suppress = false)

Alias for push_silent

[Validate]