mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-17 18:12:04 +01:00
Corrected spelling of precedence. I have no idea why I had it wrong in the first place, it just seems to be what comes out of my fingers
This commit is contained in:
parent
b187cc1667
commit
fc2a67619b
3 changed files with 13 additions and 13 deletions
|
@ -40,7 +40,7 @@ public:
|
||||||
stylesheet_(stylesheet),
|
stylesheet_(stylesheet),
|
||||||
sink_(output.asOutput()),
|
sink_(output.asOutput()),
|
||||||
message_sink_(error_output),
|
message_sink_(error_output),
|
||||||
variable_precendence_(0),
|
variable_precedence_(0),
|
||||||
to_msg_(0)
|
to_msg_(0)
|
||||||
{
|
{
|
||||||
xpathContext_.setVariableResolver(stack_);
|
xpathContext_.setVariableResolver(stack_);
|
||||||
|
@ -52,7 +52,7 @@ public:
|
||||||
stack_(rhs.stack_),
|
stack_(rhs.stack_),
|
||||||
sink_(output.asOutput()),
|
sink_(output.asOutput()),
|
||||||
message_sink_(rhs.message_sink_),
|
message_sink_(rhs.message_sink_),
|
||||||
variable_precendence_(rhs.variable_precendence_),
|
variable_precedence_(rhs.variable_precedence_),
|
||||||
to_msg_(false)
|
to_msg_(false)
|
||||||
{
|
{
|
||||||
xpathContext_.setVariableResolver(stack_);
|
xpathContext_.setVariableResolver(stack_);
|
||||||
|
@ -77,8 +77,8 @@ public:
|
||||||
void unpassParam(const std::string& name);
|
void unpassParam(const std::string& name);
|
||||||
void declareParam(const DOM::Node<std::string>& node, const Variable_declaration& param);
|
void declareParam(const DOM::Node<std::string>& node, const Variable_declaration& param);
|
||||||
void declareVariable(const DOM::Node<std::string>& node, const Variable_declaration& variable);
|
void declareVariable(const DOM::Node<std::string>& node, const Variable_declaration& variable);
|
||||||
void pushVariablePrecendence() { ++variable_precendence_; }
|
void pushVariablePrecedence() { ++variable_precedence_; }
|
||||||
int variablePrecendence() { return variable_precendence_; }
|
int variablePrecedence() { return variable_precedence_; }
|
||||||
void freezeTopLevel();
|
void freezeTopLevel();
|
||||||
void injectGlobalScope(const Scope& scope);
|
void injectGlobalScope(const Scope& scope);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ private:
|
||||||
private:
|
private:
|
||||||
const Stylesheet& stylesheet_;
|
const Stylesheet& stylesheet_;
|
||||||
VariableStack stack_;
|
VariableStack stack_;
|
||||||
int variable_precendence_;
|
int variable_precedence_;
|
||||||
Arabica::XPath::ExecutionContext<std::string> xpathContext_;
|
Arabica::XPath::ExecutionContext<std::string> xpathContext_;
|
||||||
Output& sink_;
|
Output& sink_;
|
||||||
StreamSink message_sink_;
|
StreamSink message_sink_;
|
||||||
|
@ -127,7 +127,7 @@ public:
|
||||||
|
|
||||||
virtual const std::string& namespace_uri() const { return var_.namespace_uri(); }
|
virtual const std::string& namespace_uri() const { return var_.namespace_uri(); }
|
||||||
virtual const std::string& name() const { return var_.name(); }
|
virtual const std::string& name() const { return var_.name(); }
|
||||||
virtual int precendence() const { return context_.variablePrecendence(); }
|
virtual int precedence() const { return context_.variablePrecedence(); }
|
||||||
|
|
||||||
virtual Arabica::XPath::XPathValue<std::string> value() const
|
virtual Arabica::XPath::XPathValue<std::string> value() const
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ void ExecutionContext::declareVariable(const DOM::Node<std::string>& node, const
|
||||||
void ExecutionContext::freezeTopLevel()
|
void ExecutionContext::freezeTopLevel()
|
||||||
{
|
{
|
||||||
stack_.freezeTopLevel();
|
stack_.freezeTopLevel();
|
||||||
variable_precendence_ = 0;
|
variable_precedence_ = -1;
|
||||||
} // freezeTopLevel
|
} // freezeTopLevel
|
||||||
|
|
||||||
void ExecutionContext::injectGlobalScope(const Scope& scope)
|
void ExecutionContext::injectGlobalScope(const Scope& scope)
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
{
|
{
|
||||||
for(ItemList::const_iterator ci = isi->begin(), ce = isi->end(); ci != ce; ++ci)
|
for(ItemList::const_iterator ci = isi->begin(), ce = isi->end(); ci != ce; ++ci)
|
||||||
(*ci)->execute(initialNode, context);
|
(*ci)->execute(initialNode, context);
|
||||||
context.pushVariablePrecendence();
|
context.pushVariablePrecedence();
|
||||||
} // for ...
|
} // for ...
|
||||||
context.freezeTopLevel();
|
context.freezeTopLevel();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
|
|
||||||
virtual const std::string& namespace_uri() const = 0;
|
virtual const std::string& namespace_uri() const = 0;
|
||||||
virtual const std::string& name() const = 0;
|
virtual const std::string& name() const = 0;
|
||||||
virtual int precendence() const = 0;
|
virtual int precedence() const = 0;
|
||||||
virtual Arabica::XPath::XPathValue<std::string> value() const = 0;
|
virtual Arabica::XPath::XPathValue<std::string> value() const = 0;
|
||||||
|
|
||||||
virtual void injectGlobalScope(const Scope& scope) const = 0;
|
virtual void injectGlobalScope(const Scope& scope) const = 0;
|
||||||
|
@ -32,7 +32,7 @@ private:
|
||||||
Variable_instance& operator=(const Variable_instance&);
|
Variable_instance& operator=(const Variable_instance&);
|
||||||
bool operator==(const Variable_instance&) const;
|
bool operator==(const Variable_instance&) const;
|
||||||
|
|
||||||
int precendence_;
|
int precedence_;
|
||||||
}; // Variable_instance
|
}; // Variable_instance
|
||||||
|
|
||||||
class VariableStack : public Arabica::XPath::VariableResolver<std::string>
|
class VariableStack : public Arabica::XPath::VariableResolver<std::string>
|
||||||
|
@ -108,10 +108,10 @@ public:
|
||||||
|
|
||||||
if(stack.find(name) != stack.end())
|
if(stack.find(name) != stack.end())
|
||||||
{
|
{
|
||||||
int current_p = stack[name]->precendence();
|
int current_p = stack[name]->precedence();
|
||||||
if(var->precendence() == current_p)
|
if(var->precedence() == current_p)
|
||||||
throw std::runtime_error("Duplicate variable name : " + clarkName(var));
|
throw std::runtime_error("Duplicate variable name : " + clarkName(var));
|
||||||
if(var->precendence() > current_p)
|
if(var->precedence() > current_p)
|
||||||
return;
|
return;
|
||||||
} // if ...
|
} // if ...
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue