Skip to content

Commit

Permalink
Merge branch 'master' of github.com:parrot/parrot
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Nov 9, 2011
2 parents 1ee1c09 + 4268b4c commit de1cf6d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions compilers/opsc/src/Ops/Compiler/Grammar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ rule pointer { <star> 'const'? }
token star { '*' }

rule pointerless_type {
'struct'? 'const'? <identifier>
'struct'? 'const'? 'unsigned'? <identifier>
}

rule type_declarator {
'struct'? 'const'? <identifier> <pointer>*
'struct'? 'const'? 'unsigned'? <identifier> <pointer>*
}

token eat_terminator {
Expand Down
2 changes: 1 addition & 1 deletion src/call/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ assign_default_param_value(PARROT_INTERP, INTVAL param_index, INTVAL param_flags
*accessor->numval(interp, arg_info, param_index) = 0.0;
break;
case PARROT_ARG_STRING:
*accessor->string(interp, arg_info, param_index) = NULL;
*accessor->string(interp, arg_info, param_index) = STRINGNULL;
break;
case PARROT_ARG_PMC:
*accessor->pmc(interp, arg_info, param_index) = PMCNULL;
Expand Down
8 changes: 4 additions & 4 deletions src/pmc/callcontext.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ autobox_string(PARROT_INTERP, ARGIN(const Pcc_cell *cell))
}

/* exception */
return NULL;
return STRINGNULL;
}

/*
Expand Down Expand Up @@ -1173,7 +1173,7 @@ return current Namespace

GET_ATTR_num_positionals(INTERP, SELF, num_pos);
if (key >= num_pos || key < 0)
return NULL;
return STRINGNULL;

GET_ATTR_positionals(INTERP, SELF, cells);
return autobox_string(INTERP, &cells[key]);
Expand Down Expand Up @@ -1397,7 +1397,7 @@ return current Namespace
return autobox_string(INTERP, cell);
}

return NULL;
return STRINGNULL;
}

VTABLE PMC * get_pmc_keyed_str(STRING *key) {
Expand Down Expand Up @@ -1464,7 +1464,7 @@ return current Namespace
return autobox_string(INTERP, cell);
}

return NULL;
return STRINGNULL;
}

VTABLE PMC * get_pmc_keyed(PMC *key) {
Expand Down
26 changes: 24 additions & 2 deletions t/op/calling.t
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!perl
# Copyright (C) 2001-2009, Parrot Foundation.
# Copyright (C) 2001-2011, Parrot Foundation.

use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );

use Test::More;
use Parrot::Test tests => 103;
use Parrot::Test tests => 104;

=head1 NAME
Expand Down Expand Up @@ -257,6 +257,28 @@ ok 3
back
OUTPUT

pir_error_output_like( <<'CODE', qr/Invalid operation on null string/, "return :flat" );
.sub main :main
.local string s, r
.local pmc arr
say "get"
s = s_get()
r = substr s, 0, 1
print "'"
print r
print "'"
say " done"
.end
.sub s_get
.local pmc arr
arr = new ["ResizableStringArray"]
# push arr, "xy"
.return(arr :flat )
.end
CODE

pir_output_is( <<'CODE', <<'OUTPUT', "use it in PIR" );
.sub main :main
$P0 = new 'String'
Expand Down

0 comments on commit de1cf6d

Please sign in to comment.