[Webkit-unassigned] [Bug 50366] XPath lexer misinterprets expression starting with "div".

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 2 16:05:03 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50366





--- Comment #4 from Alexey Proskuryakov <ap at webkit.org>  2010-12-02 16:05:03 PST ---
Looks great. Could you please combine these into a single patch, and mark it for review (set review? flag when adding an attachment)?

+<p>Test that an NCName and * are interpreted as an operator when it is in
+binary operator context, and as a NameTest otherwise..

Nit: two periods at the end.

-/* Returns whether the last parsed token matches the [32] Operator rule
- * (check http://www.w3.org/TR/xpath#exprlex). Necessary to disambiguate
- * the tokens.
+/* Returns whether the current token can possibly be a binary operator, given
+ * the previous token. Necessary to disambiguate some of the operators
+ * (* (multiply), div, and, or, mod) in the [32] Operator rule
+ * (check http://www.w3.org/TR/xpath#exprlex).
  */

Nit: this is a pre-existing issue, but we don't use C comments in C++ code as a matter of coding style.

-    if (isOperatorContext()) {
+    if (isBinaryOperatorContext()) {
         if (name == "and") //### hash?
             return Token(AND);

I'm wondering what this ### comment is about.

+++ fast/xpath/ambiguous-operators.html    (revision 0)

I'd try to add as many tests as I can think of, even if redundant. Say, "div/div", "(12) div 4" or "div + div".

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list