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.
|
BLOCK_WITH_SPACES |
= |
/do[\s]*\|[\s]*[^\|]*[\s]+\|\z/ |
|
Regex to check for blocks with spaces around arguments. Not to be confused
with multiline script. For example:
foo.each do | bar |
= bar
|
MID_BLOCK_KEYWORDS |
= |
%w[else elsif rescue ensure end when] |
START_BLOCK_KEYWORDS |
= |
%w[if begin case unless] |
START_BLOCK_KEYWORD_REGEX |
= |
/(?:\w+(?:,\s*\w+)*\s*=\s*)?(#{START_BLOCK_KEYWORDS.join('|')})/ |
|
Try to parse assignments to block
starters as best as possible
|
BLOCK_KEYWORD_REGEX |
= |
/^-?\s*(?:(#{MID_BLOCK_KEYWORDS.join('|')})|#{START_BLOCK_KEYWORD_REGEX.source})\b/ |
DOCTYPE_REGEX |
= |
/(\d(?:\.\d)?)?[\s]*([a-z]*)\s*([^ ]+)?/i |
|
The Regex that matches a Doctype command.
|
LITERAL_VALUE_REGEX |
= |
/:(\w*)|(["'])((?!\\|\#\{|\#@|\#\$|\2).|\\.)*\2/ |
|
The Regex that matches a literal string or symbol value
|