diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-25 12:13:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-27 10:30:15 +0200 |
commit | 923639283d2bae0b82cb605fa4680a3058c9d973 (patch) | |
tree | 3c122b70129cdd2b502e1f7056eac896c109f03a /odb/lookup.cxx | |
parent | adfa9bbd04cd3571932ee7675344ca723bfa1eab (diff) |
Add support for defining indexes
New db pragma qualifier: index. New tests: common/index, mysql/index,
pgsql/index.
Diffstat (limited to 'odb/lookup.cxx')
-rw-r--r-- | odb/lookup.cxx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/odb/lookup.cxx b/odb/lookup.cxx index c6b40b1..b3e0551 100644 --- a/odb/lookup.cxx +++ b/odb/lookup.cxx @@ -48,6 +48,7 @@ namespace lookup tree scope, string& name, bool is_type, + bool trailing_scope, tree* end_scope) { tree id; @@ -78,7 +79,24 @@ namespace lookup ptt = tt; tt = l.next (tl, &tn); - bool last (tt != CPP_SCOPE); + bool last (true); + if (tt == CPP_SCOPE) + { + // If trailing scope names are allowed, then we also need to + // check what's after the scope. + // + if (trailing_scope) + { + ptt = tt; + tt = l.next (tl, &tn); + + if (tt == CPP_NAME) + last = false; + } + else + last = false; + } + tree decl = lookup_qualified_name (scope, id, last && is_type, false); // If this is the first component in the name, then also search the @@ -110,8 +128,11 @@ namespace lookup name += "::"; - ptt = tt; - tt = l.next (tl, &tn); + if (!trailing_scope) + { + ptt = tt; + tt = l.next (tl, &tn); + } } return scope; |