Permalink
Browse files

Perlito5 - parser - fix eval-string signature; caret-var fix; 3 more …

…lex.t tests pass
  • Loading branch information...
1 parent bd4c687 commit 5879509ec67735d1b577dabcfe4b930ba576f6fa @fglock committed Nov 28, 2012
Showing with 182 additions and 117 deletions.
  1. +60 −34 html/perlito5.js
  2. +40 −21 perlito5.pl
  3. +21 −0 src5/lib/Perlito5/Grammar.pm
  4. +37 −41 src5/lib/Perlito5/Grammar/Sigil.pm
  5. +4 −1 src5/lib/Perlito5/Precedence.pm
  6. +1 −1 src5/lib/Perlito5/Runtime.pm
  7. +19 −19 t5/base/lex.t
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -380,7 +380,7 @@ sub Perlito5::Precedence::op_parse {
if (exists($End_token->{$term})) {
((my $c1) = substr($str, (($pos + length($term)) - 1), 1));
((my $c2) = substr($str, ($pos + length($term)), 1));
- if (!(((is_ident_middle($c1) && is_ident_middle($c2))))) {
+ if ((!(((is_ident_middle($c1) && is_ident_middle($c2)))) && !(((($c1 eq '<') && ($c2 eq '<')))))) {
return ({'str', $str, 'from', $pos, 'to', $pos, 'capture', ['end', $term]})
}
}
@@ -5314,17 +5314,19 @@ sub Perlito5::Grammar::Sigil::term_sigil {
}
}
};
- if ((substr($str, $p, 1) eq '^')) {
- ($m = Perlito5::Grammar->var_name($str, ($p + 1)));
+ ((my $caret) = Perlito5::Grammar->caret_char($str, $p));
+ if ($caret) {
+ ((my $p) = $caret->{'to'});
+ ((my $name) = Perlito5::Match::flat($caret));
+ ($m = Perlito5::Grammar->var_name($str, $p));
if ($m) {
- ((my $p) = $m->{'to'});
- if ((substr($str, $p, 1) eq '}')) {
- ((my $name) = Perlito5::Match::flat($m));
- ((my $c1) = chr(((ord(substr($name, 0, 1)) - ord('A')) + 1)));
- ($m->{'capture'} = ['term', Perlito5::AST::Apply->new('arguments', [Perlito5::AST::Val::Buf->new('buf', ($c1 . substr($name, 1)))], 'code', ('prefix:<' . $sigil . '>'), 'namespace', '')]);
- ($m->{'to'} = ($m->{'to'} + 1));
- return ($m)
- }
+ ($name = ($name . Perlito5::Match::flat($m)));
+ ($p = $m->{'to'})
+ };
+ if ((substr($str, $p, 1) eq '}')) {
+ ($caret->{'capture'} = ['term', Perlito5::AST::Apply->new('arguments', [Perlito5::AST::Val::Buf->new('buf', $name)], 'code', ('prefix:<' . $sigil . '>'), 'namespace', '')]);
+ ($caret->{'to'} = ($p + 1));
+ return ($caret)
}
};
($m = Perlito5::Expression->curly_parse($str, $p));
@@ -5337,15 +5339,11 @@ sub Perlito5::Grammar::Sigil::term_sigil {
}
}
};
- if (($c1 eq '^')) {
- ((my $p) = $q);
- ($m = Perlito5::Grammar->word($str, $p));
- if ($m) {
- ((my $name) = Perlito5::Match::flat($m));
- ((my $c1) = chr(((ord(substr($name, 0, 1)) - ord('A')) + 1)));
- ($m->{'capture'} = ['term', Perlito5::AST::Apply->new('arguments', [Perlito5::AST::Val::Buf->new('buf', ($c1 . substr($name, 1)))], 'code', ('prefix:<' . $sigil . '>'), 'namespace', '')]);
- return ($m)
- }
+ ((my $caret) = Perlito5::Grammar->caret_char($str, $p));
+ if ($caret) {
+ ((my $name) = Perlito5::Match::flat($caret));
+ ($caret->{'capture'} = ['term', Perlito5::AST::Apply->new('arguments', [Perlito5::AST::Val::Buf->new('buf', $name)], 'code', ('prefix:<' . $sigil . '>'), 'namespace', '')]);
+ return ($caret)
};
if (($c1 eq '$')) {
($m = $self->term_sigil($str, $p));
@@ -6267,6 +6265,27 @@ sub Perlito5::Grammar::ident {
};
$m
};
+sub Perlito5::Grammar::caret_char {
+ ((my $c) = substr($_[1], $_[2], 1));
+ ((my $pos) = $_[2]);
+ if (($c eq '^')) {
+ ($pos)++;
+ ($c = substr($_[1], $pos, 1));
+ if ((($c lt 'A') || ($c gt 'Z'))) {
+ return (0)
+ };
+ ($c = chr(((ord($c) - ord('A')) + 1)))
+ }
+ else {
+ if ($_[0]->ws($_[1], $pos)) {
+ return (0)
+ }
+ };
+ if ((($c lt chr(1)) || ($c gt chr(26)))) {
+ return (0)
+ };
+ return ({'str', $_[1], 'from', $_[2], 'to', ($pos + 1), 'capture', $c})
+};
sub Perlito5::Grammar::full_ident {
((my $grammar) = $_[0]);
((my $str) = $_[1]);
@@ -11950,7 +11969,7 @@ package Perlito5::Runtime;
};
($Perlito5::SPECIAL_VAR = {'$_', 'ARG', '$&', '$MATCH', '$`', '$PREMATCH', '$' . chr(39), '$POSTMATCH', '$+', '$LAST_PAREN_MATCH', '@+', '@LAST_MATCH_END', '%+', '%LAST_PAREN_MATCH', '@-', '@LAST_MATCH_START', '$|', 'autoflush', '$/', '$RS', '@_', '@ARG', '< $', '$EUID', '$.', '$NR', '< $< ', '$UID', '$(', '$GID', '$#', undef(), '$@', '$EVAL_ERROR', '$=', '$FORMAT_LINES_PER_PAGE', '$,', '$OFS', '$?', '$CHILD_ERROR', '$*', undef(), '$[', undef(), '$$', '$PID', '%-', undef(), '$~', '$FORMAT_NAME', '$-', '$FORMAT_LINES_LEFT', '$&', '$MATCH', '$%', '$FORMAT_PAGE_NUMBER', '$)', '$EGID', '$]', undef(), '$!', '$ERRNO', '$;', '$SUBSEP', '$' . chr(92), '$ORS', '%!', undef(), '$"', '$LIST_SEPARATOR', '$_', '$ARG', '$:', 'FORMAT_LINE_BREAK_CHARACTERS'});
($Perlito5::CORE_OVERRIDABLE = {'say', 1, 'break', 1, 'given', 1, 'when', 1, 'default', 1, 'state', 1, 'lock', 1});
-($Perlito5::CORE_PROTO = {'CORE::shutdown', '*$', 'CORE::chop', undef(), 'CORE::lstat', '*', 'CORE::rename', '$$', 'CORE::lock', chr(92) . '$', 'CORE::rand', ';$', 'CORE::gmtime', ';$', 'CORE::gethostbyname', '$', 'CORE::each', chr(92) . '[@%]', 'CORE::ref', '_', 'CORE::syswrite', '*$;$$', 'CORE::msgctl', '$$$', 'CORE::getnetbyname', '$', 'CORE::write', ';*', 'CORE::alarm', '_', 'CORE::print', undef(), 'CORE::getnetent', '', 'CORE::semget', '$$$', 'CORE::use', undef(), 'CORE::abs', '_', 'CORE::break', '', 'CORE::undef', undef(), 'CORE::no', undef(), 'CORE::eval', undef(), 'CORE::split', undef(), 'CORE::localtime', ';$', 'CORE::sort', undef(), 'CORE::chown', '@', 'CORE::endpwent', '', 'CORE::getpwent', '', 'CORE::pos', undef(), 'CORE::lcfirst', '_', 'CORE::kill', '@', 'CORE::send', '*$$;$', 'CORE::endprotoent', '', 'CORE::semctl', '$$$$', 'CORE::waitpid', '$$', 'CORE::utime', '@', 'CORE::dbmclose', chr(92) . '%', 'CORE::getpwnam', '$', 'CORE::substr', '$$;$$', 'CORE::listen', '*$', 'CORE::getprotoent', '', 'CORE::shmget', '$$$', 'CORE::our', undef(), 'CORE::readlink', '_', 'CORE::shmwrite', '$$$$', 'CORE::times', '', 'CORE::package', undef(), 'CORE::map', undef(), 'CORE::join', '$@', 'CORE::rmdir', '_', 'CORE::shmread', '$$$$', 'CORE::uc', '_', 'CORE::bless', '$;$', 'CORE::closedir', '*', 'CORE::getppid', '', 'CORE::tie', chr(92) . '[$@%]$;@', 'CORE::readdir', '*', 'CORE::gethostent', '', 'CORE::getlogin', '', 'CORE::last', undef(), 'CORE::gethostbyaddr', '$$', 'CORE::accept', '**', 'CORE::log', '_', 'CORE::tell', ';*', 'CORE::readline', ';*', 'CORE::tied', undef(), 'CORE::socket', '*$$$', 'CORE::umask', ';$', 'CORE::sysread', '*' . chr(92) . '$$;$', 'CORE::syscall', '$@', 'CORE::quotemeta', '_', 'CORE::dump', '', 'CORE::opendir', '*$', 'CORE::untie', undef(), 'CORE::truncate', '$$', 'CORE::select', ';*', 'CORE::sleep', ';$', 'CORE::seek', '*$$', 'CORE::read', '*' . chr(92) . '$$;$', 'CORE::rewinddir', '*', 'CORE::scalar', undef(), 'CORE::wantarray', '', 'CORE::oct', '_', 'CORE::bind', '*$', 'CORE::stat', '*', 'CORE::sqrt', '_', 'CORE::getc', ';*', 'CORE::fileno', '*', 'CORE::getpeername', '*', 'CORE::sin', '_', 'CORE::getnetbyaddr', '$$', 'CORE::grep', undef(), 'CORE::setservent', '$', 'CORE::sub', undef(), 'CORE::shmctl', '$$$', 'CORE::study', undef(), 'CORE::msgrcv', '$$$$$', 'CORE::setsockopt', '*$$$', 'CORE::int', '_', 'CORE::pop', ';' . chr(92) . '@', 'CORE::link', '$$', 'CORE::exec', undef(), 'CORE::setpwent', '', 'CORE::mkdir', '_;$', 'CORE::sysseek', '*$$', 'CORE::endservent', '', 'CORE::chr', '_', 'CORE::when', undef(), 'CORE::getpwuid', '$', 'CORE::setprotoent', '$', 'CORE::reverse', '@', 'CORE::say', undef(), 'CORE::goto', undef(), 'CORE::getgrent', '', 'CORE::endnetent', '', 'CORE::hex', '_', 'CORE::binmode', '*;$', 'CORE::formline', '$@', 'CORE::getgrnam', '$', 'CORE::ucfirst', '_', 'CORE::chdir', ';$', 'CORE::setnetent', '$', 'CORE::splice', chr(92) . '@;$$@', 'CORE::unlink', '@', 'CORE::time', '', 'CORE::push', chr(92) . '@@', 'CORE::exit', ';$', 'CORE::endgrent', '', 'CORE::unshift', chr(92) . '@@', 'CORE::local', undef(), 'CORE::my', undef(), 'CORE::cos', '_', 'CORE::redo', undef(), 'CORE::warn', '@', 'CORE::getsockname', '*', 'CORE::pipe', '**', 'CORE::sprintf', '$@', 'CORE::open', '*;$@', 'CORE::setpgrp', ';$$', 'CORE::exp', '_', 'CORE::seekdir', '*$', 'CORE::getservbyport', '$$', 'CORE::given', undef(), 'CORE::pack', '$@', 'CORE::msgget', '$$', 'CORE::rindex', '$$;$', 'CORE::srand', ';$', 'CORE::telldir', '*', 'CORE::connect', '*$', 'CORE::getprotobyname', '$', 'CORE::msgsnd', '$$$', 'CORE::length', '_', 'CORE::state', undef(), 'CORE::die', '@', 'CORE::delete', undef(), 'CORE::getservent', '', 'CORE::getservbyname', '$$', 'CORE::setpriority', '$$$', 'CORE::lc', '_', 'CORE::fcntl', '*$$', 'CORE::chroot', '_', 'CORE::recv', '*' . chr(92) . '$$$', 'CORE::dbmopen', chr(92) . '%$$', 'CORE::socketpair', '**$$$', 'CORE::vec', '$$$', 'CORE::system', undef(), 'CORE::defined', '_', 'CORE::index', '$$;$', 'CORE::caller', ';$', 'CORE::close', ';*', 'CORE::atan2', '$$', 'CORE::semop', '$$', 'CORE::unpack', '$;$', 'CORE::ord', '_', 'CORE::chmod', '@', 'CORE::prototype', undef(), 'CORE::getprotobynumber', '$', 'CORE::values', chr(92) . '[@%]', 'CORE::chomp', undef(), 'CORE::ioctl', '*$$', 'CORE::eof', ';*', 'CORE::crypt', '$$', 'CORE::do', undef(), 'CORE::flock', '*$', 'CORE::wait', '', 'CORE::sethostent', '$', 'CORE::return', undef(), 'CORE::getsockopt', '*$$', 'CORE::fork', '', 'CORE::require', undef(), 'CORE::format', undef(), 'CORE::readpipe', '_', 'CORE::endhostent', '', 'CORE::getpgrp', ';$', 'CORE::setgrent', '', 'CORE::keys', chr(92) . '[@%]', 'CORE::glob', undef(), 'CORE::getpriority', '$$', 'CORE::reset', ';$', 'CORE::sysopen', '*$$;$', 'CORE::continue', '', 'CORE::next', undef(), 'CORE::getgrgid', '$', 'CORE::default', undef(), 'CORE::shift', ';' . chr(92) . '@', 'CORE::symlink', '$$', 'CORE::exists', '$', 'CORE::printf', '$@'});
+($Perlito5::CORE_PROTO = {'CORE::shutdown', '*$', 'CORE::chop', undef(), 'CORE::lstat', '*', 'CORE::rename', '$$', 'CORE::lock', chr(92) . '$', 'CORE::rand', ';$', 'CORE::gmtime', ';$', 'CORE::gethostbyname', '$', 'CORE::each', chr(92) . '[@%]', 'CORE::ref', '_', 'CORE::syswrite', '*$;$$', 'CORE::msgctl', '$$$', 'CORE::getnetbyname', '$', 'CORE::write', ';*', 'CORE::alarm', '_', 'CORE::print', undef(), 'CORE::getnetent', '', 'CORE::semget', '$$$', 'CORE::use', undef(), 'CORE::abs', '_', 'CORE::break', '', 'CORE::undef', undef(), 'CORE::no', undef(), 'CORE::eval', '_', 'CORE::split', undef(), 'CORE::localtime', ';$', 'CORE::sort', undef(), 'CORE::chown', '@', 'CORE::endpwent', '', 'CORE::getpwent', '', 'CORE::pos', undef(), 'CORE::lcfirst', '_', 'CORE::kill', '@', 'CORE::send', '*$$;$', 'CORE::endprotoent', '', 'CORE::semctl', '$$$$', 'CORE::waitpid', '$$', 'CORE::utime', '@', 'CORE::dbmclose', chr(92) . '%', 'CORE::getpwnam', '$', 'CORE::substr', '$$;$$', 'CORE::listen', '*$', 'CORE::getprotoent', '', 'CORE::shmget', '$$$', 'CORE::our', undef(), 'CORE::readlink', '_', 'CORE::shmwrite', '$$$$', 'CORE::times', '', 'CORE::package', undef(), 'CORE::map', undef(), 'CORE::join', '$@', 'CORE::rmdir', '_', 'CORE::shmread', '$$$$', 'CORE::uc', '_', 'CORE::bless', '$;$', 'CORE::closedir', '*', 'CORE::getppid', '', 'CORE::tie', chr(92) . '[$@%]$;@', 'CORE::readdir', '*', 'CORE::gethostent', '', 'CORE::getlogin', '', 'CORE::last', undef(), 'CORE::gethostbyaddr', '$$', 'CORE::accept', '**', 'CORE::log', '_', 'CORE::tell', ';*', 'CORE::readline', ';*', 'CORE::tied', undef(), 'CORE::socket', '*$$$', 'CORE::umask', ';$', 'CORE::sysread', '*' . chr(92) . '$$;$', 'CORE::syscall', '$@', 'CORE::quotemeta', '_', 'CORE::dump', '', 'CORE::opendir', '*$', 'CORE::untie', undef(), 'CORE::truncate', '$$', 'CORE::select', ';*', 'CORE::sleep', ';$', 'CORE::seek', '*$$', 'CORE::read', '*' . chr(92) . '$$;$', 'CORE::rewinddir', '*', 'CORE::scalar', undef(), 'CORE::wantarray', '', 'CORE::oct', '_', 'CORE::bind', '*$', 'CORE::stat', '*', 'CORE::sqrt', '_', 'CORE::getc', ';*', 'CORE::fileno', '*', 'CORE::getpeername', '*', 'CORE::sin', '_', 'CORE::getnetbyaddr', '$$', 'CORE::grep', undef(), 'CORE::setservent', '$', 'CORE::sub', undef(), 'CORE::shmctl', '$$$', 'CORE::study', undef(), 'CORE::msgrcv', '$$$$$', 'CORE::setsockopt', '*$$$', 'CORE::int', '_', 'CORE::pop', ';' . chr(92) . '@', 'CORE::link', '$$', 'CORE::exec', undef(), 'CORE::setpwent', '', 'CORE::mkdir', '_;$', 'CORE::sysseek', '*$$', 'CORE::endservent', '', 'CORE::chr', '_', 'CORE::when', undef(), 'CORE::getpwuid', '$', 'CORE::setprotoent', '$', 'CORE::reverse', '@', 'CORE::say', undef(), 'CORE::goto', undef(), 'CORE::getgrent', '', 'CORE::endnetent', '', 'CORE::hex', '_', 'CORE::binmode', '*;$', 'CORE::formline', '$@', 'CORE::getgrnam', '$', 'CORE::ucfirst', '_', 'CORE::chdir', ';$', 'CORE::setnetent', '$', 'CORE::splice', chr(92) . '@;$$@', 'CORE::unlink', '@', 'CORE::time', '', 'CORE::push', chr(92) . '@@', 'CORE::exit', ';$', 'CORE::endgrent', '', 'CORE::unshift', chr(92) . '@@', 'CORE::local', undef(), 'CORE::my', undef(), 'CORE::cos', '_', 'CORE::redo', undef(), 'CORE::warn', '@', 'CORE::getsockname', '*', 'CORE::pipe', '**', 'CORE::sprintf', '$@', 'CORE::open', '*;$@', 'CORE::setpgrp', ';$$', 'CORE::exp', '_', 'CORE::seekdir', '*$', 'CORE::getservbyport', '$$', 'CORE::given', undef(), 'CORE::pack', '$@', 'CORE::msgget', '$$', 'CORE::rindex', '$$;$', 'CORE::srand', ';$', 'CORE::telldir', '*', 'CORE::connect', '*$', 'CORE::getprotobyname', '$', 'CORE::msgsnd', '$$$', 'CORE::length', '_', 'CORE::state', undef(), 'CORE::die', '@', 'CORE::delete', undef(), 'CORE::getservent', '', 'CORE::getservbyname', '$$', 'CORE::setpriority', '$$$', 'CORE::lc', '_', 'CORE::fcntl', '*$$', 'CORE::chroot', '_', 'CORE::recv', '*' . chr(92) . '$$$', 'CORE::dbmopen', chr(92) . '%$$', 'CORE::socketpair', '**$$$', 'CORE::vec', '$$$', 'CORE::system', undef(), 'CORE::defined', '_', 'CORE::index', '$$;$', 'CORE::caller', ';$', 'CORE::close', ';*', 'CORE::atan2', '$$', 'CORE::semop', '$$', 'CORE::unpack', '$;$', 'CORE::ord', '_', 'CORE::chmod', '@', 'CORE::prototype', undef(), 'CORE::getprotobynumber', '$', 'CORE::values', chr(92) . '[@%]', 'CORE::chomp', undef(), 'CORE::ioctl', '*$$', 'CORE::eof', ';*', 'CORE::crypt', '$$', 'CORE::do', undef(), 'CORE::flock', '*$', 'CORE::wait', '', 'CORE::sethostent', '$', 'CORE::return', undef(), 'CORE::getsockopt', '*$$', 'CORE::fork', '', 'CORE::require', undef(), 'CORE::format', undef(), 'CORE::readpipe', '_', 'CORE::endhostent', '', 'CORE::getpgrp', ';$', 'CORE::setgrent', '', 'CORE::keys', chr(92) . '[@%]', 'CORE::glob', undef(), 'CORE::getpriority', '$$', 'CORE::reset', ';$', 'CORE::sysopen', '*$$;$', 'CORE::continue', '', 'CORE::next', undef(), 'CORE::getgrgid', '$', 'CORE::default', undef(), 'CORE::shift', ';' . chr(92) . '@', 'CORE::symlink', '$$', 'CORE::exists', '$', 'CORE::printf', '$@'});
1;
;
@@ -42,6 +42,27 @@ sub ident {
$m;
}
+sub caret_char {
+ my $c = substr( $_[1], $_[2], 1 );
+ my $pos = $_[2];
+ if ($c eq '^') {
+ $pos++;
+ $c = substr( $_[1], $pos, 1 );
+ return 0 if $c lt 'A' || $c gt 'Z';
+ $c = chr( ord($c) - ord("A") + 1 );
+ }
+ elsif ( $_[0]->ws($_[1], $pos) ) {
+ return 0;
+ }
+ return 0 if $c lt "\cA" || $c gt "\cZ";
+ return {
+ str => $_[1],
+ from => $_[2],
+ to => $pos + 1,
+ capture => $c,
+ }
+}
+
token full_ident {
<.ident> [ '::' <.ident> ]*
};
@@ -221,29 +221,30 @@ sub term_sigil {
}
}
}
- if ( substr($str, $p, 1) eq '^' ) {
+ my $caret = Perlito5::Grammar->caret_char( $str, $p );
+ if ( $caret ) {
# ${^ ...
- # TODO - make sure ^ is followed by an ASCII uppercase letter
- $m = Perlito5::Grammar->var_name( $str, $p + 1 );
+ my $p = $caret->{to};
+ my $name = Perlito5::Match::flat($caret);
+ $m = Perlito5::Grammar->var_name($str, $p);
if ($m) {
- my $p = $m->{to};
- if ( substr($str, $p, 1) eq '}' ) {
- my $name = Perlito5::Match::flat($m);
- my $c1 = chr( ord(substr($name, 0, 1)) - ord("A") + 1 );
- $m->{capture} = [ 'term',
- Perlito5::AST::Apply->new(
- 'arguments' => [
- Perlito5::AST::Val::Buf->new(
- 'buf' => $c1 . substr($name, 1),
- )
- ],
- 'code' => 'prefix:<' . $sigil . '>',
- 'namespace' => '',
- )
- ];
- $m->{to} = $m->{to} + 1;
- return $m;
- }
+ $name = $name . Perlito5::Match::flat($m);
+ $p = $m->{to};
+ }
+ if ( substr($str, $p, 1) eq '}' ) {
+ $caret->{capture} = [ 'term',
+ Perlito5::AST::Apply->new(
+ 'arguments' => [
+ Perlito5::AST::Val::Buf->new(
+ 'buf' => $name,
+ )
+ ],
+ 'code' => 'prefix:<' . $sigil . '>',
+ 'namespace' => '',
+ )
+ ];
+ $caret->{to} = $p + 1;
+ return $caret;
}
}
$m = Perlito5::Expression->curly_parse( $str, $p );
@@ -263,27 +264,22 @@ sub term_sigil {
}
}
}
- if ( $c1 eq '^' ) {
+ my $caret = Perlito5::Grammar->caret_char( $str, $p );
+ if ( $caret ) {
# $^ ...
- # TODO - make sure ^ is followed by an ASCII uppercase letter
- my $p = $q;
- $m = Perlito5::Grammar->word( $str, $p );
- if ($m) {
- my $name = Perlito5::Match::flat($m);
- my $c1 = chr( ord(substr($name, 0, 1)) - ord("A") + 1 );
- $m->{capture} = [ 'term',
- Perlito5::AST::Apply->new(
- 'arguments' => [
- Perlito5::AST::Val::Buf->new(
- 'buf' => $c1 . substr($name, 1),
- )
- ],
- 'code' => 'prefix:<' . $sigil . '>',
- 'namespace' => '',
- )
- ];
- return $m;
- }
+ my $name = Perlito5::Match::flat($caret);
+ $caret->{capture} = [ 'term',
+ Perlito5::AST::Apply->new(
+ 'arguments' => [
+ Perlito5::AST::Val::Buf->new(
+ 'buf' => $name,
+ )
+ ],
+ 'code' => 'prefix:<' . $sigil . '>',
+ 'namespace' => '',
+ )
+ ];
+ return $caret;
}
if ( $c1 eq '$' ) {
# $$ ...
@@ -114,7 +114,10 @@ sub op_parse {
if (exists($End_token->{$term})) {
my $c1 = substr($str, $pos + length($term) - 1, 1);
my $c2 = substr($str, $pos + length($term), 1);
- if (!(is_ident_middle($c1) && is_ident_middle($c2) )) {
+ if ( !(is_ident_middle($c1) && is_ident_middle($c2) )
+ && !($c1 eq '<' && $c2 eq '<')
+ )
+ {
# it looks like an end token, and it is not one of these cases:
# if_more
return {
@@ -103,7 +103,7 @@ $Perlito5::CORE_PROTO = {
'CORE::break' => '',
'CORE::undef' => undef,
'CORE::no' => undef,
- 'CORE::eval' => undef,
+ 'CORE::eval' => '_', # original undef
'CORE::split' => undef,
'CORE::localtime' => ';$',
'CORE::sort' => undef,
Oops, something went wrong.

0 comments on commit 5879509

Please sign in to comment.