diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-16 08:19:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-16 08:19:25 +0200 |
commit | 521216e0a696fa698c88fc1e18958c82626873cc (patch) | |
tree | dd95f00470fc1f9bbc3d1ec2f0bf3c9314f8e166 /odb/pragma.cxx | |
parent | e269daa6cd5e88bc7ada0e148b052aabd65044d8 (diff) |
Implement support for nested members in inverse pragma
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r-- | odb/pragma.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx index ac220b3..b92930a 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -2298,14 +2298,31 @@ handle_pragma (cxx_lexer& l, return; } - val = tl; + string name (tl); - if (l.next (tl, &tn) != CPP_CLOSE_PAREN) + tt = l.next (tl, &tn); + + // Parse nested members if any. + // + for (; tt == CPP_DOT; tt = l.next (tl, &tn)) + { + if (l.next (tl, &tn) != CPP_NAME) + { + error (l) << "name expected after '.' in db pragma " << p << endl; + return; + } + + name += '.'; + name += tl; + } + + if (tt != CPP_CLOSE_PAREN) { error (l) << "')' expected at the end of db pragma " << p << endl; return; } + val = name; tt = l.next (tl, &tn); } else if (p == "on_delete") |