Skip to content

Commit

Permalink
more CppCheck stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed May 10, 2023
1 parent aec47dd commit a0b7ee1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 11 additions & 9 deletions include/frog/mbma_brackets.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class BaseBracket {
int& ) const = 0;
virtual Compound::Type compound() const { return Compound::Type::NONE; };
virtual Compound::Type speculateCompoundType() { return compound(); };
virtual void display_parts( std::ostream&, int=0 ) const { return; };
CLEX::Type tag() const { return cls; };
void setTag( CLEX::Type t ) { cls = t; };
std::vector<CLEX::Type> RightHand;
Expand Down Expand Up @@ -181,22 +182,23 @@ class BracketNest: public BaseBracket {
const std::list<BaseBracket*>::iterator& ) const;
std::list<BaseBracket*>::iterator resolveAffix( std::list<BaseBracket*>&,
const std::list<BaseBracket*>::iterator& );
void resolveGlue();
void resolveNouns();
void resolveLead();
void resolveTail();
void resolveMiddle();
Compound::Type speculateCompoundType();
CLEX::Type getFinalTag();
void resolveGlue() override;
void resolveLead() override;
void resolveTail() override;
void resolveMiddle() override;
Compound::Type speculateCompoundType() override;
folia::Morpheme *createMorpheme( folia::Document *,
const std::string& ) const override;
folia::Morpheme *createMorpheme( folia::Document *,
const std::string&,
icu::UnicodeString&,
int& ) const override;
std::list<BaseBracket *> parts;
Compound::Type compound() const { return _compound; };
void resolveNouns();
CLEX::Type getFinalTag();
Compound::Type compound() const override { return _compound; };
void display_parts( std::ostream&, int=0 ) const override;
private:
std::list<BaseBracket *> parts;
Compound::Type _compound;
};

Expand Down
10 changes: 4 additions & 6 deletions src/mbma_brackets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1043,15 +1043,13 @@ folia::Morpheme *BracketNest::createMorpheme( folia::Document *doc,
}


void display_parts( ostream& os, const list<BaseBracket*>& parts,
int indent=0 ){
void BracketNest::display_parts( ostream& os,
int indent ) const {
int i=1;
for ( const auto& it : parts ){
os << string(indent,' ') << "[" << i++ << "]= "
<< static_cast<void*>(it) << endl;
if ( it->isNested() ){
display_parts( os, dynamic_cast<BracketNest*>(it)->parts, indent + 4 );
}
it->display_parts( os, indent + 4 );
}
}

Expand All @@ -1065,7 +1063,7 @@ list<BaseBracket*>::iterator BracketNest::resolveAffix( list<BaseBracket*>& resu
*/
if ( debugFlag > 5 ){
LOG << "resolve affix" << endl;
display_parts( LOG, parts );
display_parts( LOG );
}
list<BaseBracket*>::iterator bit;
bool matched = testMatch( result, rpos, bit );
Expand Down

0 comments on commit a0b7ee1

Please sign in to comment.