Index: trunk/lib/Text/FormBuilder.pm
===================================================================
--- trunk/lib/Text/FormBuilder.pm	(revision 87)
+++ trunk/lib/Text/FormBuilder.pm	(revision 88)
@@ -198,4 +198,5 @@
                 push @{ $self->{form_spec}{fields} }, { %{$_} } foreach @{ $$line[1]{group} };
             } elsif ($$line[0] eq 'field') {
+                #die $$line[1] unless ref $$line[1];
                 push @{ $self->{form_spec}{fields} }, { %{$$line[1]} };
             }
@@ -1349,6 +1350,4 @@
 =head2 Language/Parser
 
-Make sure that multiple runs of the parser don't share data.
-
 Pieces that wouldn't make sense in a group field: size, row/col, options,
 validate. These should cause C<build> to emit a warning before ignoring them.
@@ -1370,7 +1369,4 @@
 
 =head1 BUGS
-
-Creating two $parsers in the same script causes the second one to get the data
-from the first one.
 
 Placing C<fields> in a C<!fb> directive does not behave as expected (i.e. they
Index: trunk/lib/Text/FormBuilder/grammar
===================================================================
--- trunk/lib/Text/FormBuilder/grammar	(revision 87)
+++ trunk/lib/Text/FormBuilder/grammar	(revision 88)
@@ -37,6 +37,9 @@
 
 form_spec:
-    { 
-	%formspec = ();  # clear the old formspec data
+    {
+	# clear out old data, so we don't end up with old data in new objects
+	@lines    = ();
+	@sections = ();
+	%formspec = ();
     }
     (list_def | description_def | group_def | note | fb_params | unknown_block_directive | line)(s)
@@ -52,4 +55,6 @@
 	}
 	
+	# make copies instead of taking references, again so we
+	# don't end up with connections between objects
 	$return = {
 	    fb_params   => $formspec{fb_params},
@@ -57,13 +62,10 @@
 	    author      => $formspec{author},
 	    description => $formspec{description},
-	    lists       => \%lists,
-	    patterns    => \%patterns,
-	    subs        => \%subs,
-	    groups      => \%groups,
-	    sections    => \@sections,
-	    ( @submit ? 
-		(submit => @submit == 1 ? $submit[0] : \@submit) :
-		()
-	    ),
+	    lists       => { %lists },
+	    patterns    => { %patterns },
+	    subs        => { %subs },
+	    groups      => { %groups },
+	    sections    => [ @sections ],
+	    ( @submit ? (submit => @submit == 1 ? $submit[0] : [ @submit ]) : () ),
 	    reset       => $formspec{reset},
 	}
@@ -233,4 +235,6 @@
 	@options = ();
 	
+	#warn "$$field{name}: $field";
+	
 	$field;
     }
