extend annotation names and types to allow punctuation
[mussa.git] / alg / sequence.cpp
index 077908e1c3e2ad414f32ee24e74b566cd4774228..c99f3a68f7892f10d023360a9d94e79cdb8ea406 100644 (file)
@@ -343,7 +343,7 @@ struct push_back_annot {
   void operator()(std::string::const_iterator, 
                   std::string::const_iterator) const 
   {
-    //std::cout << "adding annot: " << begin << " " << end << " " << name << " " << type << std::endl;
+    //std::cout << "adding annot: " << begin << "|" << end << "|" << name << "|" << type << std::endl;
     annot_list.push_back(annot(begin, end, name, type));
   };
 };
@@ -402,12 +402,18 @@ Sequence::parse_annot(std::string data, int start_index, int end_index)
                         +spirit::space_p >>
                         spirit::uint_p[spirit::assign_a(end)] >> 
                         +spirit::space_p >>
-                        (*(spirit::alpha_p|spirit::digit_p))[spirit::assign_a(name)] >> 
-                          // optional type
-                          !(
-                             +spirit::space_p >>
-                             (*(spirit::alpha_p))[spirit::assign_a(type)]
-                           )
+                        ( 
+                           spirit::alpha_p >> 
+                           *spirit::graph_p
+                        )[spirit::assign_a(name)] >> 
+                        // optional type
+                        !(
+                            +spirit::space_p >>
+                            (
+                              spirit::alpha_p >>
+                              *spirit::graph_p
+                            )[spirit::assign_a(type)]
+                        )
                         // to understand how this group gets set
                         // read the comment above struct push_back_annot
                        )[push_back_annot(annots, start, end, type, name)]