Index: /trunk/PS-IPP-Metadata-Config/Changes
===================================================================
--- /trunk/PS-IPP-Metadata-Config/Changes	(revision 10188)
+++ /trunk/PS-IPP-Metadata-Config/Changes	(revision 10189)
@@ -6,4 +6,7 @@
     - remove support for "epoch format" times
     - additional metadata structure tests
+    - merge metadata_name & metadata_end into metdata
+    - merge empty metdata case into main metadata production
+    - error check vector
 
 0.09 Thu Oct 26 16:16:28 HST 2006
Index: /trunk/PS-IPP-Metadata-Config/config_grammar.txt
===================================================================
--- /trunk/PS-IPP-Metadata-Config/config_grammar.txt	(revision 10188)
+++ /trunk/PS-IPP-Metadata-Config/config_grammar.txt	(revision 10189)
@@ -1,5 +1,5 @@
 # Copyright (c) 2005  Joshua Hoblitt
 #
-# $Id: config_grammar.txt,v 1.10 2006-11-22 23:57:10 jhoblitt Exp $
+# $Id: config_grammar.txt,v 1.11 2006-11-25 01:53:26 jhoblitt Exp $
 
 {
@@ -19,5 +19,5 @@
         {
             $thisparser->{local} = pop @scope_stack;
-            [ grep $_->{class} !~ /comment_line/, @{$item[1]} ];
+            [ grep $_->{class} !~ /comment_line/, @{$item{'statement(s)'}} ];
         }
 
@@ -57,5 +57,5 @@
 
 vector:
-     <skip:'[ \t\r]*'> vname vtype vvalue[ $item{vtype} ] comment(?) "\n"
+     <skip:'[ \t\r]*'> vname <commit> vtype vvalue[ $item{vtype} ] comment(?) "\n"
         {
             $thisparser->{local}{name}{ $item{vname} }++
@@ -73,4 +73,5 @@
                 if $item{'comment(?)'}[0];
         }
+    | <error?:redefinition of MULTI> <reject>
 
 multi_declare:
@@ -89,41 +90,33 @@
 # metadatas
 metadata:
-    metadata_name 
-    { push @scope_stack, $thisparser->{local}; $thisparser->{local} = {} }
-    grammar
-    metadata_end
-        {
-            my $text = $item[2];
-            
-            if ( defined( $text ) ) {
+    <skip:'[ \t\r]*'> name /METADATA/i comment(?) "\n"
+    <commit>
+    { push @scope_stack, $thisparser->{local}; $thisparser->{local} = {}; 1; }
+    grammar(?)
+    <skip:'[ \t\r]*'> /END/i comment(?) "\n"
+
+        {
+            if (defined(@{$item{'grammar(?)'}})) {
                 $return = {
                     class   => 'metadata',
-                    name    => $item{metadata_name},
-                    value   => $item{grammar},
+                    name    => $item{name},
+                    value   => @{$item{'grammar(?)'}},
                 };
             } else {
-                $return = undef;
-            }
-
-            if ( defined $thisparser->{local}{name}{ $item{metadata_name} } ) {
+                $return = {
+                    class   => 'metadata',
+                    name    => $item{name},
+                    value   => [],
+                };
+            }
+
+            $return->{comment} = $item[4][0]
+                if defined $item[4][0];
+
+            if ( defined $thisparser->{local}{name}{ $item{name} } ) {
                 $return->{multi}++
-                    if $thisparser->{local}{name}{ $item{metadata_name} } =~ /MULTI/;
-            } else {
-                $thisparser->{local}{name}{ $item{metadata_name} }++;
-            }
-        } 
-    | metadata_name <commit> comment_line(s?) metadata_end
-        {
-            $return = {
-                class   => 'metadata',
-                name    => $item{metadata_name},
-                value   => [],
-            };
-
-            if ( defined $thisparser->{local}{name}{ $item{metadata_name} } ) {
-                $return->{multi}++
-                    if $thisparser->{local}{name}{ $item{metadata_name} } =~ /MULTI/;
-            } else {
-                $thisparser->{local}{name}{ $item{metadata_name} }++;
+                    if $thisparser->{local}{name}{ $item{name} } =~ /MULTI/;
+            } else {
+                $thisparser->{local}{name}{ $item{name} }++;
             }
         } 
@@ -208,11 +201,4 @@
             }
         }
-
-metadata_name:
-    <skip:'[ \t\r]*'> name /METADATA/i comment(?) "\n"
-        { $item{name} } 
-    
-metadata_end:
-     <skip:'[ \t\r]*'> /END/i comment(?) "\n"
 
 comment:
