# New Ticket Created by  [EMAIL PROTECTED] 
# Please include the string:  [perl #24355]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24355 >


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

before we release Parrot to the wild public here is some stuff I want to have 
in my URM compiler. Mostly doc fixes, a change to the testing script that 
warns if parrot died (I had some problems with non clean builds) and some 
code beautification. Stuff is tested and I had it some time around, so it's 
just for beeing "release ready" :-)
Have fun,
        Marcus


- -- 
- ---------------------------------------------------------
|Marcus Thiesen                           ICQ# 108989768|
- ---------------------------------------------------------
|                   www.thiesenweb.de                   |
- ---------------------------------------------------------
  28A7 37CC AE2C BB6C D56D  8A3D E614 E56B 7546 75F2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/n9O85hTla3VGdfIRAtKRAJ9re6jAlu88i8x0/DI+LWoo17o/hgCgmW54
CdUQFLXakwGaUc5eKe2vSXQ=
=eS6i
-----END PGP SIGNATURE-----


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/66703/49835/f381b6/urm.patch

Index: INSTALL
===================================================================
RCS file: /cvs/public/parrot/languages/urm/INSTALL,v
retrieving revision 1.1
diff -u -r1.1 INSTALL
--- INSTALL	29 Sep 2003 12:12:16 -0000	1.1
+++ INSTALL	29 Oct 2003 14:46:24 -0000
@@ -2,6 +2,10 @@
 Try 
 	make test
 to see if your perl is capable of running urmc
-Then go into the examples directory and try
-	make
-You'll end up with a bunch of pasm files.
+Then try to build the examples:
+	make examples
+You'll end up with a bunch of pasm files in the 
+examples dir.
+
+Have fun,
+	Marcus ([EMAIL PROTECTED])
Index: README
===================================================================
RCS file: /cvs/public/parrot/languages/urm/README,v
retrieving revision 1.1
diff -u -r1.1 README
--- README	29 Sep 2003 12:12:16 -0000	1.1
+++ README	29 Oct 2003 14:46:25 -0000
@@ -17,7 +17,7 @@
 You might know that it is quite boring to program with pen and paper,
 at least if you're not debugging some screwed up C code but just some
 examples for your upcoming exam. So, I didn't want to learn and I
-wrote a compiler - in Perl. It wasn't really a compile, just some
+wrote a compiler - in Perl. It wasn't really a compiler, just some
 regexes and eval commands. It had one problem - it was slow.
 
 So I dropped it and didn't think about it for a year now. Enter
@@ -28,8 +28,8 @@
 Usage
 =====
 
-The urm compiler (urmc) has two operation modes. One is to simply call
-it with 
+The urm compiler (urmc) has some command line arguments and operation modes.
+One is to simply call it with 
 	./urmc somefile.urm
 and it will compile it to a temporary pasm (Parrot Assembly) file and
 try to execute this file with your Parrot installation.
@@ -38,6 +38,13 @@
 	./urmc -c somefile.urm
 it will create a pasm file called somefile.pasm which you can execute
 by hand with your parrot installation.
+The URM standard is rather strict (see Syntax) and therefore does not
+allow some operation which are easy to implement (e.g. writing r1 <-
+r2 + 1). I allowed these options but throw a warning every time you
+violate the standard. If you don't like these warnings you can say
+	./urmc -s somefile.urm 
+which will not give any warnings.
+
 
 Overall Syntax
 ==============
@@ -52,7 +59,8 @@
 but only one output register.
 
 Code lines are always preceded by their logical line number (not the
-actual line number in the file) which are addressed in goto statements.
+actual line number in the file) which are addressed in the goto
+control flow statements.
 
 Register Naming
 ===============
@@ -120,7 +128,7 @@
 Prerequisites
 =============
 Getopt::Long is needed for urmc
-Parrot to actually execute the code (best in your path)
+Parrot to actually execute the code.
 
 License
 =======
Index: urmc
===================================================================
RCS file: /cvs/public/parrot/languages/urm/urmc,v
retrieving revision 1.1
diff -u -r1.1 urmc
--- urmc	29 Sep 2003 12:12:16 -0000	1.1
+++ urmc	29 Oct 2003 14:46:25 -0000
@@ -10,14 +10,13 @@
 use strict;
 
 use Getopt::Long;
-use lib '../../lib';
+use FindBin;
+use lib "$FindBin::RealBin/../../lib";
 use Parrot::Config;
 use Time::HiRes qw(time);
-use FindBin;
 
 use vars qw($filename
 	    $compile
-	    $output
 	    $opti
 	    $silent);
 
@@ -33,7 +32,6 @@
 }
 
 GetOptions("compile"    => \$compile,
-	   "output=s"   => \$output,
 	   "silent"     => \$silent,
 	   "<>"         => \&filename
 	   );
Index: t/t.pl
===================================================================
RCS file: /cvs/public/parrot/languages/urm/t/t.pl,v
retrieving revision 1.1
diff -u -r1.1 t.pl
--- t/t.pl	29 Sep 2003 12:12:19 -0000	1.1
+++ t/t.pl	29 Oct 2003 14:46:25 -0000
@@ -14,14 +14,24 @@
     my $file = shift;
 
     my $ret = system ("$urmc $compile $FindBin::RealBin$PConfig{slash}$file");
-    die "TEST FAILED: $file ($ret)\n" if $ret;
+    if ($ret) {
+	print STDERR "TEST FAILED: $file ($ret)\n";
+	return;
+	}
     print "OK: $file\n";
 }
 
 sub run_test {
     my ($file, $expect) = @_;
     my $ret = `$urmc $run $FindBin::RealBin$PConfig{slash}$file`;
-    die "TEST FAILED: $file (got $ret expected $expect)\n" if ($ret != $expect);
+    if (!$ret) {
+	print STDERR "TEST FAILED: $file didn't return a value, Parrot crashed?\n";
+	return;
+    }
+    if ($ret != $expect) {
+	print STDERR "TEST FAILED: $file (got $ret expected $expect)\n";
+	return;
+    }
     print "OK: $file\n";
 }
 

Reply via email to