[svn:parrot] r39301 - in trunk: runtime/parrot/library t/library
barney at svn.parrot.org
barney at svn.parrot.org
Mon Jun 1 13:07:06 UTC 2009
Author: barney
Date: Mon Jun 1 13:07:05 2009
New Revision: 39301
URL: https://trac.parrot.org/parrot/changeset/39301
Log:
Some tidbits in PCRE library.
Modified:
trunk/runtime/parrot/library/libpcre.pir
trunk/runtime/parrot/library/pcre.pir
trunk/t/library/pcre.t
Modified: trunk/runtime/parrot/library/libpcre.pir
==============================================================================
--- trunk/runtime/parrot/library/libpcre.pir Sun May 31 23:32:10 2009 (r39300)
+++ trunk/runtime/parrot/library/libpcre.pir Mon Jun 1 13:07:05 2009 (r39301)
@@ -35,11 +35,11 @@
## allocate space in string for error message
repeat error, " ", error_size
- PCRE_NCI_compile= get_hll_global ['PCRE::NCI'], 'PCRE_compile'
+ PCRE_NCI_compile = get_hll_global ['PCRE::NCI'], 'PCRE_compile'
.local pmc code
- code= PCRE_NCI_compile( pat, options, error, errptr, NULL )
+ code = PCRE_NCI_compile( pat, options, error, errptr, NULL )
.local int is_code_defined
is_code_defined = defined code
@@ -66,18 +66,18 @@
## osize -- 1/(2/3) * 4 * 2
.local int osize
- osize= 12
+ osize = 12
## number of result pairs
.local int num_result_pairs
- num_result_pairs= 10
+ num_result_pairs = 10
.local int ovector_length
- ovector_length= osize * num_result_pairs
+ ovector_length = osize * num_result_pairs
.local pmc ovector
- ovector= new 'ManagedStruct'
- ovector= ovector_length
+ ovector = new 'ManagedStruct'
+ ovector = ovector_length
## on 32 bit systems
.local pmc PCRE_NCI_exec
@@ -85,7 +85,7 @@
.local int ok
- ok= PCRE_NCI_exec( regex, NULL, s, len, start, options, ovector, 10 )
+ ok = PCRE_NCI_exec( regex, NULL, s, len, start, options, ovector, 10 )
.return( ok, ovector )
.end
Modified: trunk/runtime/parrot/library/pcre.pir
==============================================================================
--- trunk/runtime/parrot/library/pcre.pir Sun May 31 23:32:10 2009 (r39300)
+++ trunk/runtime/parrot/library/pcre.pir Mon Jun 1 13:07:05 2009 (r39301)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2008, Parrot Foundation.
+# Copyright (C) 2004-2009, Parrot Foundation.
# $Id$
=head1 TITLE
@@ -194,7 +194,7 @@
.sub version
.local pmc pcre_function
- pcre_function= get_hll_global ['PCRE::NCI'], 'PCRE_version'
+ pcre_function = get_hll_global ['PCRE::NCI'], 'PCRE_version'
.local string ver
Modified: trunk/t/library/pcre.t
==============================================================================
--- trunk/t/library/pcre.t Sun May 31 23:32:10 2009 (r39300)
+++ trunk/t/library/pcre.t Mon Jun 1 13:07:05 2009 (r39301)
@@ -1,10 +1,11 @@
#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
use strict;
use warnings;
use lib qw( t . lib ../lib ../../lib );
+
use Test::More;
use Parrot::Test tests => 1;
@@ -26,22 +27,22 @@
# if we keep pcre, we need a config test
my $cmd = ( $^O =~ /MSWin32/ ) ? "pcregrep --version" : "pcre-config --version";
my $has_pcre = !Parrot::Test::run_command( $cmd, STDERR => File::Spec->devnull, );
-my $pcre_libpath = "";
+my $pcre_libpath = '';
# It's possible that libpcre is installed in some non-standard path...
if ($has_pcre && ($^O !~ /MSWin32/)) {
# Extract the library path for non-windows platforms (in case it isn't in
# the normal lookup locations)
- my $outfile = "pcre-config.out";
- Parrot::Test::run_command("pcre-config --prefix", STDOUT => $outfile);
+ my $outfile = 'pcre-config.out';
+ Parrot::Test::run_command('pcre-config --prefix', STDOUT => $outfile);
my $out = Parrot::Test::slurp_file($outfile);
unlink $outfile;
chomp $out;
- $pcre_libpath="$out/lib";
+ $pcre_libpath = "$out/lib";
}
SKIP: {
- skip( "no pcre-config", Test::Builder->new()->expected_tests() )
+ skip( 'no pcre-config', Test::Builder->new()->expected_tests() )
unless $has_pcre;
## 1
@@ -65,22 +66,21 @@
.local pmc func
.local pmc lib
-
get_global func, ['PCRE'], 'init'
if_null func, NOK1
branch OK1
NOK1:
print 'not '
OK1:
- say "ok 1"
+ say 'ok 1'
- lib= func()
+ lib = func()
if_null lib, NOK2
branch OK2
NOK2:
print 'not '
OK2:
- say "ok 2"
+ say 'ok 2'
.local string s
@@ -101,7 +101,7 @@
if is_code_defined goto OK3
print 'not '
OK3:
- say "ok 3"
+ say 'ok 3'
.local int ok
.local pmc result
@@ -112,18 +112,18 @@
unless ok < 0 goto OK4
print 'not '
OK4:
- say "ok 4"
+ say 'ok 4'
.local int i
- i= 0
+ i = 0
.local string match
- func= get_global ['PCRE'], 'dollar'
- match= func( s, ok, result, i )
+ func = get_global ['PCRE'], 'dollar'
+ match = func( s, ok, result, i )
if 'a' == match goto OK5
print 'not '
OK5:
- say "ok 5"
+ say 'ok 5'
.end
CODE
More information about the parrot-commits
mailing list