From b6b527d1676a2dee85495b1ec935e89b82cfa9d4 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 28 Aug 2012 15:22:19 +0200 Subject: [PATCH] Eradicated pir::die, replaced by nqp::die --- src/QAST/Compiler.nqp | 20 ++++++++++---------- src/QAST/Operations.nqp | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/QAST/Compiler.nqp b/src/QAST/Compiler.nqp index 9ca42820f5..780d97ab59 100755 --- a/src/QAST/Compiler.nqp +++ b/src/QAST/Compiler.nqp @@ -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)}"(); @@ -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}; @@ -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' { @@ -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'"); } } @@ -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' { @@ -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. @@ -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 @@ -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"); } } @@ -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'"); } } diff --git a/src/QAST/Operations.nqp b/src/QAST/Operations.nqp index af9328de2f..2e244f8bb9 100644 --- a/src/QAST/Operations.nqp +++ b/src/QAST/Operations.nqp @@ -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. @@ -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; @@ -407,7 +407,7 @@ for -> $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. @@ -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. @@ -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 @@ -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. @@ -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? @@ -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.