Skip to content

Commit

Permalink
- Improved the parsing of a here-document when it's followed by a bar…
Browse files Browse the repository at this point in the history
…eword.

Example:
	print <<-1234	# works now
	hello
	1234
  • Loading branch information
trizen committed Sep 3, 2015
1 parent b240758 commit 8ab0b77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Sidef/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ package Sidef::Parser {
);
}

# Begining of here-document (<<"EOT", <<'EOT', <<EOT)
# Beginning of a here-document (<<"EOT", <<'EOT', <<EOT)
if (/\G<<(?=\S)/gc) {
my ($name, $type) = (undef, 1);

Expand All @@ -1548,7 +1548,7 @@ package Sidef::Parser {
my $str = $self->get_quoted_string(code => $opt{code});
$name = $str;
}
elsif (/\G(-?\pL+)/gc) {
elsif (/\G(-?[_\pL\pN]+)/gc) {
$name = $1;
}
else {
Expand Down

0 comments on commit 8ab0b77

Please sign in to comment.