Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[STD] change YOU_ARE_HERE to {YOU_ARE_HERE}

[tryfile] find the spec dir even if .t file is from command line


git-svn-id: http://svn.pugscode.org/pugs@31738 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 30fb01dfecf1ff29eb6bc38521f101a21fbc4bd6 1 parent 6694cdf
lwall authored
View
2  CORE.setting
@@ -504,4 +504,4 @@ my package PROCESS {
my %ENV is export;
}
-YOU_ARE_HERE;
+{YOU_ARE_HERE};
View
7 STD.pm6
@@ -1387,6 +1387,7 @@ grammar P6 is STD {
<.finishlex>
[
+ | '{YOU_ARE_HERE}' <.you_are_here>
| :dba('block') '{' ~ '}' <statementlist> :: <.curlycheck>
| <?terminator> <.panic: 'Missing block'>
| <?> <.panic: "Malformed block">
@@ -3169,12 +3170,6 @@ grammar P6 is STD {
# Terms #
#########
- # start playing with the setting stubber
- token term:YOU_ARE_HERE {
- <sym> <.you_are_here>
- <O(|%term)>
- }
-
token term:new {
'new' \h+ <longname> \h* <!before ':'> <.obs("C++ constructor syntax", "method call syntax")>
}
View
622 stage0/CORE.setting
@@ -189,319 +189,319 @@ my class IO { }
my class KitchenSink { }
-my proto WHAT { }
-my proto WHERE { }
-my proto HOW { }
-my proto WHICH { }
-my proto VAR { }
-my proto WHO { }
-my proto WHENCE { }
-my proto new { }
-my proto fail { }
-my proto temp { }
-my proto let { }
-my proto any { }
-my proto all { }
-my proto none { }
-my proto one { }
-my proto not { }
-my proto so { }
-my proto next { }
-my proto last { }
-my proto redo { }
-my proto succeed { }
-my proto goto { }
-
-my proto die { }
-my proto exit { }
-my proto warn { }
-my proto note { }
-my proto caller { }
-my proto callframe { }
-my proto eval { }
-my proto evalfile { }
-my proto callsame { }
-my proto callwith { }
-my proto nextsame { }
-my proto nextwith { }
-my proto lastcall { }
-my proto defined { }
-my proto notdef { }
-my proto undefine { }
-my proto item { }
-my proto list { }
-my proto slice { }
-my proto eager { }
-my proto hyper { }
-
-my proto cat { }
-my proto classify { }
-my proto quotemeta { }
-my proto chr { }
-my proto ord { }
-my proto p5chop { }
-my proto chop { }
-my proto p5chomp { }
-my proto chomp { }
-my proto trim { }
-my proto trim-leading { }
-my proto trim-trailing { }
-my proto index { }
-my proto rindex { }
-my proto substr { }
-my proto join { }
-my proto split { }
-my proto comb { }
-my proto pack { }
-my proto unpack { }
-my proto uc { }
-my proto ucfirst { }
-my proto lc { }
-my proto lcfirst { }
-my proto normalize { }
-my proto nfc { }
-my proto nfd { }
-my proto nfkc { }
-my proto nfkd { }
-my proto samecase { }
-my proto sameaccent { }
-my proto capitalize { }
-my proto chars { }
-my proto graphs { }
-my proto codes { }
-my proto bytes { }
-
-my proto say { }
-my proto print { }
-my proto open { }
-my proto close { }
-my proto printf { }
-my proto sprintf { }
-my proto unlink { }
-my proto link { }
-my proto symlink { }
-my proto elems { }
-my proto end { }
-my proto grep { }
-my proto map { }
-my proto first { }
-my proto reduce { }
-my proto sort { }
-my proto min { }
-my proto max { }
-my proto minmax { }
-my proto uniq { }
-my proto push { }
-my proto rotate { }
-my proto reverse { }
-my proto flip { }
-my proto take { }
-my proto splice { }
-my proto slurp { }
-my proto get { }
-my proto lines { }
-my proto getc { }
-my proto prompt { }
-my proto chdir { }
-my proto chmod { }
-
-my proto zip { }
-my proto each { }
-my proto roundrobin { }
-my proto return { }
-my proto leave { }
-my proto make { }
-my proto pop { }
-my proto shift { }
-my proto unshift { }
-my proto keys { }
-my proto values { }
-my proto hash { }
-my proto kv { }
-my proto key { }
-my proto value { }
-my proto pairs { }
-my proto invert { }
-my proto pair { }
-my proto enum { }
-
-my proto sign { }
-my proto abs { }
-my proto floor { }
-my proto ceiling { }
-my proto round { }
-my proto truncate { }
-my proto exp { }
-my proto log { }
-my proto log10 { }
-my proto sqrt { }
-my proto roots { }
-my proto rand { }
-my proto srand { }
-my proto pick { }
-my proto cis { }
-my proto unpolar { }
-
-my proto sin { }
-my proto cos { }
-my proto tan { }
-my proto asin { }
-my proto acos { }
-my proto atan { }
-my proto sec { }
-my proto cosec { }
-my proto cotan { }
-my proto asec { }
-my proto acosec { }
-my proto acotan { }
-my proto sinh { }
-my proto cosh { }
-my proto tanh { }
-my proto asinh { }
-my proto acosh { }
-my proto atanh { }
-my proto sech { }
-my proto cosech { }
-my proto cotanh { }
-my proto asech { }
-my proto acosech { }
-my proto acotanh { }
-my proto atan2 { }
-
-my proto today { }
-
-my proto gmtime { }
-my proto localtime { }
-my proto time { }
-my proto times { }
-my proto gethost { }
-my proto getpw { }
-my proto chroot { }
-my proto getlogin { }
-my proto run { }
-my proto runinstead { }
-my proto fork { }
-my proto wait { }
-my proto kill { }
-my proto sleep { }
-
-my proto postfix:<i> ($x) { }
-my proto infix:<.> ($x,$y) { }
-my proto postfix:['->'] ($x) { }
-my proto postfix:<++> ($x) { }
-my proto postfix:«--» ($x) { }
-my proto prefix:<++> ($x) { }
-my proto prefix:«--» ($x) { }
-my proto infix:<**> ($x,$y) { }
-my proto prefix:<!> ($x) { }
-my proto prefix:<+> ($x) { }
-my proto prefix:<-> ($x) { }
-my proto prefix:<~~> ($x) { }
-my proto prefix:<~> ($x) { }
-my proto prefix:<??> ($x) { }
-my proto prefix:<?> ($x) { }
-my proto prefix:<~^> ($x) { }
-my proto prefix:<+^> ($x) { }
-my proto prefix:<?^> ($x) { }
-my proto prefix:<^^> ($x) { }
-my proto prefix:<^> ($x) { }
-my proto prefix:<||> ($x) { }
-my proto prefix:<|> ($x) { }
-my proto infix:<*> ($x,$y) { }
-my proto infix:</> ($x,$y) { }
-my proto infix:<div> ($x,$y) { }
-my proto infix:<%> ($x,$y) { }
-my proto infix:<mod> ($x,$y) { }
-my proto infix:<+&> ($x,$y) { }
-my proto infix:« << » ($x,$y) { }
-my proto infix:« >> » ($x,$y) { }
-my proto infix:<~&> ($x,$y) { }
-my proto infix:<?&> ($x,$y) { }
-my proto infix:« ~< » ($x,$y) { }
-my proto infix:« ~> » ($x,$y) { }
-my proto infix:« +< » ($x,$y) { }
-my proto infix:« +> » ($x,$y) { }
-my proto infix:<+> ($x,$y) { }
-my proto infix:<-> ($x,$y) { }
-my proto infix:<+|> ($x,$y) { }
-my proto infix:<+^> ($x,$y) { }
-my proto infix:<~|> ($x,$y) { }
-my proto infix:<~^> ($x,$y) { }
-my proto infix:<?|> ($x,$y) { }
-my proto infix:<?^> ($x,$y) { }
-my proto infix:<x> ($x,$y) { }
-my proto infix:<xx> ($x,$y) { }
-my proto infix:<~> ($x,$y) { }
-my proto infix:<&> ($x,$y) { }
-my proto infix:<|> ($x,$y) { }
-my proto infix:<^> ($x,$y) { }
-my proto infix:« <=> » ($x,$y) { }
-my proto infix:<..> ($x,$y) { }
-my proto infix:<^..> ($x,$y) { }
-my proto infix:<..^> ($x,$y) { }
-my proto infix:<^..^> ($x,$y) { }
-my proto infix:<==> ($x,$y) { }
-my proto infix:<!=> ($x,$y) { }
-my proto infix:« < » ($x,$y) { }
-my proto infix:« <= » ($x,$y) { }
-my proto infix:« > » ($x,$y) { }
-my proto infix:« >= » ($x,$y) { }
-my proto infix:<~~> ($x,$y) { }
-my proto infix:<!~> ($x,$y) { }
-my proto infix:<=~> ($x,$y) { }
-my proto infix:<eq> ($x,$y) { }
-my proto infix:<ne> ($x,$y) { }
-my proto infix:<lt> ($x,$y) { }
-my proto infix:<le> ($x,$y) { }
-my proto infix:<gt> ($x,$y) { }
-my proto infix:<ge> ($x,$y) { }
-my proto infix:<=:=> ($x,$y) { }
-my proto infix:<===> ($x,$y) { }
-my proto infix:<eqv> ($x,$y) { }
-my proto infix:<before> ($x,$y) { }
-my proto infix:<after> ($x,$y) { }
-my proto infix:<&&> ($x,$y) { }
-my proto infix:<||> ($x,$y) { }
-my proto infix:<^^> ($x,$y) { }
-my proto infix:<//> ($x,$y) { }
-my proto infix:<min> ($x,$y) { }
-my proto infix:<max> ($x,$y) { }
-my proto infix:<?? !!> ($x,$y) { }
-my proto infix:<!!> ($x,$y) { }
-my proto infix:<?> ($x,$y) { }
-my proto infix:<ff> ($x,$y) { }
-my proto infix:<^ff> ($x,$y) { }
-my proto infix:<ff^> ($x,$y) { }
-my proto infix:<^ff^> ($x,$y) { }
-my proto infix:<fff> ($x,$y) { }
-my proto infix:<^fff> ($x,$y) { }
-my proto infix:<fff^> ($x,$y) { }
-my proto infix:<^fff^> ($x,$y) { }
-my proto infix:<=> ($x,$y) { }
-my proto infix:<:=> ($x,$y) { }
-my proto infix:<::=> ($x,$y) { }
-my proto infix:<.=> ($x,$y) { }
-my proto infix:« => » ($x,$y) { }
-my proto prefix:<so> ($x) { }
-my proto prefix:<not> ($x) { }
-my proto infix:<,> ($x,$y) { }
-my proto infix:<:> ($x,$y) { }
-my proto infix:<X> ($x,$y) { }
-my proto infix:<Z> ($x,$y) { }
-my proto infix:<minmax> ($x,$y) { }
-my proto infix:<...> ($x,$y) { }
-my proto infix:<and> ($x,$y) { }
-my proto infix:<andthen> ($x,$y) { }
-my proto infix:<or> ($x,$y) { }
-my proto infix:<orelse> ($x,$y) { }
-my proto infix:<xor> ($x,$y) { }
-my proto infix:« <== » ($x,$y) { }
-my proto infix:« ==> » ($x,$y) { }
-my proto infix:« <<== » ($x,$y) { }
-my proto infix:« ==>> » ($x,$y) { }
+my proto WHAT {*}
+my proto WHERE {*}
+my proto HOW {*}
+my proto WHICH {*}
+my proto VAR {*}
+my proto WHO {*}
+my proto WHENCE {*}
+my proto new {*}
+my proto fail {*}
+my proto temp {*}
+my proto let {*}
+my proto any {*}
+my proto all {*}
+my proto none {*}
+my proto one {*}
+my proto not {*}
+my proto so {*}
+my proto next {*}
+my proto last {*}
+my proto redo {*}
+my proto succeed {*}
+my proto goto {*}
+
+my proto die {*}
+my proto exit {*}
+my proto warn {*}
+my proto note {*}
+my proto caller {*}
+my proto callframe {*}
+my proto eval {*}
+my proto evalfile {*}
+my proto callsame {*}
+my proto callwith {*}
+my proto nextsame {*}
+my proto nextwith {*}
+my proto lastcall {*}
+my proto defined {*}
+my proto notdef {*}
+my proto undefine {*}
+my proto item {*}
+my proto list {*}
+my proto slice {*}
+my proto eager {*}
+my proto hyper {*}
+
+my proto cat {*}
+my proto classify {*}
+my proto quotemeta {*}
+my proto chr {*}
+my proto ord {*}
+my proto p5chop {*}
+my proto chop {*}
+my proto p5chomp {*}
+my proto chomp {*}
+my proto trim {*}
+my proto trim-leading {*}
+my proto trim-trailing {*}
+my proto index {*}
+my proto rindex {*}
+my proto substr {*}
+my proto join {*}
+my proto split {*}
+my proto comb {*}
+my proto pack {*}
+my proto unpack {*}
+my proto uc {*}
+my proto ucfirst {*}
+my proto lc {*}
+my proto lcfirst {*}
+my proto normalize {*}
+my proto nfc {*}
+my proto nfd {*}
+my proto nfkc {*}
+my proto nfkd {*}
+my proto samecase {*}
+my proto sameaccent {*}
+my proto capitalize {*}
+my proto chars {*}
+my proto graphs {*}
+my proto codes {*}
+my proto bytes {*}
+
+my proto say {*}
+my proto print {*}
+my proto open {*}
+my proto close {*}
+my proto printf {*}
+my proto sprintf {*}
+my proto unlink {*}
+my proto link {*}
+my proto symlink {*}
+my proto elems {*}
+my proto end {*}
+my proto grep {*}
+my proto map {*}
+my proto first {*}
+my proto reduce {*}
+my proto sort {*}
+my proto min {*}
+my proto max {*}
+my proto minmax {*}
+my proto uniq {*}
+my proto push {*}
+my proto rotate {*}
+my proto reverse {*}
+my proto flip {*}
+my proto take {*}
+my proto splice {*}
+my proto slurp {*}
+my proto get {*}
+my proto lines {*}
+my proto getc {*}
+my proto prompt {*}
+my proto chdir {*}
+my proto chmod {*}
+
+my proto zip {*}
+my proto each {*}
+my proto roundrobin {*}
+my proto return {*}
+my proto leave {*}
+my proto make {*}
+my proto pop {*}
+my proto shift {*}
+my proto unshift {*}
+my proto keys {*}
+my proto values {*}
+my proto hash {*}
+my proto kv {*}
+my proto key {*}
+my proto value {*}
+my proto pairs {*}
+my proto invert {*}
+my proto pair {*}
+my proto enum {*}
+
+my proto sign {*}
+my proto abs {*}
+my proto floor {*}
+my proto ceiling {*}
+my proto round {*}
+my proto truncate {*}
+my proto exp {*}
+my proto log {*}
+my proto log10 {*}
+my proto sqrt {*}
+my proto roots {*}
+my proto rand {*}
+my proto srand {*}
+my proto pick {*}
+my proto cis {*}
+my proto unpolar {*}
+
+my proto sin {*}
+my proto cos {*}
+my proto tan {*}
+my proto asin {*}
+my proto acos {*}
+my proto atan {*}
+my proto sec {*}
+my proto cosec {*}
+my proto cotan {*}
+my proto asec {*}
+my proto acosec {*}
+my proto acotan {*}
+my proto sinh {*}
+my proto cosh {*}
+my proto tanh {*}
+my proto asinh {*}
+my proto acosh {*}
+my proto atanh {*}
+my proto sech {*}
+my proto cosech {*}
+my proto cotanh {*}
+my proto asech {*}
+my proto acosech {*}
+my proto acotanh {*}
+my proto atan2 {*}
+
+my proto today {*}
+
+my proto gmtime {*}
+my proto localtime {*}
+my proto time {*}
+my proto times {*}
+my proto gethost {*}
+my proto getpw {*}
+my proto chroot {*}
+my proto getlogin {*}
+my proto run {*}
+my proto runinstead {*}
+my proto fork {*}
+my proto wait {*}
+my proto kill {*}
+my proto sleep {*}
+
+my proto postfix:<i> ($x) {*}
+my proto infix:<.> ($x,$y) {*}
+my proto postfix:['->'] ($x) {*}
+my proto postfix:<++> ($x) {*}
+my proto postfix:«--» ($x) {*}
+my proto prefix:<++> ($x) {*}
+my proto prefix:«--» ($x) {*}
+my proto infix:<**> ($x,$y) {*}
+my proto prefix:<!> ($x) {*}
+my proto prefix:<+> ($x) {*}
+my proto prefix:<-> ($x) {*}
+my proto prefix:<~~> ($x) {*}
+my proto prefix:<~> ($x) {*}
+my proto prefix:<??> ($x) {*}
+my proto prefix:<?> ($x) {*}
+my proto prefix:<~^> ($x) {*}
+my proto prefix:<+^> ($x) {*}
+my proto prefix:<?^> ($x) {*}
+my proto prefix:<^^> ($x) {*}
+my proto prefix:<^> ($x) {*}
+my proto prefix:<||> ($x) {*}
+my proto prefix:<|> ($x) {*}
+my proto infix:<*> ($x,$y) {*}
+my proto infix:</> ($x,$y) {*}
+my proto infix:<div> ($x,$y) {*}
+my proto infix:<%> ($x,$y) {*}
+my proto infix:<mod> ($x,$y) {*}
+my proto infix:<+&> ($x,$y) {*}
+my proto infix:« << » ($x,$y) {*}
+my proto infix:« >> » ($x,$y) {*}
+my proto infix:<~&> ($x,$y) {*}
+my proto infix:<?&> ($x,$y) {*}
+my proto infix:« ~< » ($x,$y) {*}
+my proto infix:« ~> » ($x,$y) {*}
+my proto infix:« +< » ($x,$y) {*}
+my proto infix:« +> » ($x,$y) {*}
+my proto infix:<+> ($x,$y) {*}
+my proto infix:<-> ($x,$y) {*}
+my proto infix:<+|> ($x,$y) {*}
+my proto infix:<+^> ($x,$y) {*}
+my proto infix:<~|> ($x,$y) {*}
+my proto infix:<~^> ($x,$y) {*}
+my proto infix:<?|> ($x,$y) {*}
+my proto infix:<?^> ($x,$y) {*}
+my proto infix:<x> ($x,$y) {*}
+my proto infix:<xx> ($x,$y) {*}
+my proto infix:<~> ($x,$y) {*}
+my proto infix:<&> ($x,$y) {*}
+my proto infix:<|> ($x,$y) {*}
+my proto infix:<^> ($x,$y) {*}
+my proto infix:« <=> » ($x,$y) {*}
+my proto infix:<..> ($x,$y) {*}
+my proto infix:<^..> ($x,$y) {*}
+my proto infix:<..^> ($x,$y) {*}
+my proto infix:<^..^> ($x,$y) {*}
+my proto infix:<==> ($x,$y) {*}
+my proto infix:<!=> ($x,$y) {*}
+my proto infix:« < » ($x,$y) {*}
+my proto infix:« <= » ($x,$y) {*}
+my proto infix:« > » ($x,$y) {*}
+my proto infix:« >= » ($x,$y) {*}
+my proto infix:<~~> ($x,$y) {*}
+my proto infix:<!~> ($x,$y) {*}
+my proto infix:<=~> ($x,$y) {*}
+my proto infix:<eq> ($x,$y) {*}
+my proto infix:<ne> ($x,$y) {*}
+my proto infix:<lt> ($x,$y) {*}
+my proto infix:<le> ($x,$y) {*}
+my proto infix:<gt> ($x,$y) {*}
+my proto infix:<ge> ($x,$y) {*}
+my proto infix:<=:=> ($x,$y) {*}
+my proto infix:<===> ($x,$y) {*}
+my proto infix:<eqv> ($x,$y) {*}
+my proto infix:<before> ($x,$y) {*}
+my proto infix:<after> ($x,$y) {*}
+my proto infix:<&&> ($x,$y) {*}
+my proto infix:<||> ($x,$y) {*}
+my proto infix:<^^> ($x,$y) {*}
+my proto infix:<//> ($x,$y) {*}
+my proto infix:<min> ($x,$y) {*}
+my proto infix:<max> ($x,$y) {*}
+my proto infix:<?? !!> ($x,$y) {*}
+my proto infix:<!!> ($x,$y) {*}
+my proto infix:<?> ($x,$y) {*}
+my proto infix:<ff> ($x,$y) {*}
+my proto infix:<^ff> ($x,$y) {*}
+my proto infix:<ff^> ($x,$y) {*}
+my proto infix:<^ff^> ($x,$y) {*}
+my proto infix:<fff> ($x,$y) {*}
+my proto infix:<^fff> ($x,$y) {*}
+my proto infix:<fff^> ($x,$y) {*}
+my proto infix:<^fff^> ($x,$y) {*}
+my proto infix:<=> ($x,$y) {*}
+my proto infix:<:=> ($x,$y) {*}
+my proto infix:<::=> ($x,$y) {*}
+my proto infix:<.=> ($x,$y) {*}
+my proto infix:« => » ($x,$y) {*}
+my proto prefix:<so> ($x) {*}
+my proto prefix:<not> ($x) {*}
+my proto infix:<,> ($x,$y) {*}
+my proto infix:<:> ($x,$y) {*}
+my proto infix:<X> ($x,$y) {*}
+my proto infix:<Z> ($x,$y) {*}
+my proto infix:<minmax> ($x,$y) {*}
+my proto infix:<...> ($x,$y) {*}
+my proto infix:<and> ($x,$y) {*}
+my proto infix:<andthen> ($x,$y) {*}
+my proto infix:<or> ($x,$y) {*}
+my proto infix:<orelse> ($x,$y) {*}
+my proto infix:<xor> ($x,$y) {*}
+my proto infix:« <== » ($x,$y) {*}
+my proto infix:« ==> » ($x,$y) {*}
+my proto infix:« <<== » ($x,$y) {*}
+my proto infix:« ==>> » ($x,$y) {*}
my package PROCESS {
my %ENV is export;
}
-YOU_ARE_HERE;
+{YOU_ARE_HERE};
View
50 stage0/CursorBase.pmc
@@ -56,6 +56,8 @@ use YAML::XS;
use Storable;
use Encode;
use Scalar::Util 'refaddr';
+use File::ShareDir 'dist_dir';
+use Try::Tiny;
use Term::ANSIColor;
our $BLUE = color 'blue';
@@ -168,9 +170,7 @@ sub clean {
sub dump {
my $self = shift;
my %copy = %$self;
- delete $copy{_reduced};
- delete $copy{_fate};
- my $text = STD::Dump(\%copy);
+ my $text = YAML::XS::Dump(\%copy);
$text;
}
@@ -196,7 +196,8 @@ sub new {
sub parse {
my $class = shift;
my $text = shift;
- local $::FILE = { name => '(eval)' };
+ my %args = @_;
+ local $::FILE = { name => $args{'filename'} // '(eval)' };
$class->initparse($text,@_);
}
@@ -222,7 +223,7 @@ sub parsefile {
# used internally to isolate contextuals in do_need
sub _parse_module {
- $_[0]->parsefile($ARGV[0], setting => "CORE");
+ $_[0]->parsefile($ARGV[0],setting=>$ENV{DEFAULT_SETTING_FOR_MODULES} // "CORE");
exit 0;
}
@@ -238,6 +239,8 @@ sub initparse {
my $filename = $args{filename};
local $::TMP_PREFIX = $tmp_prefix;
+ local $::SYML_SEARCH_PATH = $args{syml_search_path} // ($ENV{SYML_SEARCH_PATH} ? [split ':',$ENV{SYML_SEARCH_PATH}] : [$::TMP_PREFIX]);
+
local $::SETTINGNAME = $setting;
local $::ACTIONS = $actions;
local $::RECURSIVE_PERL = $args{recursive_perl};
@@ -281,14 +284,14 @@ sub initparse {
sub load_lex {
my $self = shift;
my $setting = shift;
- my $syml = $::TMP_PREFIX . 'syml';
- my $file = "$syml/$setting.syml";
- if (-e $file) {
- bless($self->load_yaml_lex($setting),'Stash');
- }
- else {
- bless($self->load_perl_lex($setting),'Stash');
+ for my $prefix (@{$::SYML_SEARCH_PATH}) {
+ my $syml = $prefix . 'syml';
+ my $file = "$syml/$setting.syml";
+ if (-e $file) {
+ return bless($self->load_yaml_lex($setting,$file),'Stash');
+ }
}
+ bless($self->load_perl_lex($setting),'Stash');
}
sub load_perl_lex {
@@ -301,7 +304,6 @@ sub load_perl_lex {
my $store = "$syml/$setting.lex.store";
mkdir $syml unless -d $syml;
if (-f $store and -M $file and -M $file > -M $store) {
- # HACK we get hashes with strangely aliased keys from Storable
$LEXS{$setting} = retrieve($store);
}
else {
@@ -313,7 +315,8 @@ can be used.
EOM
}
$LEXS{$setting} = require $file;
- store($LEXS{$setting}, $store);
+ # store may fail if we don't have write privilages
+ try {store($LEXS{$setting}, $store)};
}
$LEXS{$setting};
}
@@ -329,19 +332,17 @@ sub LoadFile {
sub load_yaml_lex {
my $self = shift;
my $setting = shift;
+ my $file = shift;
state %LEXS;
return $LEXS{$setting} if $LEXS{$setting};
- my $syml = $::TMP_PREFIX . 'syml';
- my $file = "$syml/$setting.syml";
- my $store = "$syml/$setting.syml.store";
- mkdir $syml unless -d $syml;
+ my $store = $file.".store";
if (-f $store and -M $file and -M $file > -M $store) {
$LEXS{$setting} = retrieve($store);
}
else {
# HACK YAML::XS is horribly broken see https://rt.cpan.org/Public/Bug/Display.html?id=53278
$LEXS{$setting} = {%{LoadFile($file)}};
- store($LEXS{$setting}, $store);
+ #store($LEXS{$setting}, $store);
}
# say join ' ', sort keys %{ $LEXS{$setting} };
$LEXS{$setting};
@@ -1847,7 +1848,12 @@ my %unicode_map_cache;
BEGIN {
$unicode_map_cache{ALL} = [scalar("\377" x 128) x 1088, "ALL"] ;
OPEN_UNIPROPS: {
- my @path = split ':', ($ENV{PERL6LIB} // './lib:.');
+ my @path;
+ try {
+ @path = dist_dir('Perl6-STD');
+ } catch {
+ @path = split ':', ($ENV{PERL6LIB} // './lib:.');
+ };
for (@path) {
open MAP, "<", "$_/uniprops" and last OPEN_UNIPROPS;
}
@@ -2400,7 +2406,9 @@ sub mixin {
if (not exists &{$NEWWHAT.'::meta'}) { # never composed this one yet?
# fake up mixin with MI, being sure to put "roles" in front
my $eval = "package $NEWWHAT; use Moose ':all' => { -prefix => 'moose_' }; moose_extends('$WHAT'); moose_with(" . join(',', map {"'$_'"} @newmix) . ");our \$CATEGORY = '.';\n";
+
$self->deb($eval) if DEBUG & DEBUG::mixins;
+ local $SIG{__WARN__} = sub { die $_[0] unless $_[0] =~ /^Deep recursion/ };
eval $eval;
warn $@ if $@;
}
@@ -2893,6 +2901,7 @@ sub do_need { my $self = shift;
elsif (-f "$lib/$modfile$ext") {
# say "$std $lib/$module$ext";
local $ENV{STD5PREFIX} = $::TMP_PREFIX;
+ local $ENV{SYML_SEARCH_PATH} = join(':',@{$::SYML_SEARCH_PATH});
system($::RECURSIVE_PERL // $^X, "-MSTD", "-e", "STD->_parse_module",
"$lib/$module$ext") and die "Can't compile $lib/$module$ext";
print STDERR "Compiled $lib/$module$ext\n";
@@ -2958,6 +2967,7 @@ sub do_import { my $self = shift;
else {
return $self unless $pkg;
eval { @imports = keys %{ $pkg->{'EXPORT::'}->{'DEFAULT::'} }; };
+ #warn YAML::XS::Dump($pkg);
local $::SCOPE = 'my';
$self->do_import_aliases($pkg, @imports);
}
View
1,095 stage0/STD.pmc
665 additions, 430 deletions not shown
View
8 tryfile
@@ -8,10 +8,10 @@ my $failures = 0;
if (not @ARGV) {
@ARGV = grep { s/\.t\n/.t/} <STDIN>;
s/^\s*[AU]*\s+// for @ARGV;
- my $pkgs = $ARGV[0];
- if ($pkgs =~ s[t/spec.*][t/spec/packages]) {
- $ENV{PERL6LIB} ||= "lib:$pkgs:.";
- }
+}
+my $pkgs = $ARGV[0];
+if ($pkgs =~ s[t/spec.*][t/spec/packages]) {
+ $ENV{PERL6LIB} ||= "lib:$pkgs:.";
}
for my $file (@ARGV) {
Please sign in to comment.
Something went wrong with that request. Please try again.