2022-03-04 15:33:24 +00:00
|
|
|
=====================================
|
|
|
|
empty
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string))
|
|
|
|
|
2021-09-01 14:59:04 +00:00
|
|
|
=====================================
|
|
|
|
single line
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"Hello, 123!"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
multiple lines
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"line 1
|
|
|
|
line 2"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"hey #{name}!"
|
|
|
|
"hey #{
|
|
|
|
name
|
|
|
|
}!"
|
|
|
|
"##{name}#"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(identifier))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content))
|
2021-09-01 14:59:04 +00:00
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(identifier))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content))
|
2021-09-01 14:59:04 +00:00
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(identifier))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
nested interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"this is #{"number #{1}"}!"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
2021-09-25 00:23:37 +00:00
|
|
|
(integer))))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
escape sequence
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"_\"_\n_\t_\r_\e_\\_\1_\x3f_\u0065\u0301_"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
escaped interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"\#{1}"
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
heredoc / string
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
text
|
|
|
|
with "quotes"
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
heredoc / interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
hey #{name}!
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(identifier))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
heredoc / nested interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
this is #{
|
|
|
|
"""
|
|
|
|
number #{1}
|
|
|
|
"""
|
|
|
|
}!
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(interpolation
|
2021-09-25 00:23:37 +00:00
|
|
|
(integer))
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
2022-03-04 15:33:24 +00:00
|
|
|
=====================================
|
|
|
|
heredoc / delimiter in the middle
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
hey """
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
|
|
|
(quoted_content)))
|
|
|
|
|
|
|
|
=====================================
|
|
|
|
heredoc / escaped newline (ignored)
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
hey \
|
|
|
|
"""
|
|
|
|
|
|
|
|
"""
|
|
|
|
hey \
|
|
|
|
"""
|
|
|
|
|
|
|
|
"""
|
|
|
|
hey \
|
|
|
|
there
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
|
|
|
(quoted_content))
|
|
|
|
(string
|
|
|
|
(quoted_content))
|
|
|
|
(string
|
|
|
|
(quoted_content)))
|
|
|
|
|
2021-09-01 14:59:04 +00:00
|
|
|
=====================================
|
|
|
|
heredoc / escaped delimiter
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
\"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
"""
|
|
|
|
\"\"\"
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-25 00:23:37 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content))
|
2021-09-01 14:59:04 +00:00
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-25 00:23:37 +00:00
|
|
|
(escape_sequence)
|
|
|
|
(escape_sequence)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|
2021-09-01 14:59:04 +00:00
|
|
|
|
|
|
|
=====================================
|
|
|
|
heredoc / escaped interpolation
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
\#{1}
|
|
|
|
"""
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
(source
|
|
|
|
(string
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)
|
2021-09-01 14:59:04 +00:00
|
|
|
(escape_sequence)
|
2021-09-28 14:00:35 +00:00
|
|
|
(quoted_content)))
|