Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote branch 'origin/nom' into constant-folding
  • Loading branch information
moritz committed Feb 1, 2013
2 parents cd64560 + 9ec0a59 commit 03cce4d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
9 changes: 9 additions & 0 deletions docs/ChangeLog
@@ -1,3 +1,12 @@
New in 2013.02
+ "Did you mean ..." suggestions for symbol-not-found errors
+ Compile-time optimization of some cases of junctions in boolean context
+ Date and DateTime now support a .delta method
+ IO::Socket.get now works again with non-Unicode characters
+ $() now takes $/.ast into account
+ proper return value for smartmatching against a substitution
+ better error reporting when a parent class does not exist

New in 2013.01
+ sink context; for-loops are now lazy by default
+ first mentioning a variable from outer scope and then redeclaring it
Expand Down
28 changes: 18 additions & 10 deletions src/Perl6/Compiler.nqp
Expand Up @@ -18,7 +18,6 @@ class Perl6::Compiler is HLL::Compiler {
$super(self, |@args, |%options);
}

# XXX Disable optimizer for now while doing QAST transition.
method optimize($past, *%adverbs) {
%adverbs<optimize> eq 'off' ??
$past !!
Expand All @@ -32,16 +31,25 @@ class Perl6::Compiler is HLL::Compiler {
}
$past;
}

method autoprint($value) {
unless pir::getinterp__P().stdout_handle().tell() > $*AUTOPRINTPOS {
CATCH { nqp::say($_) }
if nqp::can($value, 'gist') {
nqp::say(nqp::unbox_s($value.gist));
} else {
nqp::say(~$value);
}

method interactive_result($value) {
CATCH { nqp::say($_) }
if nqp::can($value, 'gist') {
nqp::say(nqp::unbox_s($value.gist));
} else {
nqp::say(~$value);
}
}

method interactive_exception($ex) {
my $payload := nqp::getpayload($ex);
if nqp::can($payload, 'gist') {
nqp::say(nqp::unbox_s($payload.gist));
}
else {
nqp::say(~$ex)
}
CATCH { nqp::say(~$ex) }
}

method usage($name?) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/terms.pm
Expand Up @@ -73,9 +73,9 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
%CUSTOM_LIB<perl> = $prefix;
%CUSTOM_LIB<vendor> = $prefix ~ '/vendor';
%CUSTOM_LIB<site> = $prefix ~ '/site';
@INC.push(%CUSTOM_LIB<perl> ~ '/lib');
@INC.push(%CUSTOM_LIB<vendor> ~ '/lib');
@INC.push(%CUSTOM_LIB<site> ~ '/lib');
@INC.push(%CUSTOM_LIB<vendor> ~ '/lib');
@INC.push(%CUSTOM_LIB<perl> ~ '/lib');
try {
my $home := %ENV<HOME> // %ENV<HOMEDRIVE> ~ %ENV<HOMEPATH>;
my $ver := nqp::p6box_s(nqp::atkey($compiler, 'version'));
Expand Down
18 changes: 18 additions & 0 deletions src/pmc/perl6lexpad.pmc
Expand Up @@ -473,6 +473,24 @@ Return the LexInfo PMC, if any or a Null PMC.
GET_ATTR_lexinfo(INTERP, SELF, lexinfo);
RETURN(PMC *lexinfo);
}

METHOD get_lex_type(STRING *name) {
Hash *hash;
HashBucket *b;
INTVAL spec;
GET_ATTR_lexinfo_hash(INTERP, SELF, hash);
b = Parrot_hash_get_bucket(interp, hash, name);
if (!b)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LEX_NOT_FOUND,
"Lexical '%Ss' not found", name);
switch ((INTVAL)b->value & 3) {
case REGNO_INT: spec = STORAGE_SPEC_BP_INT; break;
case REGNO_NUM: spec = STORAGE_SPEC_BP_NUM; break;
case REGNO_STR: spec = STORAGE_SPEC_BP_STR; break;
default: spec = STORAGE_SPEC_BP_NONE; break;
}
RETURN(INTVAL spec);
}

/*

Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2013.01-23-gb8a381e
2013.01-35-g63d9ae4

0 comments on commit 03cce4d

Please sign in to comment.