Module: Haml::Precompiler

Includes:
Util
Included in:
Engine
Defined in:
lib/haml/precompiler.rb

Defined Under Namespace

Classes: Line

Constant Summary collapse

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_OR_UNESCAPE =

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 =

Designates a non-parsed line. Not actually a character.

-1
SPECIAL_CHARACTERS =

Keeps track of the ASCII values of the characters that begin a specially-interpreted line.

[
  ELEMENT,
  DIV_CLASS,
  DIV_ID,
  COMMENT,
  DOCTYPE_OR_UNESCAPE,
  SCRIPT,
  SANITIZE,
  FLAT_SCRIPT,
  SILENT_SCRIPT,
  ESCAPE,
  FILTER
]
MULTILINE_CHAR_VALUE =

The value of the character that designates that a line is part of a multiline string.

?|
MID_BLOCK_KEYWORDS =

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.

['else', 'elsif', 'rescue', 'ensure', 'when']
DOCTYPE_REGEX =

The Regex that matches a Doctype command.

/(\d\.\d)?[\s]*([a-z]*)/i
LITERAL_VALUE_REGEX =

The Regex that matches a literal string or symbol value

/^\s*(:(\w*)|(('|")([^\\\#'"]*?)\4))\s*$/

Constants included from Util

Util::RUBY_VERSION

Method Summary

Methods included from Util

#def_static_method, #enum_with_index, #has?, #map_hash, #map_keys, #map_vals, #powerset, #ruby1_8?, #static_method_name, #to_hash