Skip to content

Commit b95d306

Browse files
committed
Perlito5 - grammar - use exists()
1 parent ccc33d7 commit b95d306

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

html/perlito5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9033,7 +9033,7 @@ return (p5call(p5pkg["Perlito5::AST::Val::Buf"], "new", ['buf', p5pkg["Perlito5:
90339033
};
90349034
var v_effective_name;
90359035
v_effective_name = ((p5str(p5or(v_namespace, function () { return p5make_package("Perlito5")["v_PKG_NAME"] })) + '::' + p5str(v_name)));
9036-
if ( (p5make_package("Perlito5")["v_PROTO"])._hash_.hasOwnProperty(v_effective_name) ) {
9036+
if ( ((p5make_package("Perlito5")["v_PROTO"])._hash_.hasOwnProperty(v_effective_name) || p5sub_exists(p5str(v_effective_name), 'Perlito5::Grammar::Print')) ) {
90379037
(function () { throw(p5context([], p5want)) })();
90389038
};
90399039
if ( ((!( p5bool(v_namespace)) || (p5str(v_namespace) == 'CORE')) && (p5make_package("Perlito5")["v_CORE_PROTO"])._hash_.hasOwnProperty(('CORE::' + p5str(v_name)))) ) {

perlito5.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6431,7 +6431,7 @@ sub Perlito5::Grammar::Print::typeglob {
64316431
return $m_name
64326432
};
64336433
my $effective_name = ((($namespace || $Perlito5::PKG_NAME)) . '::' . $name);
6434-
if (exists($Perlito5::PROTO->{$effective_name})) {
6434+
if ((exists($Perlito5::PROTO->{$effective_name}) || exists(&{$effective_name}))) {
64356435
return
64366436
};
64376437
if ((((!($namespace) || ($namespace eq 'CORE'))) && exists($Perlito5::CORE_PROTO->{('CORE::' . $name)}))) {

src5/lib/Perlito5/Grammar/Print.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ sub typeglob {
116116
}
117117

118118
my $effective_name = ( $namespace || $Perlito5::PKG_NAME ) . '::' . $name;
119-
if ( exists $Perlito5::PROTO->{$effective_name} ) {
119+
if ( exists $Perlito5::PROTO->{$effective_name} || exists &{$effective_name} ) {
120120
# subroutine was predeclared
121121
return;
122122
}

0 commit comments

Comments
 (0)