X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fxpath%2Fxpath_internal_parser.mly;h=3651d2cd9e547a0e2ff239bdcbe61c40f64da233;hp=de63cdf94c54d9400683e208e1a4201133cd458c;hb=238dc42c2cb6324b103585556c3f5f9150ee221e;hpb=7eb78333c3dcc85a1723bc0fe2c2e2703d27e418 diff --git a/src/xpath/xpath_internal_parser.mly b/src/xpath/xpath_internal_parser.mly index de63cdf..3651d2c 100644 --- a/src/xpath/xpath_internal_parser.mly +++ b/src/xpath/xpath_internal_parser.mly @@ -15,7 +15,7 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) open Ast @@ -23,6 +23,7 @@ %} %token TAG +%token ATTNAME %token STRING %token INT %token FLOAT @@ -84,7 +85,16 @@ step: ; axis_test: - AXIS COLONCOLON test { $1, $3 } + AXIS COLONCOLON test { let a, t = $1, $3 in + if a == Attribute && Utils.QNameSet.is_finite t then + (a, Utils.QNameSet.fold + (fun t a -> + Utils.QNameSet.add + (Utils.QName.add_attribute_prefix t) a) + t Utils.QNameSet.empty) + else + (a, t) + } | test { Child, $1 } | AXIS { let _ = Format.flush_str_formatter () in @@ -92,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: @@ -142,4 +154,3 @@ arg_list1: expr { [ $1 ] } | arg_list1 COMMA expr { $3 :: $1 } ; -