Commit f28ca379 authored by ajanz's avatar ajanz

use head position predefined in operator variables, needed to properly select MWE ctags

parent 72497a73
......@@ -65,6 +65,7 @@ bool LexicalUnit::IsHere(const Wccl::SentenceContext &sc,
return false;
bool found_head = false;
bool head_defined = false;
Wccl::SentenceContext sc2(sc.get_sentence_ptr());
......@@ -81,12 +82,18 @@ bool LexicalUnit::IsHere(const Wccl::SentenceContext &sc,
out_position.insert( abs_pos );
if(!found_head){
sc2.set_position(abs_pos);
if(head_cond_->apply(sc2)->get_value()){
head_pos = abs_pos;
if(head_cond_->apply(sc2)->get_value()) {
if (!head_defined)
head_pos = abs_pos;
found_head = true;
}
}
}
if(boost::algorithm::starts_with(varname, "Head")) {
Wccl::Position predefined_head_pos = condition_->get<Wccl::Position>(varname);
head_pos = sc.get_abs_position(predefined_head_pos);
head_defined = true;
}
}
if(!found_head){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment