Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rakudo/rakudo
...
head fork: rakudo/rakudo
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 18, 2012
@moritz moritz fix types in error messages
Patch courtesy of Nick Glencross
cb28ebf
@moritz moritz first step towards "no strict;"
No way to test it yet, because $*STRICT is never set to a false valu
bfcce00
Commits on Jun 19, 2012
@moritz moritz parse "no strict" a9401fb
@moritz moritz remove arglist parsing for now; it does not work 27b55b5
View
11 src/Perl6/Actions.pm
@@ -1209,7 +1209,16 @@ class Perl6::Actions is HLL::Actions {
# inside double quotes fixes the most common case, but fails to
# catch undeclared variables in double-quoted strings.
if $sigil ne '&' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
- $*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
+ if $*STRICT {
+ $*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
+ }
+ else {
+ $*UNIT_OUTER[0].push(PAST::Var.new(
+ :name($past.name), :scope('lexical'), :isdecl(1),
+ :viviself($*W.symbol_lookup([$past.name], $/, :package_only(1), :lvalue(1)))));
+ $*UNIT_OUTER.symbol($past.name, :scope('lexical'));
+
+ }
}
elsif $sigil eq '&' {
$past.viviself(PAST::Var.new(:name('Nil'), :scope('lexical_6model')));
View
17 src/Perl6/Grammar.pm
@@ -426,6 +426,7 @@ grammar Perl6::Grammar is HLL::Grammar {
:my $*ALLOW_CODE := 0; # pod stuff
:my $*POD_IN_FORMATTINGCODE := 0; # pod stuff
:my $*IN_REGEX_ASSERTION := 0;
+ :my $*STRICT := 1;
# Various interesting scopes we'd like to keep to hand.
:my $*GLOBALish;
@@ -792,6 +793,22 @@ grammar Perl6::Grammar is HLL::Grammar {
]
<.ws>
}
+
+ token statement_control:sym<no> {
+ <sym> <.ws>
+ <module_name>
+ {
+ if ~$/<module_name> eq 'strict' {
+ # TODO: do something that respects lexical scoping
+ $*STRICT := 0;
+ }
+ else {
+ $/.CURSOR.panic('"no" is not yet implemented, with the exception of "no strict";')
+ }
+ }
+ <.ws>
+ }
+
sub do_import($module, $package_source_name, $arglist?) {
if nqp::existskey($module, 'EXPORT') {
View
10 src/core/Exception.pm
@@ -57,7 +57,7 @@ my class X::Method::InvalidQualifier is Exception {
has $.qualifier-type;
method message() {
"Cannot dispatch to method $.method on {$.qualifier-type.^name} "
- ~ "because it is no inhertied or done by {$.invocant.^name}";
+ ~ "because it is not inherited or done by {$.invocant.^name}";
}
}
@@ -645,7 +645,7 @@ my class X::Anon::Augment does X::Comp {
my class X::Augment::NoSuchType does X::Comp {
has $.package-type;
has $.package;
- method message() { "You tried to agument $.package-type $.package, but it does not exist" }
+ method message() { "You tried to augment $.package-type $.package, but it does not exist" }
}
my class X::Routine::Unwrap is Exception {
@@ -662,7 +662,7 @@ my class X::Hash::Store::OddNumber is Exception {
my class X::Package::Stubbed does X::Comp {
has @.packages;
- # TODO: supress display of line number
+ # TODO: suppress display of line number
method message() {
"The following packages were stubbed but not defined:\n "
~ @.packages.join("\n ");
@@ -716,7 +716,7 @@ my class X::Str::Trans::IllegalKey is Exception {
my class X::Str::Trans::InvalidArg is Exception {
has $.got;
method message() {
- "Only Pair objects are allowed as arguemnts to Str.trans, got {$.got.^name}";
+ "Only Pair objects are allowed as arguments to Str.trans, got {$.got.^name}";
}
}
@@ -846,7 +846,7 @@ my class X::Temporal::InvalidFormat is X::Temporal {
has $.target = 'Date';
has $.format;
method message() {
- "Ivalid $.target string '$.invalid-str'; use $.format instead";
+ "Invalid $.target string '$.invalid-str'; use $.format instead";
}
}
my class X::Temporal::Truncation is X::Temporal {

No commit comments for this range

Something went wrong with that request. Please try again.