Skip to content

Commit 7aab4ae

Browse files
Roman Castellarinfacebook-github-bot
authored andcommitted
Convert a few predicates from codemarkup.hack.angle to use dot syntax
Summary: As titled Reviewed By: phlalx Differential Revision: D76428616 fbshipit-source-id: e82f15c9d483b0702229c992e04c15249a9f3989
1 parent 4825f11 commit 7aab4ae

File tree

1 file changed

+19
-39
lines changed

1 file changed

+19
-39
lines changed

glean/schema/source/codemarkup.hack.angle

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ predicate HackEnumInheritedMembers :
417417
{
418418
member_ : hack.MethodDeclaration
419419
} { member_ = Md } where
420-
hack.ClassDefinition {
421-
declaration = { name = { name = "BuiltinEnum", namespace_ = {just = { name = "HH" } } } },
422-
members = Ms
423-
};
420+
C : hack.ClassDefinition;
421+
C.declaration.name.name = "BuiltinEnum";
422+
C.declaration.name.namespace_.just?.name = "HH";
423+
C.members = Ms;
424424
{ method = Md } = Ms[..]
425425

426426
# Inherited parents but drop those with "HideFromDocs" annotations
@@ -937,51 +937,31 @@ predicate HackRequiredConstraint:
937937
entity : code.hack.Entity,
938938
requiredRelation : RequiredRelation,
939939
required_ : code.hack.Entity
940-
}
940+
} { E, Rel, R } where
941941
(
942-
{
943-
{ decl = { container = { interface_ = D } } },
944-
extends_,
945-
{ decl = { container = { class_ = C } } }
946-
}
947-
where
948-
RE[..] = C;
949-
hack.InterfaceDefinition { declaration = D, requireExtends = RE }
942+
Rel = extends_;
943+
RE[..] = R.decl?.container?.class_?;
944+
hack.InterfaceDefinition { declaration = E.decl?.container?.interface_?, requireExtends = RE }
950945
) | (
951-
{
952-
{ decl = { container = { trait = D } } },
953-
extends_,
954-
{ decl = { container = { class_ = C } } }
955-
}
956-
where
957-
RE[..] = C;
958-
hack.TraitDefinition { declaration = D, requireExtends = RE }
946+
Rel = extends_;
947+
RE[..] = R.decl?.container?.class_?;
948+
hack.TraitDefinition { declaration = E.decl?.container?.trait?, requireExtends = RE }
959949
) | (
960-
{
961-
{ decl = { container = { trait = D } } },
962-
implements_,
963-
{ decl = { container = { interface_ = I } } }
964-
}
965-
where
966-
RE[..] = I;
967-
hack.TraitDefinition { declaration = D, requireImplements = RE }
950+
Rel = implements_;
951+
RE[..] = R.decl?.container?.interface_?;
952+
hack.TraitDefinition { declaration = E.decl?.container?.trait?, requireImplements = RE }
968953
) | (
969-
{
970-
{decl = { container = { trait = D } } },
971-
class_,
972-
{ decl = { container = { class_ = C } } }
973-
}
974-
where
975-
RE[..] = C;
976-
hack.TraitDefinition { declaration = D, requireClass = { just = RE } }
954+
Rel = class_;
955+
RE[..] = R.decl?.container?.class_?;
956+
hack.TraitDefinition { declaration = E.decl?.container?.trait?, requireClass = { just = RE } }
977957
)
978958

979959
predicate HackEntityModuleName:
980960
{
981961
entity : code.hack.Entity,
982962
name : string
983963
}
984-
{ { decl = { module = { name = hack.Name Name } } }, Name }
964+
{ Decl, Name } where Decl.decl?.module?.name = hack.Name Name
985965

986966
predicate HackEntityIdl:
987967
{
@@ -991,7 +971,7 @@ predicate HackEntityIdl:
991971
{ E, I } where
992972
hack.HackToThrift { from = Hack, to = Thrift };
993973
fbthrift.DeclarationFile { Thrift, fbthrift.File F };
994-
{ lang = Thrift,
974+
{ lang = Thrift,
995975
file = F,
996976
entity = { just = { fbthrift = { decl = Thrift } } },
997977
range = nothing } = I;

0 commit comments

Comments
 (0)