summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-07-13 20:08:17 +0000
committerishmal <ishmal@users.sourceforge.net>2006-07-13 20:08:17 +0000
commit2b62f943d56c8ff6c46ad49f1bfa4114eb61ddaa (patch)
tree7bca8b2ee55a2237a734fd8bc2d95699cd760a65 /src
parentinclude libpng with pkg-config check for include path (fixes #1519300) (diff)
downloadinkscape-2b62f943d56c8ff6c46ad49f1bfa4114eb61ddaa.tar.gz
inkscape-2b62f943d56c8ff6c46ad49f1bfa4114eb61ddaa.zip
fixed parsing of axes
(bzr r1404)
Diffstat (limited to 'src')
-rw-r--r--src/dom/xpathparser.cpp13
-rw-r--r--src/dom/xpathtoken.cpp15
-rw-r--r--src/dom/xpathtoken.h1
3 files changed, 27 insertions, 2 deletions
diff --git a/src/dom/xpathparser.cpp b/src/dom/xpathparser.cpp
index cb06a0fb2..abbbb0900 100644
--- a/src/dom/xpathparser.cpp
+++ b/src/dom/xpathparser.cpp
@@ -860,30 +860,43 @@ int XPathParser::getAxisSpecifier(int p0, int depth)
{
case ANCESTOR_OR_SELF:
tokAdd(Token::TOK_AXIS_ANCESTOR_OR_SELF);
+ break;
case ANCESTOR:
tokAdd(Token::TOK_AXIS_ANCESTOR);
+ break;
case ATTRIBUTE:
tokAdd(Token::TOK_AXIS_ATTRIBUTE);
+ break;
case CHILD:
tokAdd(Token::TOK_AXIS_CHILD);
+ break;
case DESCENDANT_OR_SELF:
tokAdd(Token::TOK_AXIS_DESCENDANT_OR_SELF);
+ break;
case DESCENDANT:
tokAdd(Token::TOK_AXIS_DESCENDANT);
+ break;
case FOLLOWING_SIBLING:
tokAdd(Token::TOK_AXIS_FOLLOWING_SIBLING);
+ break;
case FOLLOWING:
tokAdd(Token::TOK_AXIS_FOLLOWING);
+ break;
case NAMESPACE:
tokAdd(Token::TOK_AXIS_NAMESPACE);
+ break;
case PARENT:
tokAdd(Token::TOK_AXIS_PARENT);
+ break;
case PRECEDING_SIBLING:
tokAdd(Token::TOK_AXIS_PRECEDING_SIBLING);
+ break;
case PRECEDING:
tokAdd(Token::TOK_AXIS_PRECEDING);
+ break;
case SELF:
tokAdd(Token::TOK_AXIS_SELF);
+ break;
default:
{
error("unknown axis type %d", axisType);
diff --git a/src/dom/xpathtoken.cpp b/src/dom/xpathtoken.cpp
index f08dfe7e3..fa81e2863 100644
--- a/src/dom/xpathtoken.cpp
+++ b/src/dom/xpathtoken.cpp
@@ -58,6 +58,12 @@ namespace xpath
//# V A L U E S
//###########################
+/**
+ * The following functions are called by a token's execute()
+ * method. These functions are what differentiate one token
+ * from another and give each its personality.
+*/
+
static bool tokStr(Token &tok, Stack &stack)
{
StackItem item;
@@ -510,8 +516,9 @@ static bool tokFuncRound(Token &tok, Stack &stack)
-
-
+/**
+ * An entry for the token 'personality' table
+ */
typedef struct
{
int ival;
@@ -519,6 +526,10 @@ typedef struct
TokenFunc tokenFunc;
} TokenTableEntry;
+
+/**
+ * The token personality table
+ */
static TokenTableEntry tokenTable[] =
{
//### primitives
diff --git a/src/dom/xpathtoken.h b/src/dom/xpathtoken.h
index 61d6cf6ef..71e096d46 100644
--- a/src/dom/xpathtoken.h
+++ b/src/dom/xpathtoken.h
@@ -384,6 +384,7 @@ private:
type = TOK_NOP;
ival = 0L;
dval = 0.0;
+ //sval = ""; //not necessary
}
void assign(const Token &other)