summaryrefslogtreecommitdiff
path: root/src/piraha/Piraha.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/piraha/Piraha.hpp')
-rw-r--r--src/piraha/Piraha.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/piraha/Piraha.hpp b/src/piraha/Piraha.hpp
index 25892fbc..f16b6ae0 100644
--- a/src/piraha/Piraha.hpp
+++ b/src/piraha/Piraha.hpp
@@ -55,8 +55,10 @@ public:
smart_ptr<Group> group(const char *nm,int ix=0) {
for(unsigned int i=0;i<children.size();i++) {
if(children[i]->getPatternName() == nm) {
- if(ix-- == 0)
+ if(ix == 0) {
return children[i];
+ }
+ ix--;
}
}
smart_ptr<Group> ret;
@@ -100,10 +102,12 @@ public:
inline std::ostream& operator<<(std::ostream& o,JMap& jmap) {
typedef map<std::string,smart_ptr<Pattern> >::iterator mit;
mit mb = jmap.m.begin();
- mit me = jmap.m.begin();
+ mit me = jmap.m.end();
+ o << "{";
for(mit i = mb; i != me;++i) {
o << "[" << i->first << "]";
}
+ o << "}";
return o;
}