Author: fperrad
Date: Fri Mar 16 00:21:49 2007
New Revision: 17516
Modified:
trunk/languages/WMLScript/build/stdlibs.pl
trunk/languages/WMLScript/build/translator.pl
trunk/languages/WMLScript/src/script.pir
trunk/languages/WMLScript/src/wmlsstdlibs.pir
Log:
[WMLScript]
- minor
Modified: trunk/languages/WMLScript/build/stdlibs.pl
==============================================================================
--- trunk/languages/WMLScript/build/stdlibs.pl (original)
+++ trunk/languages/WMLScript/build/stdlibs.pl Fri Mar 16 00:21:49 2007
@@ -81,13 +81,13 @@
.sub _init_lib
.local pmc stdlibs
.local pmc lib
- stdlibs = new .Hash
+ new stdlibs, .Hash
PIRCODE
while ( my ( $num_lib, $lib ) = each %{$cfg} ) {
my ( $name, $h_lib ) = @{$lib};
$pir .= "\n # $name\n";
- $pir .= " lib = new .Hash\n";
+ $pir .= " new lib, .Hash\n";
while ( my ( $num_func, $func ) = each %{$h_lib} ) {
my ( $name, $nb ) = @{$func};
@@ -100,14 +100,14 @@
# Emit the final PIR.
$pir .= <<'PIRCODE';
- global "stdlibs" = stdlibs
+ global 'stdlibs' = stdlibs
.end
.sub get_nb_arg_lib
.param int lib
.param int func
.local pmc stdlib
- stdlib = global "stdlibs"
+ stdlib = global 'stdlibs'
$P0 = stdlib[lib]
$I0 = $P0[func]
.return ($I0)
Modified: trunk/languages/WMLScript/build/translator.pl
==============================================================================
--- trunk/languages/WMLScript/build/translator.pl (original)
+++ trunk/languages/WMLScript/build/translator.pl Fri Mar 16 00:21:49 2007
@@ -431,12 +431,12 @@
BDISPATCH_NOT_FOUND:
.local pmc ex
.local string msg
- ex = new Exception
+ new ex, .Exception
msg = "unknown instruction (code "
$S0 = cur_ic
msg = concat $S0
msg = concat ")"
- ex["_message"] = msg
+ ex['_message'] = msg
throw ex
PIRCODE
@@ -857,7 +857,7 @@
$S0 = "\n"
L1_CST:
$S1 = shift $P0
- if_null $S1, L2_CST
+ if null $S1 goto L2_CST
$S1 = $P0[$S1]
$S0 = concat $S1
goto L1_CST
Modified: trunk/languages/WMLScript/src/script.pir
==============================================================================
--- trunk/languages/WMLScript/src/script.pir (original)
+++ trunk/languages/WMLScript/src/script.pir Fri Mar 16 00:21:49 2007
@@ -97,11 +97,9 @@
.sub '__onload' :load :anon
- push_eh _handler
$P0 = global '@stdlibs'
- goto L1
-_handler:
- load_bytecode 'languages/WMLScript/src/WMLScript.pbc'
+ unless null $P0 goto L1
+ load_bytecode 'languages/WMLScript/src/WMLScript.pbc'
L1:
PIRCODE
Modified: trunk/languages/WMLScript/src/wmlsstdlibs.pir
==============================================================================
--- trunk/languages/WMLScript/src/wmlsstdlibs.pir (original)
+++ trunk/languages/WMLScript/src/wmlsstdlibs.pir Fri Mar 16 00:21:49 2007
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, The Perl Foundation.
+# Copyright (C) 2006-2007, The Perl Foundation.
# $Id$
=head1 NAME
@@ -48,7 +48,7 @@
.sub 'not_implemented'
.local pmc ex
- ex = new .Exception
+ new ex, .Exception
ex['_message'] = "not implemented"
throw ex
.end
@@ -118,14 +118,14 @@
.get_results (e, s)
print s
print "\n"
- ex = new .Exception
+ new ex, .Exception
$S0 = "verification failed (can't translate '"
$S0 .= url
$S0 .= "')"
ex['_message'] = $S0
throw ex
_handler_2:
- ex = new .Exception
+ new ex, .Exception
$S0 = "external function '"
$S0 .= function
$S0 .= "' not found in '"
@@ -134,7 +134,7 @@
ex['_message'] = $S0
throw ex
L1:
- ex = new .Exception
+ new ex, .Exception
$S0 = "unable to load compilation unit"
ex['_message'] = $S0
throw ex