Skip to content

Commit

Permalink
Convert more predicates to use dot syntax
Browse files Browse the repository at this point in the history
Reviewed By: phlalx

Differential Revision: D59369302

fbshipit-source-id: da52d40078b0cc09227587fc2440ed0d82639b4a
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Dec 12, 2024
1 parent 6175072 commit b1bd145
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions glean/schema/source/cxx.angle
Original file line number Diff line number Diff line change
Expand Up @@ -818,22 +818,21 @@ predicate DeclarationScope :
}
{ Decl, Scope } where
# these share FunctionQName scopes
( { function_ = { name = FQN }} |
{ usingDeclaration = { name = FQN }} = Decl;
{ scope = Scope } = FQN
( FQN = Decl.function_?.name | Decl.usingDeclaration?.name;
Scope = FQN.scope
# vanilla QName scopes
) | (
{ record_ = { name = QN } } |
{ variable = { name = QN } } |
{ typeAlias = { name = QN } } |
{ enum_ = { name = QN } } |
{ usingDirective = { name = QN } } = Decl;
{ scope = Scope } = QN
QN =
Decl.record_?.name |
Decl.variable?.name |
Decl.typeAlias?.name |
Decl.enum_?.name |
Decl.usingDirective?.name;
Scope = QN.scope
# NamespaceQName scopes
) | (
{ namespace_ = { name = NQN } } |
{ namespaceAlias = { name = NQN } } = Decl;
Scope = cxx1.Scope { namespace_ = NQN }
NQN = Decl.namespace_?.name | Decl.namespaceAlias?.name;
Scope.namespace_? = NQN
)

# src.Range of an arbitrary Declaration.
Expand Down

0 comments on commit b1bd145

Please sign in to comment.