| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org> | 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org> |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/xml/XPathPath.h" | 35 #include "core/xml/XPathPath.h" |
| 36 #include "wtf/PtrUtil.h" | 36 #include "wtf/PtrUtil.h" |
| 37 #include "wtf/StdLibExtras.h" | 37 #include "wtf/StdLibExtras.h" |
| 38 #include "wtf/text/StringHash.h" | 38 #include "wtf/text/StringHash.h" |
| 39 | 39 |
| 40 using namespace blink; | 40 using namespace blink; |
| 41 using namespace WTF; | 41 using namespace WTF; |
| 42 using namespace Unicode; | 42 using namespace Unicode; |
| 43 using namespace XPath; | 43 using namespace XPath; |
| 44 | 44 |
| 45 Parser* Parser::currentParser = nullptr; | 45 Parser* Parser::current_parser_ = nullptr; |
| 46 | 46 |
| 47 enum XMLCat { NameStart, NameCont, NotPartOfName }; | 47 enum XMLCat { NameStart, NameCont, NotPartOfName }; |
| 48 | 48 |
| 49 typedef HashMap<String, Step::Axis> AxisNamesMap; | 49 typedef HashMap<String, Step::Axis> AxisNamesMap; |
| 50 | 50 |
| 51 static XMLCat charCat(UChar aChar) { | 51 static XMLCat charCat(UChar aChar) { |
| 52 // might need to add some special cases from the XML spec. | 52 // might need to add some special cases from the XML spec. |
| 53 | 53 |
| 54 if (aChar == '_') | 54 if (aChar == '_') |
| 55 return NameStart; | 55 return NameStart; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 return true; | 468 return true; |
| 469 } | 469 } |
| 470 | 470 |
| 471 Expression* Parser::parseStatement(const String& statement, | 471 Expression* Parser::parseStatement(const String& statement, |
| 472 XPathNSResolver* resolver, | 472 XPathNSResolver* resolver, |
| 473 ExceptionState& exceptionState) { | 473 ExceptionState& exceptionState) { |
| 474 reset(statement); | 474 reset(statement); |
| 475 | 475 |
| 476 m_resolver = resolver; | 476 m_resolver = resolver; |
| 477 | 477 |
| 478 Parser* oldParser = currentParser; | 478 Parser* oldParser = current_parser_; |
| 479 currentParser = this; | 479 current_parser_ = this; |
| 480 int parseError = xpathyyparse(this); | 480 int parseError = xpathyyparse(this); |
| 481 currentParser = oldParser; | 481 current_parser_ = oldParser; |
| 482 | 482 |
| 483 if (parseError) { | 483 if (parseError) { |
| 484 m_strings.clear(); | 484 m_strings.clear(); |
| 485 | 485 |
| 486 m_topExpr = nullptr; | 486 m_topExpr = nullptr; |
| 487 | 487 |
| 488 if (m_gotNamespaceError) | 488 if (m_gotNamespaceError) |
| 489 exceptionState.throwDOMException( | 489 exceptionState.throwDOMException( |
| 490 NamespaceError, | 490 NamespaceError, |
| 491 "The string '" + statement + "' contains unresolvable namespaces."); | 491 "The string '" + statement + "' contains unresolvable namespaces."); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 510 m_strings.add(WTF::wrapUnique(s)); | 510 m_strings.add(WTF::wrapUnique(s)); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void Parser::deleteString(String* s) { | 513 void Parser::deleteString(String* s) { |
| 514 if (!s) | 514 if (!s) |
| 515 return; | 515 return; |
| 516 | 516 |
| 517 DCHECK(m_strings.contains(s)); | 517 DCHECK(m_strings.contains(s)); |
| 518 m_strings.remove(s); | 518 m_strings.remove(s); |
| 519 } | 519 } |
| OLD | NEW |