[svn:parrot] r40235 - in trunk: compilers/ncigen compilers/ncigen/src/parser ext/SQLite3
tewk at svn.parrot.org
tewk at svn.parrot.org
Thu Jul 23 22:44:13 UTC 2009
Author: tewk
Date: Thu Jul 23 22:44:12 2009
New Revision: 40235
URL: https://trac.parrot.org/parrot/changeset/40235
Log:
[ncigen] deprecation fixes
Modified:
trunk/compilers/ncigen/NCIGENP6.pm
trunk/compilers/ncigen/src/parser/actions.pm
trunk/ext/SQLite3/gen_sqlite3.pl
Modified: trunk/compilers/ncigen/NCIGENP6.pm
==============================================================================
--- trunk/compilers/ncigen/NCIGENP6.pm Thu Jul 23 22:22:03 2009 (r40234)
+++ trunk/compilers/ncigen/NCIGENP6.pm Thu Jul 23 22:44:12 2009 (r40235)
@@ -4,6 +4,8 @@
# Copyright (C) 2008, Parrot Foundation.
use v6;
+class NCIGENAST::FuncDecl {
+}
evalfile('./ncigen.pbc', lang => 'Parrot');
@@ -12,9 +14,9 @@
run("gcc -x c -E $fn > $pp_fn");
my $compiler = compreg('NCIGEN');
- my $ast = $compiler.parse(slurp($pp_fn));
+ my $match = $compiler.parse(slurp($pp_fn));
unlink $pp_fn;
- $ast.item();
+ $match.ast;
}
sub compreg {
@@ -24,7 +26,7 @@
sub mktempfile($prefix) {
sub nonce() { ".{$*PID}." ~ int 1000.rand }
- $prefix ~ nonce;
+ $prefix ~ nonce;
}
sub gen_preamble($nsname, $libname) {
Modified: trunk/compilers/ncigen/src/parser/actions.pm
==============================================================================
--- trunk/compilers/ncigen/src/parser/actions.pm Thu Jul 23 22:22:03 2009 (r40234)
+++ trunk/compilers/ncigen/src/parser/actions.pm Thu Jul 23 22:44:12 2009 (r40235)
@@ -183,12 +183,12 @@
if $struct_or_union {
my $ident := $<struct_or_union_specifier><identifier><identifier>;
if $ident {
- $ident := strip_spaces($ident.text());
+ $ident := strip_spaces(~$ident);
}
else {
$ident := $<struct_or_union_specifier><identifier>;
if $ident {
- $ident := strip_spaces($ident.text());
+ $ident := strip_spaces(~$ident);
}
else {
$ident := "anonymous_" ~~ $struct_or_union~~ "1";
@@ -232,7 +232,7 @@
for $_<struct_declarator_list> {
my $sm := $smt.clone();
my $declarator := $_<struct_declarator><declarator>;
- $sm.name(strip_spaces($declarator.text()));
+ $sm.name(strip_spaces(~$declarator));
ispointer($declarator, $sm);
$ast.push($sm);
}
Modified: trunk/ext/SQLite3/gen_sqlite3.pl
==============================================================================
--- trunk/ext/SQLite3/gen_sqlite3.pl Thu Jul 23 22:22:03 2009 (r40234)
+++ trunk/ext/SQLite3/gen_sqlite3.pl Thu Jul 23 22:44:12 2009 (r40235)
@@ -17,17 +17,17 @@
for (parse_ast($fn).hash().kv) -> $k,$v {
#dump_node($v);
- if ($v.WHAT eq "FuncDecl") {
+ if ($v.WHAT eq "NCIGENAST::FuncDecl()") {
my @result = pir($v);
my $cname = @result[0];
my $signature = @result[1];
my $source = @result[2];
my $suffix_name = @result[0];
- my $suffix_name .= subst( /sqlite3_/, '' );
+ $suffix_name .= subst( /sqlite3_/, '' );
my $pirname = %rename_table{$suffix_name} || $suffix_name;
- say " '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature') #$source";
+ say " '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature')";
}
}
print postamble();
More information about the parrot-commits
mailing list