Author: bernhard
Date: Sat Oct 29 10:30:22 2005
New Revision: 9632
Added:
trunk/examples/pasm/small.xml
- copied unchanged from r9629, trunk/examples/assembly/small.xml
trunk/examples/pasm/xml_parser.pasm
- copied, changed from r9629, trunk/examples/assembly/xml_parser.pasm
Removed:
trunk/examples/assembly/small.xml
trunk/examples/assembly/xml_parser.pasm
Modified:
trunk/CREDITS
trunk/MANIFEST
trunk/t/examples/pasm.t
Log:
Move the 'xml_parser.pasm' example from 'assembly' to 'pasm'.
Modified: trunk/CREDITS
==============================================================================
--- trunk/CREDITS (original)
+++ trunk/CREDITS Sat Oct 29 10:30:22 2005
@@ -103,6 +103,8 @@ D: Fix for parrot linking issue on Solar
N: Clinton A. Pierce
D: Many PIR tests and fixes
+D: A small XML parser in PASM
+D: Interpreter and compiler for BASIC
N: Cory Spencer
D: Peek opcode and PIO implementation
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Sat Oct 29 10:30:22 2005
@@ -465,13 +465,11 @@ examples/assembly/ncurses_life.imc
examples/assembly/pmcmops.pasm [main]doc
examples/assembly/queens.pasm [main]doc
examples/assembly/queens_r.imc [main]doc
-examples/assembly/small.xml [main]doc
examples/assembly/stack.pasm [main]doc
examples/assembly/substr.pasm [main]doc
examples/assembly/thr-primes.imc [main]doc
examples/assembly/trace.pasm [main]doc
examples/assembly/uniq.pasm [main]doc
-examples/assembly/xml_parser.pasm [main]doc
examples/benchmarks/addit.imc [main]doc
examples/benchmarks/addit.pasm [main]doc
examples/benchmarks/addit.pl [main]doc
@@ -601,6 +599,8 @@ examples/pasm/cat.pasm
examples/pasm/fact.pasm [main]doc
examples/pasm/hello.pasm [main]doc
examples/pasm/lexical.pasm [main]doc
+examples/pasm/small.xml [main]doc
+examples/pasm/xml_parser.pasm [main]doc
examples/pge/README [main]doc
examples/pge/all.pir [main]doc
examples/pge/p6parse.pir [main]doc
Copied: trunk/examples/pasm/xml_parser.pasm (from r9629,
trunk/examples/assembly/xml_parser.pasm)
==============================================================================
--- trunk/examples/assembly/xml_parser.pasm (original)
+++ trunk/examples/pasm/xml_parser.pasm Sat Oct 29 10:30:22 2005
@@ -1,17 +1,13 @@
-# Copyright (C) 2001-2003 The Perl Foundation. All rights reserved.
+# Copyright (C) 2001-2005 The Perl Foundation. All rights reserved.
# $Id$
=head1 NAME
-examples/assembly/xml_parser.pasm - Simple XML Parser
+examples/pasm/xml_parser.pasm - Simple XML Parser
=head1 SYNOPSIS
- % ./parrot examples/assembly/xml_parser.pasm examples/assembly/small.xml
-
-Note that this example currently seems to be broken:
-
- Couldn't open small.xml
+ % ./parrot examples/pasm/xml_parser.pasm examples/pasm/small.xml
=head1 DESCRIPTION
@@ -373,7 +369,7 @@ MAIN:
# SMALL FILES ONLY. SMALL. SMALL. SMALL. Parrots I/O
# GC does not play nice with read().
set S10, ""
- open P0, "small.xml", "<"
+ open P0, "examples/pasm/small.xml", "<"
if P0, READ
print "Couldn't open small.xml\n"
exit 1
@@ -460,7 +456,7 @@ BAIL:
=head1 SEE ALSO
-F<examples/assembly/small.xml>.
+F<examples/pasm/small.xml>.
=head1 HISTORY
Modified: trunk/t/examples/pasm.t
==============================================================================
--- trunk/t/examples/pasm.t (original)
+++ trunk/t/examples/pasm.t Sat Oct 29 10:30:22 2005
@@ -14,12 +14,11 @@ t/examples/pasm.t - Test examples in F<e
=head1 DESCRIPTION
-Test the examples in F<examples/assambly>.
-For now only a fex examples are included here.
+Test the examples in F<examples/pasm>.
=head1 TODO
-Check on remaining examples.
+Check on remaining examples in 'examples/assembly'.
=head1 SEE ALSO
@@ -28,7 +27,7 @@ F<t/examples/japh.t>
=cut
use strict;
-use Parrot::Test tests => 3;
+use Parrot::Test tests => 4;
use Test::More;
# Set up expected output for examples
@@ -76,6 +75,20 @@ Getting rid of bottom stack
The lexical 'a' has in the current scope the value 2.
The lexical 'b' has in the current scope the value 3.
END_EXPECTED
+
+ 'xml_parser.pasm' => << 'END_EXPECTED',
+Start xml version=1.0
+Start top
+Start inner foo=bar narf=poit
+Start junk
+Data Hello
+Close junk
+Start empty
+Close empty
+Close inner
+Close top
+END_EXPECTED
+
);
# Do the testing