Allow the @id syntax in XPath expressions.
[tatoo.git] / src / xpath / xpath_internal_parser.mly
index fe38f67..3651d2c 100644 (file)
@@ -15,7 +15,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-09 19:24:28 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-10 14:31:48 CET by Kim Nguyen>
 *)
 
   open Ast
@@ -23,6 +23,7 @@
 %}
 
 %token <string> TAG
+%token <string> ATTNAME
 %token <string> STRING
 %token <int>  INT
 %token <float> FLOAT
@@ -85,7 +86,7 @@ step:
 
 axis_test:
   AXIS COLONCOLON test  { let a, t = $1, $3 in
-                          if a == Attribute && Utils.QNameSet.is_finite t then 
+                          if a == Attribute && Utils.QNameSet.is_finite t then
                             (a, Utils.QNameSet.fold
                               (fun t a ->
                                 Utils.QNameSet.add
@@ -101,6 +102,8 @@ axis_test:
   let a = Format.flush_str_formatter () in
   Child, Utils.QNameSet.singleton (Utils.QName.of_string a)
 }
+| ATTNAME             {  (Attribute,
+                          Utils.QNameSet.singleton (Utils.QName.of_string $1)) }
 ;
 
 test:
@@ -151,4 +154,3 @@ arg_list1:
   expr                     { [ $1 ] }
 | arg_list1 COMMA expr     { $3 :: $1 }
 ;
-