From 521216e0a696fa698c88fc1e18958c82626873cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Jun 2015 08:19:25 +0200 Subject: Implement support for nested members in inverse pragma --- odb/pragma.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'odb/pragma.cxx') 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") -- cgit v1.1