Permalink
Browse files

[STD et al.] rename .pm to .pm6 for all p6 modules in this dir

[Cursor] prefer .pm6 over .pm in any particular directory when searching for p6 code
[Actions.pm] handle prefix metaops without spewing yaml dumps


git-svn-id: http://svn.pugscode.org/pugs@30342 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent e01b484 commit 99a7592c91d7fc24f6012540589feb558342b6c5 lwall committed Apr 8, 2010
View
@@ -1,3 +1,5 @@
+use YAML::XS;
+
package Actions;
# Generic ast translation done via autoload
@@ -276,7 +278,9 @@ sub PREFIX {
$base = '';
}
else {
- $class = $match->{_ast}{prefix}{_op} // warn ::Dump($match);
+ $class = $match->{_ast}{prefix}{_op} //
+ $class = $match->{_ast}{prefix_postfix_meta_operator}{_op} //
+ $class = $match->{_ast}{prefix_circumfix_meta_operator}{_op} // warn ::Dump($match);
}
gen_class($class,$base);
View
File renamed without changes.
View
@@ -204,12 +204,12 @@ sub parsefile {
my $result;
if ($STORABLE) {
- my $store = "lex/STD.pm.store";
+ my $store = "lex/STD.pm6.store";
if (-f $store and -M $file > -M $store) {
*::LEXERS = retrieve($store);
}
$result = $class->initparse($text,@_);
- if (defined $result and $file eq 'STD.pm') {
+ if (defined $result and $file eq 'STD.pm6') {
store(\%::LEXERS, $store);
}
}
@@ -220,7 +220,7 @@ sub parsefile {
if ($::YOU_WERE_HERE) {
$result->you_were_here;
}
- elsif ($file =~ /\.pm$/) {
+ elsif ($file =~ /\.pm6?$/) {
$result->you_were_here;
}
$result;
@@ -2430,24 +2430,34 @@ sub do_need { my $self = shift;
}
}
$modfile =~ s/::/\//g;
+ my $ext;
for my $d (@::PERL6LIB) {
- if (-f "$d/$modfile.pm") {
+ if (-f "$d/$modfile.pm6") {
+ $ext = '.pm6';
+ $lib = $d;
+ last;
+ }
+ elsif (-f "$d/$modfile.pm") {
+ $ext = '.pm';
$lib = $d;
last;
}
}
my $syml = $::TMP_PREFIX . 'syml';
mkdir $syml unless -d $syml;
- if (-f "$syml/$modfile.pm.syml" and -M "$lib/$modfile.pm" > -M "$syml/$modfile.pm.syml") {
- $topsym = LoadFile("$syml/$modfile.pm.syml");
+ if (not $ext) {
+ $self->worry("Can't locate module $module");
+ }
+ elsif (-f "$syml/$modfile$ext.syml" and -M "$lib/$modfile$ext" > -M "$syml/$modfile$ext.syml") {
+ $topsym = LoadFile("$syml/$modfile$ext.syml");
}
- elsif (-f "$lib/$modfile.pm") {
- # say "$std $lib/$module.pm";
- system "$std $lib/$module.pm" and die "Can't compile $lib/$module.pm";
- $topsym = LoadFile("$syml/$modfile.pm.syml");
+ elsif (-f "$lib/$modfile$ext") {
+ # say "$std $lib/$module$ext";
+ system "$std $lib/$module$ext" and die "Can't compile $lib/$module$ext";
+ $topsym = LoadFile("$syml/$modfile$ext.syml");
}
else {
- $self->worry("Can't locate module $module");
+ $self->worry("Module $module disappeared during load");
}
$self->add_my_name($module);
$::DECLARAND->{really} = $topsym;
View
@@ -1,9 +1,9 @@
-# Makefile for STD.pm viv etcetera in pugs/src/perl6
+# Makefile for STD.pm6 viv etcetera in pugs/src/perl6
.PHONY: check try cat clean distclean purge test
-FIXINS=Cursor.pmc RE_ast.pmc LazyMap.pm Actions.pm lib/DEBUG.pm DEBUG.pmc lib/Test.pm \
- CORE.setting NULL.pad std mangle.pl CORE.pad lib/NAME.pm NAME.pmc \
- lib/Stash.pm Stash.pmc sprixel.pl ToJS.pm viv sprixelCORE.setting
+FIXINS=Cursor.pmc RE_ast.pmc LazyMap.pm Actions.pm lib/DEBUG.pm6 DEBUG.pmc lib/Test.pm6 \
+ CORE.setting NULL.pad std mangle.pl CORE.pad lib/NAME.pm6 NAME.pmc \
+ lib/Stash.pm6 Stash.pmc sprixel.pl ToJS.pm viv sprixelCORE.setting
all: $(FIXINS) check lex/STD/termish
@@ -23,12 +23,16 @@ snap: $(FIXINS) check lex/STD/termish
-mv snap snap.old
mv snap.new snap
-STD_P5.pmc: STD_P5.pm gimme5
+STD_P5.pm5: STD_P5.pm6 gimme5
perl gimme5 $< >STD_P5.pm5
+
+STD_P5.pmc: STD_P5.pm5
perl -p -e 'next if /^---/../\A\w+\Z/;' -e 's/\A[ \t]+//;' STD_P5.pm5 >$@
-STD.pmc: STD.pm gimme5
+STD.pm5: STD.pm6 gimme5
perl gimme5 $< >STD.pm5
+
+STD.pmc: STD.pm5
perl -p -e 'next if /^---/../\A\w+\Z/;' -e 's/\A[ \t]+//;' STD.pm5 >$@
rm -rf lex syml/*.pad.store
@@ -43,7 +47,7 @@ check: STD.pmc STD_P5.pmc
# pre-generate common sublexers
lex/STD/termish: STD.pmc STD_P5.pmc syml/CORE.syml
@echo 'Generating STD lexers...'
- ./tryfile STD.pm
+ ./tryfile STD.pm6
cat:
cat try5.out
@@ -75,7 +79,7 @@ help:
@echo 'STD_P5.pmc (internal)'
@echo 'STD.pmc (internal)'
@echo 'syml/CORE.syml (internal)'
- @echo 'check validates STD.pm STD.pmc and STD_P5.pmc in Perl 5'
+ @echo 'check validates STD.pmc and STD_P5.pmc in Perl 5'
@echo 'lex/STD/termish (internal)'
@echo 'cat shows the output written by the last tryfile'
@echo 'clean removes many generated files'
View
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
File renamed without changes.

0 comments on commit 99a7592

Please sign in to comment.