Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - parser - fix package autovivification; 3 more lex.t tests …
…pass
  • Loading branch information
fglock committed Nov 28, 2012
1 parent 5879509 commit 0bc2e7a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions html/perlito5.js
Expand Up @@ -253,6 +253,7 @@ p5make_package("Perlito5::Runtime");
p5make_package("Perlito5::Grammar");

function p5make_sub(pkg_name, sub_name, func) {
p5make_package(pkg_name);
p5pkg[pkg_name][sub_name] = func;
}

Expand Down
4 changes: 2 additions & 2 deletions perlito5.pl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src5/lib/Perlito5/Javascript2/Runtime.pm
Expand Up @@ -259,6 +259,7 @@ p5make_package("Perlito5::Runtime");
p5make_package("Perlito5::Grammar");
function p5make_sub(pkg_name, sub_name, func) {
p5make_package(pkg_name);
p5pkg[pkg_name][sub_name] = func;
}
Expand Down
1 change: 1 addition & 0 deletions src5/lib/Perlito5/Javascript3/Runtime.pm
Expand Up @@ -272,6 +272,7 @@ p5make_package("Perlito5::Runtime");
p5make_package("Perlito5::Grammar");
function p5make_sub(pkg_name, sub_name, func) {
p5make_package(pkg_name);
p5pkg[pkg_name][sub_name] = func;
}
Expand Down
34 changes: 17 additions & 17 deletions t5/base/lex.t
@@ -1,7 +1,7 @@
#!./perl

#print "1..57\n";
print "1..43\n";
print "1..46\n";

$x = 'x';

Expand Down Expand Up @@ -249,21 +249,21 @@ print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 29\n" : "not ok 29\n");
## ++$test;
}
##
## # Tests 52-54
## # => should only quote foo::bar if it isn't a real sub. AMS, 20010621
##
## sub xyz::foo { "bar" }
## my %str = (
## foo => 1,
## xyz::foo => 1,
## xyz::bar => 1,
## );
##
## my $test = 52;
## print ((exists $str{foo} ? "" : "not ")."ok $test\n"); ++$test;
## print ((exists $str{bar} ? "" : "not ")."ok $test\n"); ++$test;
## print ((exists $str{xyz::bar} ? "" : "not ")."ok $test\n"); ++$test;
##
# Tests 52-54
# => should only quote foo::bar if it isn't a real sub. AMS, 20010621

sub xyz::foo { "bar" }
my %str = (
foo => 1,
xyz::foo => 1,
xyz::bar => 1,
);

my $test = 43;
print ((exists $str{foo} ? "" : "not ")."ok $test\n"); ++$test;
print ((exists $str{bar} ? "" : "not ")."ok $test\n"); ++$test;
print ((exists $str{xyz::bar} ? "" : "not ")."ok $test\n"); ++$test;

## sub foo::::::bar { print "ok $test\n"; $test++ }
## foo::::::bar;
##
Expand All @@ -274,4 +274,4 @@ print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 29\n" : "not ok 29\n");
# Is "[~" scanned correctly?
@a = (1,2,3);
print "not " unless($a[~~2] == 3);
print "ok 43\n";
print "ok 46\n";

0 comments on commit 0bc2e7a

Please sign in to comment.