mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Rust: schema.py add '| child' markers
This commit is contained in:
2
rust/ql/.generated.list
generated
2
rust/ql/.generated.list
generated
@@ -173,7 +173,7 @@ lib/codeql/rust/generated/MissingPat.qll 0d8034cee20bacf07ebb9337c797f53a25686a1
|
||||
lib/codeql/rust/generated/Module.qll 2a931a4f2cdb2fee00ed83af045ea63d36b7dbd708e58c30445b5610feaae333 cd62add5c31a509f965aa294f44a1607ec7c62e3a9e3fe9ee063b3c814f4eb62
|
||||
lib/codeql/rust/generated/OffsetOf.qll c5c7218a0dfa6636a4b3e4218969638cc267db94a966b19fbced0ba6f85dbd0e 6c8fac4cd343073ee0ed48498deb7faa65a876776d9ca0a98e51350fead5c8ac
|
||||
lib/codeql/rust/generated/OrPat.qll f8fe5c7b83a08dabcc530484a696274930040ea13501ae20f1426faeec67bcf0 f3adb3148890531b698570a48740335983a5e81977ba4ac651778f940f184398
|
||||
lib/codeql/rust/generated/ParentChild.qll 2edf7c0be4bbb2ffcd8133db21850fabf8e87badf7b4595d1bab258d68da3626 5bcc7154e175e4c96b61b47a681b569950612ec168b7ca3ec7368642c3ad3c9d
|
||||
lib/codeql/rust/generated/ParentChild.qll 3775b175e1295a747d66295b1fe78b0e098f7c8b24cffdad9d8d29a71f74b940 e02d40bee83eb8bed4342a41b3c1c46983acb6800a69e4937a28471dab17119b
|
||||
lib/codeql/rust/generated/Pat.qll fe1c72856442dbab5655eff93f86c2cbce8d69d9fa1f99a0f9203061ea1112a4 d85d86e8b6c48df733589d186f610b1cd9086629180701e017774bddc62402c7
|
||||
lib/codeql/rust/generated/Path.qll ca8878cd96c31ad9238a1d52487e094863d5abba825d189e0ea6f8d674194b75 ca8878cd96c31ad9238a1d52487e094863d5abba825d189e0ea6f8d674194b75
|
||||
lib/codeql/rust/generated/PathPat.qll 5869c513e1d0cb689589e2c72f3feda18b0f246d9b03304d8c0f9237f0300524 5869c513e1d0cb689589e2c72f3feda18b0f246d9b03304d8c0f9237f0300524
|
||||
|
||||
297
rust/ql/lib/codeql/rust/generated/ParentChild.qll
generated
297
rust/ql/lib/codeql/rust/generated/ParentChild.qll
generated
@@ -160,14 +160,23 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfMatchArm(MatchArm e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bAstNode, int n |
|
||||
exists(int b, int bAstNode, int n, int nPat, int nGuard, int nExpr |
|
||||
b = 0 and
|
||||
bAstNode = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfAstNode(e, i, _)) | i) and
|
||||
n = bAstNode and
|
||||
nPat = n + 1 and
|
||||
nGuard = nPat + 1 and
|
||||
nExpr = nGuard + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfAstNode(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getPat() and partialPredicateCall = "Pat()"
|
||||
or
|
||||
index = nPat and result = e.getGuard() and partialPredicateCall = "Guard()"
|
||||
or
|
||||
index = nGuard and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -225,144 +234,205 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfAwait(Await e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBecome(Become e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBinaryOp(BinaryOp e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nLhs, int nRhs |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nLhs = n + 1 and
|
||||
nRhs = nLhs + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getLhs() and partialPredicateCall = "Lhs()"
|
||||
or
|
||||
index = nLhs and result = e.getRhs() and partialPredicateCall = "Rhs()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBindPat(BindPat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nSubpat |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nSubpat = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getSubpat() and partialPredicateCall = "Subpat()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBlockBase(BlockBase e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nStatement, int nTail |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nStatement = n + 1 + max(int i | i = -1 or exists(e.getStatement(i)) | i) and
|
||||
nTail = nStatement + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getStatement(index - n) and
|
||||
partialPredicateCall = "Statement(" + (index - n).toString() + ")"
|
||||
or
|
||||
index = nStatement and result = e.getTail() and partialPredicateCall = "Tail()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBox(Box e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBoxPat(BoxPat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nInner |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nInner = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getInner() and partialPredicateCall = "Inner()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBreak(Break e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr, int nLabel |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
nLabel = nExpr + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
or
|
||||
index = nExpr and result = e.getLabel() and partialPredicateCall = "Label()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfCall(Call e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nCallee, int nArg |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nCallee = n + 1 and
|
||||
nArg = nCallee + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getCallee() and partialPredicateCall = "Callee()"
|
||||
or
|
||||
result = e.getArg(index - nCallee) and
|
||||
partialPredicateCall = "Arg(" + (index - nCallee).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfCast(Cast e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr, int nTypeRef |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
nTypeRef = nExpr + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
or
|
||||
index = nExpr and result = e.getTypeRef() and partialPredicateCall = "TypeRef()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfClosure(Closure e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nArg, int nArgType, int nRetType, int nBody |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nArg = n + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and
|
||||
nArgType = nArg + 1 + max(int i | i = -1 or exists(e.getArgType(i)) | i) and
|
||||
nRetType = nArgType + 1 and
|
||||
nBody = nRetType + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getArg(index - n) and
|
||||
partialPredicateCall = "Arg(" + (index - n).toString() + ")"
|
||||
or
|
||||
result = e.getArgType(index - nArg) and
|
||||
partialPredicateCall = "ArgType(" + (index - nArg).toString() + ")"
|
||||
or
|
||||
index = nArgType and result = e.getRetType() and partialPredicateCall = "RetType()"
|
||||
or
|
||||
index = nRetType and result = e.getBody() and partialPredicateCall = "Body()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -383,119 +453,164 @@ private module Impl {
|
||||
private Element getImmediateChildOfConstBlockPat(
|
||||
ConstBlockPat e, int index, string partialPredicateCall
|
||||
) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nExpr |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfContinue(Continue e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nLabel |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nLabel = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getLabel() and partialPredicateCall = "Label()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfExprStmt(ExprStmt e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bStmt, int n |
|
||||
exists(int b, int bStmt, int n, int nExpr |
|
||||
b = 0 and
|
||||
bStmt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfStmt(e, i, _)) | i) and
|
||||
n = bStmt and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfStmt(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfField(Field e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfFunction(Function e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bDeclaration, int n |
|
||||
exists(int b, int bDeclaration, int n, int nBody |
|
||||
b = 0 and
|
||||
bDeclaration =
|
||||
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfDeclaration(e, i, _)) | i) and
|
||||
n = bDeclaration and
|
||||
nBody = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfDeclaration(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getBody() and partialPredicateCall = "Body()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfIf(If e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nCondition, int nThen, int nElse |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nCondition = n + 1 and
|
||||
nThen = nCondition + 1 and
|
||||
nElse = nThen + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getCondition() and partialPredicateCall = "Condition()"
|
||||
or
|
||||
index = nCondition and result = e.getThen() and partialPredicateCall = "Then()"
|
||||
or
|
||||
index = nThen and result = e.getElse() and partialPredicateCall = "Else()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfIfLet(IfLet e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bStmt, int n |
|
||||
exists(int b, int bStmt, int n, int nPat, int nTypeRef, int nInitializer, int nElse |
|
||||
b = 0 and
|
||||
bStmt = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfStmt(e, i, _)) | i) and
|
||||
n = bStmt and
|
||||
nPat = n + 1 and
|
||||
nTypeRef = nPat + 1 and
|
||||
nInitializer = nTypeRef + 1 and
|
||||
nElse = nInitializer + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfStmt(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getPat() and partialPredicateCall = "Pat()"
|
||||
or
|
||||
index = nPat and result = e.getTypeRef() and partialPredicateCall = "TypeRef()"
|
||||
or
|
||||
index = nTypeRef and result = e.getInitializer() and partialPredicateCall = "Initializer()"
|
||||
or
|
||||
index = nInitializer and result = e.getElse() and partialPredicateCall = "Else()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfIndex(Index e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nBase, int nIndex |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nBase = n + 1 and
|
||||
nIndex = nBase + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getBase() and partialPredicateCall = "Base()"
|
||||
or
|
||||
index = nBase and result = e.getIndex() and partialPredicateCall = "Index()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfInlineAsm(InlineAsm e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -514,27 +629,36 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfLet(Let e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nPat, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nPat = n + 1 and
|
||||
nExpr = nPat + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getPat() and partialPredicateCall = "Pat()"
|
||||
or
|
||||
index = nPat and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfLitPat(LitPat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nExpr |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -553,40 +677,60 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfLoop(Loop e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nBody, int nLabel |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nBody = n + 1 and
|
||||
nLabel = nBody + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getBody() and partialPredicateCall = "Body()"
|
||||
or
|
||||
index = nBody and result = e.getLabel() and partialPredicateCall = "Label()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfMatch(Match e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr, int nBranch |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
nBranch = nExpr + 1 + max(int i | i = -1 or exists(e.getBranch(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
or
|
||||
result = e.getBranch(index - nExpr) and
|
||||
partialPredicateCall = "Branch(" + (index - nExpr).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfMethodCall(MethodCall e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nReceiver, int nArg |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nReceiver = n + 1 and
|
||||
nArg = nReceiver + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getReceiver() and partialPredicateCall = "Receiver()"
|
||||
or
|
||||
result = e.getArg(index - nReceiver) and
|
||||
partialPredicateCall = "Arg(" + (index - nReceiver).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -638,27 +782,34 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfOffsetOf(OffsetOf e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nContainer |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nContainer = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getContainer() and partialPredicateCall = "Container()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfOrPat(OrPat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nArg |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nArg = n + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getArg(index - n) and
|
||||
partialPredicateCall = "Arg(" + (index - n).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -690,27 +841,39 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfRange(Range e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nLhs, int nRhs |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nLhs = n + 1 and
|
||||
nRhs = nLhs + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getLhs() and partialPredicateCall = "Lhs()"
|
||||
or
|
||||
index = nLhs and result = e.getRhs() and partialPredicateCall = "Rhs()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfRangePat(RangePat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nStart, int nEnd |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nStart = n + 1 and
|
||||
nEnd = nStart + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getStart() and partialPredicateCall = "Start()"
|
||||
or
|
||||
index = nStart and result = e.getEnd() and partialPredicateCall = "End()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -742,79 +905,107 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfRef(Ref e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfRefPat(RefPat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nPat |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nPat = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getPat() and partialPredicateCall = "Pat()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfReturn(Return e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfSlicePat(SlicePat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nPrefix, int nSlice, int nSuffix |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nPrefix = n + 1 + max(int i | i = -1 or exists(e.getPrefix(i)) | i) and
|
||||
nSlice = nPrefix + 1 and
|
||||
nSuffix = nSlice + 1 + max(int i | i = -1 or exists(e.getSuffix(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getPrefix(index - n) and
|
||||
partialPredicateCall = "Prefix(" + (index - n).toString() + ")"
|
||||
or
|
||||
index = nPrefix and result = e.getSlice() and partialPredicateCall = "Slice()"
|
||||
or
|
||||
result = e.getSuffix(index - nSlice) and
|
||||
partialPredicateCall = "Suffix(" + (index - nSlice).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfTuple(Tuple e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 + max(int i | i = -1 or exists(e.getExpr(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getExpr(index - n) and
|
||||
partialPredicateCall = "Expr(" + (index - n).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfTuplePat(TuplePat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bPat, int n |
|
||||
exists(int b, int bPat, int n, int nArg |
|
||||
b = 0 and
|
||||
bPat = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfPat(e, i, _)) | i) and
|
||||
n = bPat and
|
||||
nArg = n + 1 + max(int i | i = -1 or exists(e.getArg(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfPat(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getArg(index - n) and
|
||||
partialPredicateCall = "Arg(" + (index - n).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -835,14 +1026,17 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfUnaryOp(UnaryOp e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -874,27 +1068,33 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfYeet(Yeet e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfYield(Yield e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bExpr, int n |
|
||||
exists(int b, int bExpr, int n, int nExpr |
|
||||
b = 0 and
|
||||
bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and
|
||||
n = bExpr and
|
||||
nExpr = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfExpr(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getExpr() and partialPredicateCall = "Expr()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -913,14 +1113,17 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBlock(Block e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bBlockBase, int n |
|
||||
exists(int b, int bBlockBase, int n, int nLabel |
|
||||
b = 0 and
|
||||
bBlockBase = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfBlockBase(e, i, _)) | i) and
|
||||
n = bBlockBase and
|
||||
nLabel = n + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfBlockBase(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getLabel() and partialPredicateCall = "Label()"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -928,27 +1131,37 @@ private module Impl {
|
||||
private Element getImmediateChildOfElementList(
|
||||
ElementList e, int index, string partialPredicateCall
|
||||
) {
|
||||
exists(int b, int bArray, int n |
|
||||
exists(int b, int bArray, int n, int nElement |
|
||||
b = 0 and
|
||||
bArray = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfArray(e, i, _)) | i) and
|
||||
n = bArray and
|
||||
nElement = n + 1 + max(int i | i = -1 or exists(e.getElement(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfArray(e, index - b, partialPredicateCall)
|
||||
or
|
||||
result = e.getElement(index - n) and
|
||||
partialPredicateCall = "Element(" + (index - n).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfRepeat(Repeat e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bArray, int n |
|
||||
exists(int b, int bArray, int n, int nInitializer, int nRepeat |
|
||||
b = 0 and
|
||||
bArray = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfArray(e, i, _)) | i) and
|
||||
n = bArray and
|
||||
nInitializer = n + 1 and
|
||||
nRepeat = nInitializer + 1 and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfArray(e, index - b, partialPredicateCall)
|
||||
or
|
||||
index = n and result = e.getInitializer() and partialPredicateCall = "Initializer()"
|
||||
or
|
||||
index = nInitializer and result = e.getRepeat() and partialPredicateCall = "Repeat()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
134
rust/schema.py
134
rust/schema.py
@@ -111,7 +111,7 @@ class Function(Declaration):
|
||||
```
|
||||
"""
|
||||
name: string
|
||||
body: Expr
|
||||
body: Expr | child
|
||||
|
||||
|
||||
# Missing,
|
||||
@@ -133,9 +133,9 @@ class Path(Expr):
|
||||
|
||||
|
||||
class If(Expr):
|
||||
condition: Expr
|
||||
then: Expr
|
||||
else_: optional[Expr]
|
||||
condition: Expr | child
|
||||
then: Expr | child
|
||||
else_: optional[Expr] | child
|
||||
|
||||
# Let {
|
||||
# pat: PatId,
|
||||
@@ -144,8 +144,8 @@ class If(Expr):
|
||||
|
||||
|
||||
class Let(Expr):
|
||||
pat: Pat
|
||||
expr: Expr
|
||||
pat: Pat | child
|
||||
expr: Expr | child
|
||||
|
||||
# Block {
|
||||
# id: Option<BlockId>,
|
||||
@@ -156,12 +156,12 @@ class Let(Expr):
|
||||
|
||||
|
||||
class BlockBase(Expr):
|
||||
statements: list[Stmt]
|
||||
tail: optional[Expr]
|
||||
statements: list[Stmt] | child
|
||||
tail: optional[Expr] | child
|
||||
|
||||
|
||||
class Block(BlockBase):
|
||||
label: optional[Label]
|
||||
label: optional[Label] | child
|
||||
|
||||
# Async {
|
||||
# id: Option<BlockId>,
|
||||
@@ -197,8 +197,8 @@ class UnsafeBlock(BlockBase):
|
||||
|
||||
|
||||
class Loop(Expr):
|
||||
body: Expr
|
||||
label: optional[Label]
|
||||
body: Expr | child
|
||||
label: optional[Label] | child
|
||||
|
||||
# Call {
|
||||
# callee: ExprId,
|
||||
@@ -208,8 +208,8 @@ class Loop(Expr):
|
||||
|
||||
|
||||
class Call(Expr):
|
||||
callee: Expr
|
||||
args: list[Expr]
|
||||
callee: Expr | child
|
||||
args: list[Expr] | child
|
||||
is_assignee_expr: predicate
|
||||
|
||||
# MethodCall {
|
||||
@@ -221,9 +221,9 @@ class Call(Expr):
|
||||
|
||||
|
||||
class MethodCall(Expr):
|
||||
receiver: Expr
|
||||
receiver: Expr | child
|
||||
method_name: string
|
||||
args: list[Expr]
|
||||
args: list[Expr] | child
|
||||
# TODO
|
||||
# generic_args: optional[GenericArgs]
|
||||
|
||||
@@ -236,9 +236,9 @@ class MethodCall(Expr):
|
||||
|
||||
@qltest.skip
|
||||
class MatchArm(AstNode):
|
||||
pat: Pat
|
||||
guard: optional[Expr]
|
||||
expr: Expr
|
||||
pat: Pat | child
|
||||
guard: optional[Expr] | child
|
||||
expr: Expr | child
|
||||
# Match {
|
||||
# expr: ExprId,
|
||||
# arms: Box<[MatchArm]>,
|
||||
@@ -246,8 +246,8 @@ class MatchArm(AstNode):
|
||||
|
||||
|
||||
class Match(Expr):
|
||||
expr: Expr
|
||||
branches: list[MatchArm]
|
||||
expr: Expr | child
|
||||
branches: list[MatchArm] | child
|
||||
|
||||
# Continue {
|
||||
# label: Option<LabelId>,
|
||||
@@ -255,7 +255,7 @@ class Match(Expr):
|
||||
|
||||
|
||||
class Continue(Expr):
|
||||
label: optional[Label]
|
||||
label: optional[Label] | child
|
||||
|
||||
# Break {
|
||||
# expr: Option<ExprId>,
|
||||
@@ -264,8 +264,8 @@ class Continue(Expr):
|
||||
|
||||
|
||||
class Break(Expr):
|
||||
expr: optional[Expr]
|
||||
label: optional[Label]
|
||||
expr: optional[Expr] | child
|
||||
label: optional[Label] | child
|
||||
|
||||
|
||||
# Return {
|
||||
@@ -273,21 +273,21 @@ class Break(Expr):
|
||||
# },
|
||||
|
||||
class Return(Expr):
|
||||
expr: optional[Expr]
|
||||
expr: optional[Expr] | child
|
||||
# Become {
|
||||
# expr: ExprId,
|
||||
# },
|
||||
|
||||
|
||||
class Become(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
# Yield {
|
||||
# expr: Option<ExprId>,
|
||||
# },
|
||||
|
||||
|
||||
class Yield(Expr):
|
||||
expr: optional[Expr]
|
||||
expr: optional[Expr] | child
|
||||
|
||||
# Yeet {
|
||||
# expr: Option<ExprId>,
|
||||
@@ -295,7 +295,7 @@ class Yield(Expr):
|
||||
|
||||
|
||||
class Yeet(Expr):
|
||||
expr: optional[Expr]
|
||||
expr: optional[Expr] | child
|
||||
# RecordLit {
|
||||
# path: Option<Box<Path>>,
|
||||
# fields: Box<[RecordLitField]>,
|
||||
@@ -316,7 +316,7 @@ class RecordLit(Expr):
|
||||
# },
|
||||
|
||||
class Field(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
name: string
|
||||
|
||||
# Await {
|
||||
@@ -325,7 +325,7 @@ class Field(Expr):
|
||||
|
||||
|
||||
class Await(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
|
||||
# Cast {
|
||||
# expr: ExprId,
|
||||
@@ -334,8 +334,8 @@ class Await(Expr):
|
||||
|
||||
|
||||
class Cast(Expr):
|
||||
expr: Expr
|
||||
type_ref: TypeRef
|
||||
expr: Expr | child
|
||||
type_ref: TypeRef | child
|
||||
# Ref {
|
||||
# expr: ExprId,
|
||||
# rawness: Rawness,
|
||||
@@ -344,7 +344,7 @@ class Cast(Expr):
|
||||
|
||||
|
||||
class Ref(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
is_raw: predicate
|
||||
is_mut: predicate
|
||||
# Box {
|
||||
@@ -353,7 +353,7 @@ class Ref(Expr):
|
||||
|
||||
|
||||
class Box(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
# UnaryOp {
|
||||
# expr: ExprId,
|
||||
# op: UnaryOp,
|
||||
@@ -361,7 +361,7 @@ class Box(Expr):
|
||||
|
||||
|
||||
class UnaryOp(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
op: string
|
||||
|
||||
|
||||
@@ -373,8 +373,8 @@ class UnaryOp(Expr):
|
||||
|
||||
|
||||
class BinaryOp(Expr):
|
||||
lhs: Expr
|
||||
rhs: Expr
|
||||
lhs: Expr | child
|
||||
rhs: Expr | child
|
||||
op: optional[string]
|
||||
|
||||
|
||||
@@ -386,8 +386,8 @@ class BinaryOp(Expr):
|
||||
|
||||
|
||||
class Range(Expr):
|
||||
lhs: optional[Expr]
|
||||
rhs: optional[Expr]
|
||||
lhs: optional[Expr] | child
|
||||
rhs: optional[Expr] | child
|
||||
is_inclusive: predicate
|
||||
|
||||
# Index {
|
||||
@@ -398,8 +398,8 @@ class Range(Expr):
|
||||
|
||||
|
||||
class Index(Expr):
|
||||
base: Expr
|
||||
index: Expr
|
||||
base: Expr | child
|
||||
index: Expr | child
|
||||
is_assignee_expr: predicate
|
||||
|
||||
# Closure {
|
||||
@@ -413,10 +413,10 @@ class Index(Expr):
|
||||
|
||||
|
||||
class Closure(Expr):
|
||||
args: list[Pat]
|
||||
arg_types: list[optional[TypeRef]]
|
||||
ret_type: optional[TypeRef]
|
||||
body: Expr
|
||||
args: list[Pat] | child
|
||||
arg_types: list[optional[TypeRef]] | child
|
||||
ret_type: optional[TypeRef] | child
|
||||
body: Expr | child
|
||||
# TODO
|
||||
# closure_kind: ClosureKind
|
||||
is_move: predicate
|
||||
@@ -427,7 +427,7 @@ class Closure(Expr):
|
||||
|
||||
|
||||
class Tuple(Expr):
|
||||
exprs: list[Expr]
|
||||
exprs: list[Expr] | child
|
||||
is_assignee_expr: predicate
|
||||
|
||||
# Array(Array),
|
||||
@@ -441,15 +441,15 @@ class Array(Expr):
|
||||
|
||||
|
||||
class ElementList(Array):
|
||||
elements: list[Expr]
|
||||
elements: list[Expr] | child
|
||||
is_assignee_expr: predicate
|
||||
|
||||
# Repeat { initializer: ExprId, repeat: ExprId },
|
||||
|
||||
|
||||
class Repeat(Array):
|
||||
initializer: Expr
|
||||
repeat: Expr
|
||||
initializer: Expr | child
|
||||
repeat: Expr | child
|
||||
|
||||
|
||||
class Literal(Expr):
|
||||
@@ -463,14 +463,14 @@ class Underscore(Expr):
|
||||
|
||||
|
||||
class OffsetOf(Expr):
|
||||
container: TypeRef
|
||||
container: TypeRef | child
|
||||
fields: list[string]
|
||||
|
||||
# InlineAsm(InlineAsm),
|
||||
|
||||
|
||||
class InlineAsm(Expr):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
|
||||
|
||||
# Let {
|
||||
@@ -481,10 +481,10 @@ class InlineAsm(Expr):
|
||||
# },
|
||||
|
||||
class IfLet(Stmt):
|
||||
pat: Pat
|
||||
type_ref: optional[TypeRef]
|
||||
initializer: optional[Expr]
|
||||
else_: optional[Expr]
|
||||
pat: Pat | child
|
||||
type_ref: optional[TypeRef] | child
|
||||
initializer: optional[Expr] | child
|
||||
else_: optional[Expr] | child
|
||||
# Expr {
|
||||
# expr: ExprId,
|
||||
# has_semi: bool,
|
||||
@@ -492,7 +492,7 @@ class IfLet(Stmt):
|
||||
|
||||
|
||||
class ExprStmt(Stmt):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
has_semi: predicate
|
||||
|
||||
# // At the moment, we only use this to figure out if a return expression
|
||||
@@ -517,14 +517,14 @@ class WildPat(Pat):
|
||||
|
||||
|
||||
class TuplePat(Pat):
|
||||
args: list[Pat]
|
||||
args: list[Pat] | child
|
||||
ellipsis: optional[int]
|
||||
|
||||
# Or(Box<[PatId]>),
|
||||
|
||||
|
||||
class OrPat(Pat):
|
||||
args: list[Pat]
|
||||
args: list[Pat] | child
|
||||
# Record { path: Option<Box<Path>>, args: Box<[RecordFieldPat]>, ellipsis: bool },
|
||||
|
||||
|
||||
@@ -536,15 +536,15 @@ class RecordPat(Pat):
|
||||
|
||||
|
||||
class RangePat(Pat):
|
||||
start: optional[Pat]
|
||||
end: optional[Pat]
|
||||
start: optional[Pat] | child
|
||||
end: optional[Pat] | child
|
||||
# Slice { prefix: Box<[PatId]>, slice: Option<PatId>, suffix: Box<[PatId]> },
|
||||
|
||||
|
||||
class SlicePat(Pat):
|
||||
prefix: list[Pat]
|
||||
slice: optional[Pat]
|
||||
suffix: list[Pat]
|
||||
prefix: list[Pat] | child
|
||||
slice: optional[Pat] | child
|
||||
suffix: list[Pat] | child
|
||||
# Path(Box<Path>),
|
||||
|
||||
|
||||
@@ -554,14 +554,14 @@ class PathPat(Pat):
|
||||
|
||||
|
||||
class LitPat(Pat):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
|
||||
# Bind { id: BindingId, subpat: Option<PatId> },
|
||||
|
||||
|
||||
class BindPat(Pat):
|
||||
binding_id: string
|
||||
subpat: optional[Pat]
|
||||
subpat: optional[Pat] | child
|
||||
|
||||
# TupleStruct { path: Option<Box<Path>>, args: Box<[PatId]>, ellipsis: Option<u32> },
|
||||
|
||||
@@ -574,16 +574,16 @@ class TupleStructPat(Pat):
|
||||
|
||||
|
||||
class RefPat(Pat):
|
||||
pat: Pat
|
||||
pat: Pat | child
|
||||
is_mut: predicate
|
||||
|
||||
# Box { inner: PatId },
|
||||
|
||||
|
||||
class BoxPat(Pat):
|
||||
inner: Pat
|
||||
inner: Pat | child
|
||||
# ConstBlock(ExprId),
|
||||
|
||||
|
||||
class ConstBlockPat(Pat):
|
||||
expr: Expr
|
||||
expr: Expr | child
|
||||
|
||||
Reference in New Issue
Block a user