aboutsummaryrefslogtreecommitdiff
path: root/odb/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-06 18:05:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-06 18:05:19 +0200
commitce696c26d2c9dd5a5813fd865082ab19ac49bcfa (patch)
treec44331b2a6e6fa1d9d518ddff63e711ce5d308c4 /odb/parser.cxx
parent727a83dc82fa094aa91630d165d230a9a2dabe60 (diff)
Add support for container persistence
Diffstat (limited to 'odb/parser.cxx')
-rw-r--r--odb/parser.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/odb/parser.cxx b/odb/parser.cxx
index c257305..528b55b 100644
--- a/odb/parser.cxx
+++ b/odb/parser.cxx
@@ -1812,7 +1812,15 @@ process_pragmas (tree t,
ts << "\t\t pragma " << i->name << " (" << i->value << ")"
<< endl;
- node.set (i->name, i->value);
+ // Convert '_' to '-' in the pragma name so we get foo-bar instead
+ // of foo_bar (that's the convention used).
+ //
+ string tmp (i->name);
+ for (size_t j (0); j < tmp.size (); ++j)
+ if (tmp[j] == '_')
+ tmp[j] = '-';
+
+ node.set (tmp, i->value);
}
}
@@ -1834,7 +1842,15 @@ process_named_pragmas (tree t, node& node)
ts << "\t\t pragma " << i->name << " (" << i->value << ")"
<< endl;
- node.set (i->name, i->value);
+ // Convert '_' to '-' in the pragma name so we get foo-bar instead
+ // of foo_bar (that's the convention used).
+ //
+ string tmp (i->name);
+ for (size_t j (0); j < tmp.size (); ++j)
+ if (tmp[j] == '_')
+ tmp[j] = '-';
+
+ node.set (tmp, i->value);
}
}