Skip to content

Commit

Permalink
Eradicated pir::die, replaced by nqp::die
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 28, 2012
1 parent ba96247 commit b6b527d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions src/QAST/Compiler.nqp
Expand Up @@ -104,7 +104,7 @@ class QAST::Compiler is HLL::Compiler {
my $name := $var.name;
my $type := type_to_register_type($var.returns);
if nqp::existskey(%!lexical_types, $name) {
pir::die("Lexical '$name' already declared");
nqp::die("Lexical '$name' already declared");
}
%!lexical_types{$name} := $type;
%!lexical_regs{$name} := $reg ?? $reg !! self."fresh_lex_{nqp::lc($type)}"();
Expand All @@ -114,7 +114,7 @@ class QAST::Compiler is HLL::Compiler {
method register_local($var) {
my $name := $var.name;
if nqp::existskey(%!local_types, $name) {
pir::die("Local '$name' already declared");
nqp::die("Local '$name' already declared");
}
%!local_types{$name} := type_to_register_type($var.returns);
%!reg_types{$name} := %!local_types{$name};
Expand Down Expand Up @@ -665,7 +665,7 @@ class QAST::Compiler is HLL::Compiler {
$*BLOCK.add_param($node);
}
else {
pir::die("Parameter cannot have scope '$scope'; use 'local' or 'lexical'");
nqp::die("Parameter cannot have scope '$scope'; use 'local' or 'lexical'");
}
}
elsif $decl eq 'var' {
Expand All @@ -676,11 +676,11 @@ class QAST::Compiler is HLL::Compiler {
$*BLOCK.add_lexical($node);
}
else {
pir::die("Cannot declare variable with scope '$scope'; use 'local' or 'lexical'");
nqp::die("Cannot declare variable with scope '$scope'; use 'local' or 'lexical'");
}
}
else {
pir::die("Don't understand declaration type '$decl'");
nqp::die("Don't understand declaration type '$decl'");
}
}

Expand Down Expand Up @@ -717,7 +717,7 @@ class QAST::Compiler is HLL::Compiler {
$ops.result($name);
}
else {
pir::die("Cannot reference undeclared local '$name'");
nqp::die("Cannot reference undeclared local '$name'");
}
}
elsif $scope eq 'lexical' {
Expand Down Expand Up @@ -759,7 +759,7 @@ class QAST::Compiler is HLL::Compiler {
# Ensure we have object and class handle.
my @args := $node.list();
if +@args != 2 {
pir::die("An attribute lookup needs an object and a class handle");
nqp::die("An attribute lookup needs an object and a class handle");
}

# Compile object and handle.
Expand Down Expand Up @@ -799,7 +799,7 @@ class QAST::Compiler is HLL::Compiler {
}
}
else {
pir::die("QAST::Var with scope '$scope' NYI");
nqp::die("QAST::Var with scope '$scope' NYI");
}

$ops
Expand Down Expand Up @@ -894,7 +894,7 @@ class QAST::Compiler is HLL::Compiler {
return $ops;
}
else {
pir::die("Coercion from '$result' to '$desired' NYI");
nqp::die("Coercion from '$result' to '$desired' NYI");
}
}

Expand Down Expand Up @@ -924,7 +924,7 @@ class QAST::Compiler is HLL::Compiler {
"i"
}
else {
pir::die("Cannot infer type from '$inferee'");
nqp::die("Cannot infer type from '$inferee'");
}
}

Expand Down
18 changes: 9 additions & 9 deletions src/QAST/Operations.nqp
Expand Up @@ -32,7 +32,7 @@ class QAST::Operations {
if %core_ops{$name} -> $mapper {
return $mapper($qastcomp, $op);
}
pir::die("No registered operation handler for '$name'");
nqp::die("No registered operation handler for '$name'");
}

# Compiles a PIR operation.
Expand Down Expand Up @@ -201,7 +201,7 @@ class QAST::Operations {
# Build the arguments list.
my $num_args := +@op_args;
if +@arg_types != $num_args {
pir::die("Operation '$op_name' requires " ~
nqp::die("Operation '$op_name' requires " ~
+@arg_types ~ " operands, but got $num_args");
}
my $i := 0;
Expand Down Expand Up @@ -407,7 +407,7 @@ for <if unless> -> $op_name {
QAST::Operations.add_core_op($op_name, :inlinable(1), -> $qastcomp, $op {
# Check operand count.
my $operands := +$op.list;
pir::die("Operation '$op_name' needs either 2 or 3 operands")
nqp::die("Operation '$op_name' needs either 2 or 3 operands")
if $operands < 2 || $operands > 3;

# Create labels.
Expand Down Expand Up @@ -541,7 +541,7 @@ for ('', 'repeat_') -> $repness {

# Check operand count.
my $operands := +@comp_ops;
pir::die("Operation '$repness$op_name' needs 2 or 3 operands")
nqp::die("Operation '$repness$op_name' needs 2 or 3 operands")
if $operands != 2 && $operands != 3;

# Emit the prelude.
Expand Down Expand Up @@ -757,10 +757,10 @@ QAST::Operations.add_core_op('bind', :inlinable(1), -> $qastcomp, $op {
# Sanity checks.
my @children := $op.list;
if +@children != 2 {
pir::die("A 'bind' op must have exactly two children");
nqp::die("A 'bind' op must have exactly two children");
}
unless nqp::istype(@children[0], QAST::Var) {
pir::die("First child of a 'bind' op must be a QAST::Var");
nqp::die("First child of a 'bind' op must be a QAST::Var");
}

# Set the QAST of the think we're to bind, then delegate to
Expand Down Expand Up @@ -805,7 +805,7 @@ QAST::Operations.add_core_op('call', -> $qastcomp, $op {
$callee := $qastcomp.as_post(@args.shift());
}
else {
pir::die("No name for call and empty children list");
nqp::die("No name for call and empty children list");
}

# Process arguments.
Expand Down Expand Up @@ -833,7 +833,7 @@ QAST::Operations.add_core_op('callmethod', :inlinable(1), -> $qastcomp, $op {
# Ensure we at least have an invocant.
my @args := nqp::clone($op.list);
if +@args == 0 {
pir::die('Method call node requires at least one child');
nqp::die('Method call node requires at least one child');
}

# Where is the name coming from?
Expand All @@ -847,7 +847,7 @@ QAST::Operations.add_core_op('callmethod', :inlinable(1), -> $qastcomp, $op {
@args.unshift($invocant);
}
else {
pir::die("Method call must either supply a name or have a child node that evaluates to the name");
nqp::die("Method call must either supply a name or have a child node that evaluates to the name");
}

# Process arguments.
Expand Down

0 comments on commit b6b527d

Please sign in to comment.