2. Literals

S2 supports integer, string, boolean, array and hash literals:

123
Integer literal representing the number “one hundred and twenty three”.
"Blah blah blah"
Simple string literal. Variables are interpolated and escape sequences are processed.
"""string with "quotes" in it"""
Triple-quote string literal. Quotes can occur within with no escaping for one or two consecutive characters. Variables are interpolated and escape sequences are processed.
true, false
The two boolean literals.
[ item, item, item, item ]
Array literal. All items must be of the same type, and this literal will return an array of that type. Trailing commas are fine, if you want to include them.
{ key => value, key => value, key => value }
Array literal. All “key” items must be strings, and all “value” items must be of the same type. This literal will return a hash of that type.

The following escape sequences are supported in strings:

\n
Newline
\"
Literal quote
\\
Literal backslash
\$
Literal dollarsign