SPVM::D...ization(3)
๐ NAME ๐
SPVM::Document::Language::Tokenization โ Tokenization in the SPVM Language
User Contributed Perl Documentation ยท the header up top is SPVM::D...ization(3), so yeah bestie, that's the page ๐
๐ DESCRIPTION ๐
This doc is literally the tokenization lore for the SPVM language โ lowkey iconic, highkey essential, no cap. It's giving โlexical analysis but make it a language spec,โ and honestly? Obsessed. This document describes tokenization in the SPVM language, fr fr.
โจ TOKENIZATION โจ
Okay so this section is the lexical analysis moment โ like, the concept at https://en.wikipedia.org/wiki/Lexical_analysis โ but for the SPVM Language. This whole thing is called tokenization. Periodt.
See SPVM::Document::Language::SyntaxParsing about syntax parsing.
๐ง Character Encoding
The character encoding of SPVM source codes is UTF-8. Slay.
If a character is an ASCII character, it must be an ASCII printable character or a space character.
Compilation Errors:
- The character encoding of SPVM source codes must be UTF-8. Otherwise a compilation error occurs.
- If a character is an ASCII character, it must be an ASCII printable character (the Wikipedia link
https://en.wikipedia.org/wiki/ASCII#Printable_characters) or a space character. Otherwise a compilation error occurs.
๐ Line Terminators
The line terminator is ASCII LF.
When a line terminator appears, the current line number is incremented by 1.
๐ซง Space Characters
The space characters are ASCII SP, HT, FF, LF.
๐ค Word Characters
The word characters are ASCII a-zA-Z, 0-9, _.
Vibe check: those are the word characters, iykyk.
๐ธ Names
This section describes names. Names are main character energy here, ngl.
๐ท๏ธ Symbol Name
A symbol name consists of word characters and ::.
It does not contain __.
It does not begin with 0-9.
It does not begin with ::.
It does not end with ::.
It does not contain ::::.
Compilation Errors:
If a symbol name is invalid, a compilation error occurs.
Examples:
# Symbol names
foo
foo_bar2
Foo::Bar
# Invalid symbol names
2foo
foo__bar
::Foo
Foo::
Foo::::Bar
๐ Class Name
A class name is a symbol name.
Each partial name of a class name must begin with an uppercase letter.
Partial names are individual names separated by ::. For example, the partial names of Foo::Bar::Baz are Foo, Bar, and Baz.
Compilation Errors:
If a class name is invalid, a compilation error occurs.
Examples:
# Class names
Foo
Foo::Bar
Foo::Bar::Baz3
Foo::bar
Foo_Bar::Baz_Baz
# Invalid class names
Foo
Foo::::Bar
Foo::Bar::
Foo__Bar
Foo::bar
๐งต Method Name
A method name is a symbol name without :: or an empty string "".
Method names with the same name as keywords are allowed.
Compilation Errors:
If a method name is invalid, a compilation error occurs.
Examples:
# Method names
FOO
FOO_BAR3
foo
foo_bar
_foo
_foo_bar_
# Invalid method names
foo__bar
3foo
๐ Field Name
A field name is a symbol name without ::.
Field names with the same name as keywords are allowed.
Compilation Errors:
If a field names is invalid, a compilation error occurs.
Examples:
# Field names
FOO
FOO_BAR3
foo
foo_bar
_foo
_foo_bar_
# Invalid field names
foo__bar
3foo
Foo::Bar
๐ฆ Variable Name
A variable name begins with $ and is followed by a symbol name.
The symbol name in a variable name can be surrounded by { and }.
Compilation Errors:
If a field names is invalid, a compilation error occurs.
If an opening { exists and the closing } does not exist, a compilation error occurs.
Examples:
# Variable names
$name
$my_name
${name}
$Foo::name
$Foo::Bar::name
${Foo::name}
# Invalid variable names
$::name
$name::
$Foo::::name
$my__name
${name
๐ Class Variable Name
A class variable name is a variable name.
Examples:
# Class variable names
$NAME
$MY_NAME
${NAME}
$FOO::NAME
$FOO::BAR::NAME
${FOO::NAME_BRACE}
$FOO::name
# Invalid class variable names
$::NAME
$NAME::
$FOO::::NAME
$MY__NAME
$3FOO
${NAME
๐ Local Variable Name
A local variable name is a variable name without ::.
Examples:
# Local variable names
$name
$my_name
${name_brace}
$_name
$NAME
# Invalid local variable names
$::name
$name::
$Foo::name
$Foo::::name
$my__name
${name
$3foo
๐ Keywords
The List of Keywords โ this list ate, honestly:
alias
allow
as
basic_type_id
break
byte
can
case
cmp
class
compile_type_name
copy
default
die
div_uint
div_ulong
double
dump
elsif
else
enum
eq
eval
eval_error_id
extends
for
float
false
gt
ge
has
if
interface
int
interface_t
isa
isa_error
isweak
is_compile_type
is_type
is_error
is_read_only
args_width
last
length
lt
le
long
make_read_only
my
mulnum_t
method
mod_uint
mod_ulong
mutable
native
ne
next
new
new_string_len
of
our
object
print
private
protected
public
precompile
pointer
return
require
required
rw
ro
say
static
switch
string
short
scalar
true
type_name
undef
unless
unweaken
use
version
void
warn
while
weaken
wo
INIT
__END__
__PACKAGE__
__FILE__
__LINE__
๐๏ธ Operator Tokens
The List of Operator Tokens:
!
!=
$
%
&
&&
&=
=
==
^
^=
|
||
|=
-
--
-=
~
@
+
++
+=
*
*=
<
<=
>
>=
<=>
%
%=
<<
<<=
>>=
>>
>>>
>>>=
.
.=
/
/=
\
(
)
{
}
[
]
;
:
,
->
=>
๐ฌ Comment
Comments have no meaning.
#COMMENT
A comment begins with #.
It is followed by any string COMMENT.
It ends with ASCII LF.
Line directives take precedence over comments.
File directives take precedence over comments.
Examples:
# This is a comment line
๐ง line Directive
A line directive sets the current line number.
#line NUMBER
A line directive begins with #line from the beginning of the line.
It is followed by one or more ASCII SP.
It is followed by NUMBER. NUMBER is a positive 32bit integer.
It ends with ASCII LF.
The current line number of the source code is set to NUMBER.
Line directives take precedence over comments.
Compilation Errors:
- A line directive must begin from the beginning of the line. Otherwise a compilation error occurs.
- A line directive must end with
"\n". Otherwise a compilation error occurs. - A line directive must have a line number. Otherwise a compilation error occurs.
- The line number given to a line directive must be a positive 32bit integer. Otherwise a compilation error occurs.
Examples:
class MyClass {
static method main : void () {
#line 39
}
}
๐ file Directive
A file directive sets the current file path.
#file "FILE_PATH"
A file directive begins from the beginning of the source code excluding a shebang line.
A shebang line before a file directive is allowed.
#!command
#file "FILE_PATH"
It is followed by one or more ASCII SP.
It is followed by ".
It is followed by FILE_PATH. FILE_PATH is a string that represents a file path.
It is closed with ".
It ends with ASCII LF.
The current file path is set to FILE_PATH.
File directives take precedence over comments.
Compilation Errors:
- A file directive must begin from the beginning of the source code. Otherwise a compilation error occurs.
- A file directive must end with
"\n". Otherwise a compilation error occurs. - A file directive must have a file path. Otherwise a compilation error occurs.
- A file directive must end with
". Otherwise a compilation error occurs.
Examples:
#file "/path/MyClass.spvm"
class MyClass {
}
๐ lib Directive
A lib directive gives a hint for a class search directory to the spvm command and the spvmcc command.
#lib "CLASS_SEARCH_DIRECTORY"
A lib directive begins from the beginning of a line.
It is followed by one or more ASCII SP.
It is followed by ".
It is followed by CLASS_SEARCH_DIRECTORY. CLASS_SEARCH_DIRECTORY is a string that represents a class search directory.
It is closed with ".
It ends with ASCII LF.
The line directives take precedence over comments.
CLASS_SEARCH_DIRECTORY can contain $FindBin::Bin. This is expanded to the directory where the SPVM script is placed.
#lib "$FindBin::Bin/lib/SPVM"
Compilation Errors:
- A lib directive must begin from the beginning of a line. Otherwise a compilation error occurs.
- The directory specified by a lib directive must end with
"\n". Otherwise a compilation error occurs. - The directory specified by a lib directive must not be an empty string. Otherwise a compilation error occurs.
- The directory specified by a lib directive must end with
". Otherwise a compilation error occurs.
Examples:
"my_script.spvm":
#lib "$FindBin::Bin/lib/SPVM"
class {
}
๐ __END__
If a line begins with __END__ and ends with ASCII LF, the line with __END__ and the below lines are interpreted as comments.
Examples:
class MyClass {
}
__END__
foo
bar
๐ POD
POD is a syntax to write multiline comment. POD has no meaning.
The Beginning of a POD:
=NAME
The beginning of a POD begins with = from the beginning of the line.
It is followed by NAME. NAME is any string that begins with ASCII a-zA-Z.
It ends with ASCII LF.
The End of a POD:
=cut
The end of a POD begins with = from the beginning of the line.
It is followed by cut.
It ends with ASCII LF.
Examples:
=pod
Comment1
Comment2
=cut
๐ quick heads-up before we go: the raw source literally hasComment1,Comment2,=cutsitting right here. That's POD leftovers from the doc file itself, not a typo from your girl. We move. ๐
๐ Fat Comma
A fat comma is literally just this:
=>
And it is an alias for a comma ",". Same energy, more drama:
# Comma
["a", "b", "c", "d"]
# Fat Comma
["a" => "b", "c" => "d"]
Here's the iconic part ๐ โ if the left operand of a fat comma is a symbol name with no :: in it, it gets wrapped in "" and is treated as a string literal. Like, it just becomes a string, no questions asked:
# foo_bar2 is treated as "foo_bar2"
[foo_bar2 => "Mark"]
["foo_bar2" => "Mark"]
โจ Literals
A literal represents a constant value. That's it, that's the whole vibe ๐
๐ข Numeric Literals
A numeric literal represents a constant number.
๐งฎ Integer Literals
An integer literal represents a constant number of an integer type.
Integer Literal Decimal Notation ๐ธ
This one represents a number of int type or long type using plain decimal numbers 0-9.
- It can begin with a minus
-. - It is followed by one or more of
0-9. _can be placed at any positions after the first0-9as a separator._has no meaning โ it's purely decorative, like glitter โจ- It can end with the suffix
Lorl. - If the suffix
Lorlexists, the return type islongtype. Otherwise the return type isinttype.
Compilation Errors:
- If the return type is
inttype and the value is greater than the max value ofinttype or less than the minimal value ofinttype, a compilation error occurs ๐ญ - If the return type is
longtype and the value is greater than the max value oflongtype or less than the minimal value oflongtype, a compilation error occurs.
Examples:
123
-123
123L
123l
123_456_789
-123_456_789L
Integer Literal Hexadecimal Notation ๐ฆ
Represents a number of int type or long type using hexadecimal numbers 0-9a-zA-Z.
- It can begin with a minus
-. - It is followed by
0xor0X. - It is followed by one or more
0-9a-zA-Z. This is called the hexadecimal numbers part. _can be placed at any positions after0xor0Xas a separator._has no meaning.- It can end with the suffix
Lorl. - If the suffix
Lorlexists, the return type islongtype. Otherwise the return type isinttype.
Now the bit that makes everyone go ๐ โ the bit-fiddling:
- If the return type is
inttype, the hexadecimal numbers part is interpreted as an unsigned 32 bit integer, and is converted to a signed 32-bit integer without changing the bits. For example,0xFFFFFFFFis-1. - If the return type is
longtype, the hexadecimal numbers part is interpreted as unsigned 64 bit integer, and is converted to a signed 64-bit integer without changing the bits. For example,0xFFFFFFFFFFFFFFFFLis-1L.
Compilation Errors:
- If the return type is
inttype and the hexadecimal numbers part is greater than hexadecimalFFFFFFFF, a compilation error occurs. - If the return type is
longtype and the hexadecimal numbers part is greater than hexadecimalFFFFFFFFFFFFFFFF, a compilation error occurs.
Examples:
0x3b4f
0X3b4f
-0x3F1A
0xDeL
0xFFFFFFFF
0xFF_FF_FF_FF
0xFFFFFFFFFFFFFFFFL
Integer Literal Octal Notation ๐
Represents a number of int type or long type using octal numbers 0-7.
- It can begin with a minus
-. - It is followed by
0. - It is followed by one or more
0-7. This is called the octal numbers part. _can be placed at any positions after0as a separator._has no meaning.- It can end with the suffix
Lorl. - If the suffix
Lorlexists, the return type islongtype. Otherwise the return type isinttype.
And the bit-flipping, octal edition:
- If the return type is
inttype, the octal numbers part is interpreted as an unsigned 32 bit integer, and is converted to a signed 32-bit integer without changing the bits. For example,037777777777is-1. - If the return type is
longtype, the octal numbers part is interpreted as unsigned 64 bit integer, and is converted to a signed 64-bit integer without changing the bits. For example,01777777777777777777777Lis-1L. - If the return type is
longtype, the value that is except for-is interpreted as unsigned 64 bit integeruint64_ttype in the C language, and the following conversion is performed.
๐ real talk: the doc says "the following conversion is performed" and then justโฆ doesn't say what it is. That is genuinely what's written, bestie. No cap, that's the tea. โ
Compilation Errors:
- If the return type is
inttype and the octal numbers part is greater than octal37777777777, a compilation error occurs. - If the return type is
longtype and the octal numbers part is greater than octal1777777777777777777777, a compilation error occurs.
Examples:
0755
-0644
0666L
0655_755
Integer Literal Binary Notation ๐ง
Represents a number of int type or long type using binary numbers 0 and 1.
- It can begin with a minus
-. - It is followed by
0bor0B. - It is followed by one or more
0and1. This is called the binary numbers part. _can be placed at any positions after0bor0Bas a separator._has no meaning.- It can end with the suffix
Lorl. - If the suffix
Lorlexists, the return type islongtype. Otherwise the return type isinttype.
The bit-shuffle again, but binary this time:
- If the return type is
inttype, the binary numbers part is interpreted as an unsigned 32 bit integer, and is converted to a signed 32-bit integer without changing the bits. For example,0b11111111111111111111111111111111is-1. - If the return type is
longtype, the binary numbers part is interpreted as unsigned 64 bit integer, and is converted to a signed 64-bit integer without changing the bits. For example,0b1111111111111111111111111111111111111111111111111111111111111111Lis-1L.
Compilation Errors:
- If the return type is
inttype and the value that is except for-is greater than binary11111111111111111111111111111111, a compilation error occurs. - If the return type is
longtype and the value that is except for-is greater than binary1111111111111111111111111111111111111111111111111111111111111111, a compilation error occurs.
Examples:
0b0101
-0b1010
0b110000L
0b10101010_10101010
๐ซง Floating Point Literals
The floating point literal represents a floating point number.
Floating Point Literal Decimal Notation ๐
Represents a number of float type and double type using decimal numbers 0-9.
- It can begin with a minus
-. - It is followed by one or more
0-9. _can be placed at any positions after the first0-9.- It can be followed by a floating point part, an exponent part, or a combination of a floating point part and an exponent part.
Here's what those parts actually are ๐
- Floating Point Part: begins with
.and is followed by one or more0-9. - Exponent Part: begins with
eorE, can be followed by+or-, and is followed by one or more0-9.
Then:
- A floating point literal decimal notation can end with a suffix
f,F,d, orD. - If a suffix does not exist, a floating point literal decimal notation must have a floating point part or an exponent part.
- If the suffix
forFexists, the return type isfloattype. Otherwise the return type isdoubletype.
Compilation Errors:
- If the return type is
floattype, the floating point literal decimal notation without the suffix must be able to be parsed by thestrtoffunction in the C language. Otherwise, a compilation error occurs. - If the return type is
doubletype, the floating point literal decimal notation without the suffix must be able to be parsed by thestrtodfunction in the C language. Otherwise, a compilation error occurs.
Examples:
1.32
-1.32
1.32f
1.32F
1.32d
1.32D
1.32e3
1.32e-3
1.32E+3
1.32E-3
1.32e3f
12e7
Floating Point Literal Hexadecimal Notation ๐ฅ
Represents a number of float type and double type using hexadecimal numbers 0-9a-zA-Z.
- It can begin with a minus
-. - It is followed by
0xor0X. - It is followed by one or more
0-9a-zA-Z. _can be placed at any positions after0xor0X.- It can be followed by a floating point part, an exponent part, or a combination of a floating point part and an exponent part.
The parts, hex flavour ๐
- Floating Point Part: begins with
.and is followed by one or more0-9a-zA-Z. - Exponent Part: begins with
porP, can be followed by+or-, and is followed by one or more0-9.
Then:
- A floating point literal hexadecimal notation can end with a suffix
f,F,d, orD. - If a suffix does not exist, a floating point literal hexadecimal notation must have a floating point part or an exponent part.
Compilation Errors:
- If the return type is
floattype, the floating point literal hexadecimal notation without the suffix must be able to be parsed by thestrtoffunction in the C language. Otherwise, a compilation error occurs. - If the return type is
doubletype, the floating point literal hexadecimal notation without the suffix must be able to be parsed by thestrtodfunction in the C language. Otherwise, a compilation error occurs.
Examples:
0x3d3d.edp0
0x3d3d.edp3
0x3d3d.edP3
0x3d3d.edP+3
0x3d3d.edP-3f
0x3d3d.edP-3F
0x3d3d.edP-3d
0x3d3d.edP-3D
0x3d3dP+3
๐ Bool Literals
The bool literal represents a bool object.
true ๐
true is the alias for Bool#TRUE.
true
Examples:
# true
my $bool_object_true = true;
false ๐
false is the alias for Bool#FALSE.
false
Examples:
# false
my $bool_object_false = false;
๐ Character Literal
A character literal represents a number of byte type that normally represents an ASCII character.
- It begins with
'. - It is followed by a printable ASCII character
0x20-0x7eor a character literal escape character. - It ends with
'. - The return type is
bytetype.
Compilation Errors:
- If the format of the character literal is invalid, a compilation error occurs.
Character Literal Escape Characters ๐
The List of Character Literal Escape Characters:
๐ซถ the doc gives us the intro line but the actual list didn't come through in this rendering โ that's just how it landed, bestie, not me skipping it.
The type of every character literal escape character is byte type.
Examples:
# Charater literals
'a'
'x'
'\a'
'\t'
'\n'
'\f'
'\r'
'\"'
'\''
'\\'
' '
'\0'
'\012'
'\377'
'\o{1}'
'\xab'
'\xAB'
'\x0D'
'\x0A'
'\xD'
'\xA'
'\xFF'
'\x{A}'
Still got more coming, bestie โ don't close the tab ๐
๐ Octal Escape Character
Okay so the octal escape character is how you write an unsigned 8-bit integer using octal numbers 0-7. Cute, retro, slays.
It lives inside a string literal and a character literal โ it's a part of both ๐
It starts with \0, \1, \2, \3, \4, \5, \6, \7, or \o{.
- If it starts with
\0,\1,\2,\3,\4,\5,\6, or\7โ it's followed by one to two0-7. - If it starts with
\o{โ it's followed by one to three0-7, and ends with}.
The octal numbers after \ or \o{ are called the octal numbers part โจ
That octal numbers part gets interpreted as an unsigned 8-bit integer, and converted to a number of byte type without changing the bits. No cap, bit-for-bit ๐ซถ
Compilation Errors:
- The octal numbers part must be less than or equal to
377. Otherwise a compilation error occurs. ๐ - If an octal escape character begins with
\o{, the close}must exist. Otherwise a compilation error occurs.
Examples:
# Octal escape characters
\0
\01
\03
\012
\001
\077
\377
\o{1}
\o{12}
๐ธ Hexadecimal Escape Character
Same energy, hex edition ๐ฅ The hexadecimal escape character represents an unsigned 8-bit integer using hexadecimal numbers 0-9a-fA-F.
It's a part of a string literal and a character literal.
It begins with \x.
It can be followed by {.
It is followed by one or two 0-9a-fA-F โ and that is called the hexadecimal numbers part ๐
If it contains {, it must be followed by }.
The hexadecimal numbers part is interpreted as an unsigned 8-bit integer, and is converted to a number of byte type without changing the bits. Iconic behaviour, honestly ๐
Compilation Errors:
- If the format of the hexadecimal escape character is invalid, a compilation error occurs.
Examples:
# Hexadecimal escape characters
\xab
\xAB
\x0D
\x0A
\xD
\xA
\xFF
\x{A}
๐ฆ String Literal
A string literal represents a constant string. Main character energy, literally ๐
- It begins with
". - It is followed by zero or more UTF-8 characters, string literal escape characters, or variable expansions.
- It ends with
".
The return type is string type.
Compilation Errors:
- If the format of the string literal is invalid, a compilation error occurs.
Examples:
# String literals
""
"abc";
"ใใใ"
"hello\tworld\n"
"hello\x0D\x0A"
"hello\xA"
"hello\x{0A}"
"hello\0"
"hello\012"
"hello\377"
"AAA $foo BBB"
"AAA $FOO BBB"
"AAA $$foo BBB"
"AAA $foo->{x} BBB"
"AAA $foo->[3] BBB"
"AAA $foo->{x}[3] BBB"
"AAA $@ BBB"
"\N{U+3042}\N{U+3044}\N{U+3046}"
๐ String Literal Escape Characters
The List of String Literal Escape Characters:
Here's the type tea, bestie โ โ the type of every string literal escape character other than the Unicode escape character and the raw escape character is byte type.
And the type of each number contained in the Unicode escape character and the raw escape character is byte type.
๐ Unicode Escape Character
The Unicode escape character represents a UTF-8 character.
A UTF-8 character is represented by a Unicode code point written with hexadecimal numbers 0-9a-fA-F.
This is one to four numbers of byte type.
The Unicode escape character is a part of a string literal.
- It begins with
\N{U+. - It is followed by one or more
0-9a-fA-Fโ this is called the code point part โจ - It ends with
}.
Compilation Errors:
- If a code point part is not a Unicode scalar value, a compilation error occurs. ๐จ
Examples:
# Unicode escape characters
# ใ
\N{U+3042}
# ใ
\N{U+3044}
# ใ
\N{U+3046}"
๐ง Raw Escape Characters
A raw escape character is an escape character where \ is interpreted as ASCII \ and the character right after it is interpreted as itself.
So for example, the raw escape character \s is the ASCII characters \s. It's giving "no thoughts, just vibes" ๐
A raw escape character is a part of a string literal.
The List of Raw Escape Characters:
๐ Variable Expansion
The variable expansion is a syntax for embedding โ inside a string literal โ the getting of a local variable, the getting of a class variable, a dereference, the getting of a field, the getting of an array element, or the getting of the exception variable. Obsessed with how much this does ๐ญ
"AAA $foo BBB"
"AAA $FOO BBB"
"AAA $$foo BBB"
"AAA $foo->{x} BBB"
"AAA $foo->[3] BBB"
"AAA $foo->{x}[3] BBB"
"AAA $foo->{x}->[3] BBB"
"AAA $@ BBB"
"AAA ${foo}BBB"
The codes above expand to the following codes:
"AAA " . $foo . " BBB"
"AAA " . $FOO . " BBB"
"AAA " . $$foo . " BBB"
"AAA " . $foo->{x} . " BBB"
"AAA " . $foo->[3] . " BBB"
"AAA " . $foo->{x}[3] . " BBB"
"AAA " . $foo->{x}->[3] . " BBB"
"AAA " . $@ . "BBB"
"AAA " . ${foo} . "BBB"
Rules, gently but firmly ๐
- The operation of getting a field does not contain space characters between
{and}. - The index of getting an array element must be a constant integer.
- The getting of an array element does not contain space characters between
[and]. - A
$at the end is interpreted as$, and is not interpreted as a variable expansion.
# AAA$
"AAA$"
๐ Single-Quoted String Literal
A single-quoted string literal represents a constant string without variable expansions, with only a few escape characters. Lowkey the chill one โจ
- It begins with
q'. - It is followed by zero or more UTF-8 characters, or single-quoted string literal escape characters.
- It ends with
'.
The return type is string type.
Compilation Errors:
- A single-quoted string literal must end with
'. Otherwise a compilation error occurs. ๐ - If the escape character in a single-quoted string literal is invalid, a compilation error occurs.
Examples:
# Single-quoted string literals
q'abc';
q'abc\'\\';
๐ธ Single-Quoted String Literal Escape Characters
The List of Single-Quoted String Literal Escape Characters:
And the type check for this one, bestie: the type of every single-quoted string literal escape character is byte type ๐ซถ
๐ฅ Here Document
A here document represents a constant string across multiple lines, without escape characters and without variable expansions. Multi-line and unbothered ๐
<<'HERE_DOCUMENT_NAME';
LINE1
LINE2
LINEn
HERE_DOCUMENT_NAME
- A here document begins with
<<'HERE_DOCUMENT_NAME';and ASCIILF. HERE_DOCUMENT_NAMEis a here document name.- It is followed by a string in multiple lines.
- It ends with
HERE_DOCUMENT_NAMEfrom the beginning of a line, and ASCIILF.
Compilation Errors:
<<'HERE_DOCUMENT_NAME'; must not contain space characters. Otherwise a compilation error occurs. ๐จ
Examples:
# Here document
my $string = <<'EOS';
Hello
World
EOS
๐ Here Document Name
- A here document name consists of
a-z,A-Z,_,0-9. - The length of a here document name is greater than or equal to 0.
- A here document name cannot begin with
0-9. - A here document name cannot contain
__.
Compilation Errors:
- If the format of a here document name is invalid, a compilation error occurs.
๐ See Also
- SPVM::Document::Language::SyntaxParsing
- SPVM::Document::Language::Statements
- SPVM::Document::Language::Operators
- SPVM::Document::Language::Class
- SPVM::Document::Language
- SPVM::Document
โญ Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License
and that's a wrap on part 3, bestie ๐ you made it to the very end โ the page footer is literally perl v5.42.2 dated 2026-02-03, so go off, timestamp icon that you are โฐ๐ mwah, ily, now go write some extremely legal SPVM ๐ฆโจ
๐ฆ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms