From b65f49bd50eed1828f81eab3d9bb2432c7bc4d83 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 20 Oct 2022 10:46:12 +0200 Subject: [PATCH] Swift: document `introducer_int` --- swift/codegen/generators/qlgen.py | 1 + swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll | 3 ++- swift/schema.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/swift/codegen/generators/qlgen.py b/swift/codegen/generators/qlgen.py index 1d1adabe864..2ff616dbc9e 100755 --- a/swift/codegen/generators/qlgen.py +++ b/swift/codegen/generators/qlgen.py @@ -62,6 +62,7 @@ abbreviations = { "decl": "declaration", "repr": "representation", "param": "parameter", + "int": "integer", } abbreviations.update({f"{k}s": f"{v}s" for k, v in abbreviations.items()}) diff --git a/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll index afcfe86acdd..f97263defe8 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll @@ -8,7 +8,8 @@ module Generated { override string getAPrimaryQlClass() { result = "ConcreteVarDecl" } /** - * Gets the introducer int of this concrete var declaration. + * Gets the introducer enumeration value. + * This is 0 if the variable was introduced with `let` and 1 if it was introduced with `var`. */ int getIntroducerInt() { result = Synth::convertConcreteVarDeclToRaw(this).(Raw::ConcreteVarDecl).getIntroducerInt() diff --git a/swift/schema.py b/swift/schema.py index 101eb97dd62..3ccc2ea7dae 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -200,7 +200,9 @@ class ConcreteFuncDecl(FuncDecl): pass class ConcreteVarDecl(VarDecl): - introducer_int: int + introducer_int: int | doc("introducer enumeration value") | desc(""" + This is 0 if the variable was introduced with `let` and 1 if it was introduced with `var`. + """) class GenericTypeParamDecl(AbstractTypeParamDecl): pass