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

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

### Methods

push_silent push_silent_with_haml_block_deprecation

### 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

### External Aliases

push_silent | -> | push_silent_without_haml_block_deprecation

### Public Instance methods

push_silent(text, can_suppress = false)

Alias for push_silent_with_haml_block_deprecation

push_silent_with_haml_block_deprecation(text, can_suppress = false)

[Source]

        # File lib/haml/template/plugin.rb, line 49
    49:       def push_silent_with_haml_block_deprecation(text, can_suppress = false)
    50:         unless can_suppress && block_opened? && !mid_block_keyword?("- #{text}") &&
    51:             text =~ ActionView::Template::Handlers::Erubis::BLOCK_EXPR
    52:           return push_silent_without_haml_block_deprecation(text, can_suppress)
    53:         end
    54:
    55:         push_silent_without_haml_block_deprecation("_hamlout.append_if_string= #{text}", can_suppress)
    56:       end

[Validate]