diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-04 17:23:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-04 17:23:54 +0200 |
commit | 8e69f40ab32dc8604b68f360ae30fa961ba036ee (patch) | |
tree | 5448cea6c20f7e6c5cd80ae752b49e1a696bcd6e /odb/pragma.cxx | |
parent | 36920a538c7b207c0b36b2270108a717479e0ed1 (diff) |
Implement object loading views
See section 10.2 in the manual for details.
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r-- | odb/pragma.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
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<member_access> ().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"; } |