From 8e69f40ab32dc8604b68f360ae30fa961ba036ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Feb 2015 17:23:54 +0200 Subject: Implement object loading views See section 10.2 in the manual for details. --- odb/pragma.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'odb/pragma.cxx') diff --git a/odb/pragma.cxx b/odb/pragma.cxx index 4d0acae..7a3d6ec 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -1089,18 +1089,23 @@ handle_pragma (cxx_lexer& l, return; } - tt = l.next (tl, &tn); - - val = member_access (loc, false); - if (!parse_expression (l, tt, tl, tn, val.value ().expr, p)) - return; // Diagnostics has already been issued. + member_access ma (loc, p == "set" ? "modifier" : "accessor", false); - if (tt != CPP_CLOSE_PAREN) + tt = l.next (tl, &tn); + if (tt != CPP_CLOSE_PAREN) // Empty expression are ok. { - error (l) << "')' expected at the end of db pragma " << p << endl; - return; + if (!parse_expression (l, tt, tl, tn, ma.expr, p)) + return; // Diagnostics has already been issued. + + if (tt != CPP_CLOSE_PAREN) + { + error (l) << "')' expected at the end of db pragma " << p << endl; + return; + } } + val = ma; + // Convert access to the get/set pair. // if (p == "access") @@ -1109,6 +1114,8 @@ handle_pragma (cxx_lexer& l, add_pragma ( pragma (p, "get", val, loc, &check_spec_decl_type, 0), decl, ns); + ma.kind = "modifier"; + val = ma; name = "set"; } -- cgit v1.1