Commits

Steve Spigarelli committed ff67038

passing new tests for global namespaces

  • Participants
  • Parent commits 915365b

Comments (0)

Files changed (2)

File pygments/lexers/web.py

             (r'(\.\d+)[eE][\+\-]?\d+', Number.Double, 'operator'),
             (r'(\.\d+|\d+\.\d*)', Number, 'operator'),
             (r'(\d+)', Number.Integer, 'operator'),
-            (r'(\.\.|\.|\)|\*)', Punctuation, 'operator'),
+            (r'(\.\.|\.|\))', Punctuation, 'operator'),
             (r'(declare)(\s+)(construction)',
              bygroups(Keyword, Text, Keyword), 'operator'),
             (r'(declare)(\s+)(default)(\s+)(order)',
              bygroups(Keyword, Text, Keyword, Text, Keyword), 'operator'),
             (ncname + ':\*', Name, 'operator'),
+            ('\*:'+ncname, Name, 'operator'),
+            ('\*', Name, 'operator'),
             (stringdouble, String.Double, 'operator'),
             (stringsingle, String.Single, 'operator'),
 
             (r'(catch)(\s*)(\()(\$)',
              bygroups(Keyword, Text, Punctuation, Name.Variable), 'varname'),
 
-            (r'(@' + qname + ')', pushstate_operator_attribute_callback),
-            (r'(@\*)', pushstate_operator_attribute_callback),
-            (r'(@' + ncname + ')', pushstate_operator_attribute_callback),
+            (r'(@'+qname+')', Name.Attribute),
+            (r'(@'+ncname+')', Name.Attribute),
+            (r'(@)', Name.Attribute),
 
             (r'//|/|\+|-|;|,|\(|\)', Punctuation),
 
             # STANDALONE QNAMES
             (qname + r'(?=\s*[{])', Name.Variable, 'qname_braren'),
-            (qname + r'(?=\s*[(])', Name.Function, 'qname_braren'),
+            (qname + r'(?=\s*[(][^:])', Name.Function, 'qname_braren'),
             (qname, Name.Variable, 'operator'),
         ]
     }
-

File tests/examplefiles/test.xqy

 				element test { 'a' },
 					attribute foo { "bar" },
 						fn:doc()[ foo/@bar eq $let ],
-							//x/with/another/xpath/@attr }
+                        //x/with/another/*/*:version/xpath/@attr }
 };
 
 let $bride := "Bride"
 let $test := validate lax { <some>html</some> }
 let $test := validate strict { <some>html</some> }
 let $test := validate { <some>html</some> }
+let $test := $var1/*:Article       (: comment here :) [fn:not()]
+let $test := $var1/@*:name/fn:string()
 
 let $noop := ordered { $test }
 let $noop := unordered { $test }