diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-24 14:56:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-24 14:56:11 +0200 |
commit | 319def6da0c6d17c29f66c0ea5837a58988a67d7 (patch) | |
tree | 43724ae423ec85682ba77d5e4af347f8e7ed7729 /odb/pragma.cxx | |
parent | ac83439900ab5ed4febe68375d3936ae2a59d707 (diff) |
Add support for resetting options accumulated with options pragma
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r-- | odb/pragma.cxx | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx index 6e1ecfa..23d3fd3 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -514,11 +514,11 @@ handle_pragma (cpp_reader* reader, p == "key_options" || p == "id_options") { - // options ("<name>") - // value_options ("<name>") - // index_options ("<name>") - // key_options ("<name>") - // id_options ("<name>") + // options (["<name>"]) + // value_options (["<name>"]) + // index_options (["<name>"]) + // key_options (["<name>"]) + // id_options (["<name>"]) // // Make sure we've got the correct declaration type. @@ -534,20 +534,28 @@ handle_pragma (cpp_reader* reader, tt = pragma_lex (&t); - if (tt != CPP_STRING) + // An empty options specifier signals options reset. + // + if (tt == CPP_STRING) + { + val = TREE_STRING_POINTER (t); + tt = pragma_lex (&t); + } + // Empty options specifier signals options reset. + // + else if (tt != CPP_CLOSE_PAREN) { error () << "options string expected in db pragma '" << p << "'" << endl; return; } - val = TREE_STRING_POINTER (t); - - if (pragma_lex (&t) != CPP_CLOSE_PAREN) + if (tt != CPP_CLOSE_PAREN) { error () << "')' expected at the end of db pragma '" << p << "'" << endl; return; } + mode = pragma::accumulate; tt = pragma_lex (&t); } else if (p == "type" || |