зеркало из https://github.com/mozilla/pjs.git
added patches from Marina M. to fix predicate parsing, and make sure we look for Axis Identifier wild cards
This commit is contained in:
Родитель
81f7803783
Коммит
d808073f42
|
@ -25,13 +25,17 @@
|
|||
* Bob Miller, Oblix Inc., kbob@oblix.com
|
||||
* -- fixed bug with single quotes inside double quotes
|
||||
*
|
||||
* $Id: ExprLexer.cpp,v 1.1 2000-04-06 07:45:26 kvisco%ziplink.net Exp $
|
||||
* Marina Mechtcheriakova, mmarina@mindspring.com
|
||||
* -- Fixed bug in parse method so that we make sure we check for
|
||||
* axis identifier wild cards, such as ancestor::*
|
||||
*
|
||||
* $Id: ExprLexer.cpp,v 1.2 2000-04-13 09:13:14 kvisco%ziplink.net Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Lexical analyzer for XPath expressions
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:45:26 $
|
||||
* @version $Revision: 1.2 $ $Date: 2000-04-13 09:13:14 $
|
||||
**/
|
||||
|
||||
#include <iostream.h>
|
||||
|
@ -640,6 +644,10 @@ void ExprLexer::parse(const String& pattern) {
|
|||
case ASTERIX:
|
||||
matchToken(tokenBuffer, ch);
|
||||
switch ( prevToken->type ) {
|
||||
//-- Fix: make sure check for axis identifier wild cards, such as
|
||||
//-- ancestor::* - Marina M.
|
||||
case Token::AXIS_IDENTIFIER :
|
||||
//-- End Fix
|
||||
case Token::PARENT_OP :
|
||||
case Token::ANCESTOR_OP:
|
||||
case Token::AT_SIGN :
|
||||
|
|
|
@ -21,10 +21,12 @@
|
|||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
* Olivier Gerardin, ogerardin@vo.lu
|
||||
* -- fixed a bug in CreateExpr (@xxx=/yyy was parsed as
|
||||
* @xxx=@xxx/yyy)
|
||||
* -- fixed a bug in CreateExpr (@xxx=/yyy was parsed as @xxx=@xxx/yyy)
|
||||
* Marina Mechtcheriakova
|
||||
* -- fixed bug in ::parsePredicates,
|
||||
* made sure we continue looking for more predicates.
|
||||
*
|
||||
* $Id: ExprParser.cpp,v 1.1 2000-04-06 07:45:29 kvisco%ziplink.net Exp $
|
||||
* $Id: ExprParser.cpp,v 1.2 2000-04-13 09:13:22 kvisco%ziplink.net Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -32,7 +34,7 @@
|
|||
* This class is used to parse XSL Expressions
|
||||
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
|
||||
* @see ExprLexer
|
||||
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:45:29 $
|
||||
* @version $Revision: 1.2 $ $Date: 2000-04-13 09:13:22 $
|
||||
**/
|
||||
|
||||
#include "ExprParser.h"
|
||||
|
@ -811,8 +813,19 @@ String* ExprParser::parsePredicates(PredicateList* predicateList, ExprLexer& lex
|
|||
}
|
||||
if ( tok->type == Token::R_BRACKET) {
|
||||
lexer.nextToken(); //-- eat ']'
|
||||
break;
|
||||
|
||||
|
||||
//-- Fix: look ahead at next token for mulitple predicates - Marina M.
|
||||
tok = lexer.peek();
|
||||
if ((!tok) || ( tok->type != Token::L_BRACKET )) break;
|
||||
//-- /Fix
|
||||
}
|
||||
|
||||
//-- Fix: handle multiple predicates - Marina M.
|
||||
if (tok->type == Token::L_BRACKET)
|
||||
lexer.nextToken(); //-- swallow '['
|
||||
//-- /Fix
|
||||
|
||||
Expr* expr = createExpr(lexer);
|
||||
predicateList->add(expr);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче