mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Parameters (to methods, initializers, accessors, subscripts, etc) have always been represented
as Pattern's (of a particular sort), stemming from an early design direction that was abandoned.
Being built on top of patterns leads to patterns being overly complicated (e.g. tuple patterns
have to have varargs and default parameters) and make working on parameter lists complicated
and error prone. This might have been ok in 2015, but there is no way we can live like this in
2016.
Instead of using Patterns, carve out a new ParameterList and Parameter type to represent all the
parameter specific stuff. This simplifies many things and allows a lot of simplifications.
Unfortunately, I wasn't able to do this very incrementally, so this is a huge patch. The good
news is that it erases a ton of code, and the technical debt that went with it. Ignoring test
suite changes, we have:
77 files changed, 2359 insertions(+), 3221 deletions(-)
This patch also makes a bunch of wierd things dead, but I'll sweep those out in follow-on
patches.
Fixes <rdar://problem/22846558> No code completions in Foo( when Foo has error type
Fixes <rdar://problem/24026538> Slight regression in generated header, which I filed to go with 3a23d75.
Fixes an overloading bug involving default arguments and curried functions (see the diff to
Constraints/diagnostics.swift, which we now correctly accept).
Fixes cases where problems with parameters would get emitted multiple times, e.g. in the
test/Parse/subscripting.swift testcase.
The source range for ParamDecl now includes its type, which permutes some of the IDE / SourceModel tests
(for the better, I think).
Eliminates the bogus "type annotation missing in pattern" error message when a type isn't
specified for a parameter (see test/decl/func/functions.swift).
This now consistently parenthesizes argument lists in function types, which leads to many diffs in the
SILGen tests among others.
This does break the "sibling indentation" test in SourceKit/CodeFormat/indent-sibling.swift, and
I haven't been able to figure it out. Given that this is experimental functionality anyway,
I'm just XFAILing the test for now. i'll look at it separately from this mongo diff.
995 lines
28 KiB
Plaintext
995 lines
28 KiB
Plaintext
{
|
|
key.offset: 0,
|
|
key.length: 1506,
|
|
key.diagnostic_stage: source.diagnostic.stage.swift.parse,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "Foo",
|
|
key.offset: 0,
|
|
key.length: 173,
|
|
key.runtime_name: "_TtC13StructureTest3Foo",
|
|
key.nameoffset: 6,
|
|
key.namelength: 3,
|
|
key.bodyoffset: 17,
|
|
key.bodylength: 155,
|
|
key.inheritedtypes: [
|
|
{
|
|
key.name: "Bar"
|
|
}
|
|
],
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.typeref,
|
|
key.offset: 12,
|
|
key.length: 3
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.setter_accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "test",
|
|
key.offset: 22,
|
|
key.length: 14,
|
|
key.typename: "Int",
|
|
key.nameoffset: 26,
|
|
key.namelength: 4
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.setter_accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testOutlet",
|
|
key.offset: 51,
|
|
key.length: 20,
|
|
key.typename: "Int",
|
|
key.nameoffset: 55,
|
|
key.namelength: 10,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.iboutlet
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testMethod()",
|
|
key.offset: 77,
|
|
key.length: 53,
|
|
key.nameoffset: 82,
|
|
key.namelength: 12,
|
|
key.bodyoffset: 96,
|
|
key.bodylength: 33,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.if,
|
|
key.offset: 105,
|
|
key.length: 19,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 108,
|
|
key.length: 4
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 113,
|
|
key.length: 11,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 114,
|
|
key.bodylength: 9
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testAction()",
|
|
key.offset: 146,
|
|
key.length: 25,
|
|
key.selector_name: "testAction",
|
|
key.nameoffset: 151,
|
|
key.namelength: 12,
|
|
key.bodyoffset: 165,
|
|
key.bodylength: 5,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.ibaction
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "Foo2",
|
|
key.offset: 189,
|
|
key.length: 13,
|
|
key.runtime_name: "_TtC13StructureTest4Foo2",
|
|
key.nameoffset: 195,
|
|
key.namelength: 4,
|
|
key.bodyoffset: 201,
|
|
key.bodylength: 0,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.ibdesignable
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "Foo3",
|
|
key.offset: 204,
|
|
key.length: 59,
|
|
key.runtime_name: "_TtC13StructureTest4Foo3",
|
|
key.nameoffset: 210,
|
|
key.namelength: 4,
|
|
key.bodyoffset: 216,
|
|
key.bodylength: 46,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.setter_accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testInspectable",
|
|
key.offset: 236,
|
|
key.length: 25,
|
|
key.typename: "Int",
|
|
key.nameoffset: 240,
|
|
key.namelength: 15,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.ibinspectable
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.protocol,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "MyProt",
|
|
key.offset: 265,
|
|
key.length: 18,
|
|
key.runtime_name: "_TtP13StructureTest6MyProt_",
|
|
key.nameoffset: 274,
|
|
key.namelength: 6,
|
|
key.bodyoffset: 282,
|
|
key.bodylength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "OuterCls",
|
|
key.offset: 285,
|
|
key.length: 41,
|
|
key.runtime_name: "_TtC13StructureTest8OuterCls",
|
|
key.nameoffset: 291,
|
|
key.namelength: 8,
|
|
key.bodyoffset: 301,
|
|
key.bodylength: 24,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "InnerCls1",
|
|
key.offset: 306,
|
|
key.length: 18,
|
|
key.nameoffset: 312,
|
|
key.namelength: 9,
|
|
key.bodyoffset: 323,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.extension,
|
|
key.name: "OuterCls",
|
|
key.offset: 328,
|
|
key.length: 45,
|
|
key.nameoffset: 338,
|
|
key.namelength: 8,
|
|
key.bodyoffset: 348,
|
|
key.bodylength: 24,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "InnerCls2",
|
|
key.offset: 353,
|
|
key.length: 18,
|
|
key.nameoffset: 359,
|
|
key.namelength: 9,
|
|
key.bodyoffset: 370,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "GenCls",
|
|
key.offset: 375,
|
|
key.length: 23,
|
|
key.nameoffset: 381,
|
|
key.namelength: 6,
|
|
key.bodyoffset: 397,
|
|
key.bodylength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "TestParamAndCall",
|
|
key.offset: 400,
|
|
key.length: 212,
|
|
key.runtime_name: "_TtC13StructureTest16TestParamAndCall",
|
|
key.nameoffset: 406,
|
|
key.namelength: 16,
|
|
key.bodyoffset: 424,
|
|
key.bodylength: 187,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testParams(_:name:)",
|
|
key.offset: 429,
|
|
key.length: 120,
|
|
key.nameoffset: 434,
|
|
key.namelength: 35,
|
|
key.bodyoffset: 471,
|
|
key.bodylength: 77,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "arg1",
|
|
key.offset: 445,
|
|
key.length: 9,
|
|
key.typename: "Int",
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "name",
|
|
key.offset: 456,
|
|
key.length: 12,
|
|
key.typename: "String",
|
|
key.nameoffset: 456,
|
|
key.namelength: 4
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.if,
|
|
key.offset: 480,
|
|
key.length: 63,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 483,
|
|
key.length: 6
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 490,
|
|
key.length: 53,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 491,
|
|
key.bodylength: 51,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.expr.call,
|
|
key.name: "testParams",
|
|
key.offset: 504,
|
|
key.length: 29,
|
|
key.nameoffset: 504,
|
|
key.namelength: 10,
|
|
key.bodyoffset: 515,
|
|
key.bodylength: 17,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.offset: 515,
|
|
key.length: 1,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 515,
|
|
key.bodylength: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "name",
|
|
key.offset: 518,
|
|
key.length: 14,
|
|
key.nameoffset: 518,
|
|
key.namelength: 4,
|
|
key.bodyoffset: 523,
|
|
key.bodylength: 9
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "testParamAndArg(_:param:)",
|
|
key.offset: 555,
|
|
key.length: 55,
|
|
key.nameoffset: 560,
|
|
key.namelength: 42,
|
|
key.bodyoffset: 604,
|
|
key.bodylength: 5,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "arg1",
|
|
key.offset: 576,
|
|
key.length: 9,
|
|
key.typename: "Int",
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "par",
|
|
key.offset: 587,
|
|
key.length: 14,
|
|
key.typename: "Int",
|
|
key.nameoffset: 587,
|
|
key.namelength: 5
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.comment.mark,
|
|
key.offset: 617,
|
|
key.length: 16,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "TestMarkers",
|
|
key.offset: 635,
|
|
key.length: 206,
|
|
key.runtime_name: "_TtC13StructureTest11TestMarkers",
|
|
key.nameoffset: 641,
|
|
key.namelength: 11,
|
|
key.bodyoffset: 654,
|
|
key.bodylength: 186,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.__raw_doc_comment
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.comment.mark,
|
|
key.offset: 662,
|
|
key.length: 16,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "test(_:)",
|
|
key.offset: 683,
|
|
key.length: 156,
|
|
key.nameoffset: 688,
|
|
key.namelength: 16,
|
|
key.bodyoffset: 713,
|
|
key.bodylength: 125,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.__raw_doc_comment
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "arg1",
|
|
key.offset: 693,
|
|
key.length: 10,
|
|
key.typename: "Bool",
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.comment.mark,
|
|
key.offset: 725,
|
|
key.length: 12,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.if,
|
|
key.offset: 746,
|
|
key.length: 70,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 749,
|
|
key.length: 6
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 756,
|
|
key.length: 60,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 757,
|
|
key.bodylength: 58,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.comment.mark,
|
|
key.offset: 773,
|
|
key.length: 12,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.free,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "test2(_:)",
|
|
key.offset: 843,
|
|
key.length: 105,
|
|
key.nameoffset: 848,
|
|
key.namelength: 17,
|
|
key.bodyoffset: 867,
|
|
key.bodylength: 80,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "arg1",
|
|
key.offset: 854,
|
|
key.length: 10,
|
|
key.typename: "Bool",
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.if,
|
|
key.offset: 872,
|
|
key.length: 74,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 875,
|
|
key.length: 6
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 882,
|
|
key.length: 64,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 883,
|
|
key.bodylength: 62,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.syntaxtype.comment.mark,
|
|
key.offset: 911,
|
|
key.length: 29,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.extension,
|
|
key.name: "Foo",
|
|
key.offset: 950,
|
|
key.length: 58,
|
|
key.nameoffset: 960,
|
|
key.namelength: 3,
|
|
key.bodyoffset: 965,
|
|
key.bodylength: 42,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "anExtendedFooFunction()",
|
|
key.offset: 970,
|
|
key.length: 36,
|
|
key.nameoffset: 975,
|
|
key.namelength: 23,
|
|
key.bodyoffset: 1000,
|
|
key.bodylength: 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.global,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.setter_accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "Qtys",
|
|
key.offset: 1030,
|
|
key.length: 15,
|
|
key.typename: "Qtys",
|
|
key.nameoffset: 1040,
|
|
key.namelength: 4,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.__raw_doc_comment
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.function.free,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.offset: 1046,
|
|
key.length: 17,
|
|
key.nameoffset: 1046,
|
|
key.namelength: 1,
|
|
key.bodyoffset: 1047,
|
|
key.bodylength: 15,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.expr.call,
|
|
key.name: "417",
|
|
key.offset: 1050,
|
|
key.length: 11,
|
|
key.nameoffset: 1050,
|
|
key.namelength: 3,
|
|
key.bodyoffset: 1054,
|
|
key.bodylength: 6,
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.var.parameter,
|
|
key.name: "d",
|
|
key.offset: 1054,
|
|
key.length: 6,
|
|
key.nameoffset: 1054,
|
|
key.namelength: 1,
|
|
key.bodyoffset: 1057,
|
|
key.bodylength: 3
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.foreach,
|
|
key.offset: 1065,
|
|
key.length: 17,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.id,
|
|
key.offset: 1069,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1074,
|
|
key.length: 5
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 1080,
|
|
key.length: 2,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1081,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.for,
|
|
key.offset: 1083,
|
|
key.length: 37,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.init_expr,
|
|
key.offset: 1087,
|
|
key.length: 17
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1106,
|
|
key.length: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1114,
|
|
key.length: 3
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 1118,
|
|
key.length: 2,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1119,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.while,
|
|
key.offset: 1121,
|
|
key.length: 37,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 1127,
|
|
key.length: 28
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 1156,
|
|
key.length: 2,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1157,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.repeatwhile,
|
|
key.offset: 1159,
|
|
key.length: 22,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1175,
|
|
key.length: 6
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 1166,
|
|
key.length: 2,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1167,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.if,
|
|
key.offset: 1182,
|
|
key.length: 34,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.condition_expr,
|
|
key.offset: 1185,
|
|
key.length: 28
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.brace,
|
|
key.offset: 1214,
|
|
key.length: 2,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1215,
|
|
key.bodylength: 0
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.switch,
|
|
key.offset: 1217,
|
|
key.length: 67,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1224,
|
|
key.length: 1
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.stmt.case,
|
|
key.offset: 1230,
|
|
key.length: 14,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.pattern,
|
|
key.offset: 1235,
|
|
key.length: 1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.case,
|
|
key.offset: 1247,
|
|
key.length: 17,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.pattern,
|
|
key.offset: 1252,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.pattern,
|
|
key.offset: 1255,
|
|
key.length: 1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.stmt.case,
|
|
key.offset: 1267,
|
|
key.length: 15,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.pattern,
|
|
key.offset: 1267,
|
|
key.length: 7
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.global,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "myArray",
|
|
key.offset: 1286,
|
|
key.length: 23,
|
|
key.typename: "myArray",
|
|
key.nameoffset: 1290,
|
|
key.namelength: 7
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.expr.array,
|
|
key.offset: 1300,
|
|
key.length: 9,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1301,
|
|
key.bodylength: 7,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1301,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1304,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1307,
|
|
key.length: 1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.var.global,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "myDict",
|
|
key.offset: 1310,
|
|
key.length: 28,
|
|
key.typename: "myDict",
|
|
key.nameoffset: 1314,
|
|
key.namelength: 6
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.expr.dictionary,
|
|
key.offset: 1323,
|
|
key.length: 15,
|
|
key.nameoffset: 0,
|
|
key.namelength: 0,
|
|
key.bodyoffset: 1324,
|
|
key.bodylength: 13,
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1324,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1326,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1329,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1331,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1334,
|
|
key.length: 1
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.expr,
|
|
key.offset: 1336,
|
|
key.length: 1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "ClassObjcAttr",
|
|
key.offset: 1365,
|
|
key.length: 60,
|
|
key.runtime_name: "_TtC13StructureTest13ClassObjcAttr",
|
|
key.nameoffset: 1371,
|
|
key.namelength: 13,
|
|
key.bodyoffset: 1397,
|
|
key.bodylength: 27,
|
|
key.inheritedtypes: [
|
|
{
|
|
key.name: "NSObject"
|
|
}
|
|
],
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.objc
|
|
},
|
|
{
|
|
key.attribute: source.decl.attribute.__raw_doc_comment
|
|
}
|
|
],
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.typeref,
|
|
key.offset: 1387,
|
|
key.length: 8
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "m()",
|
|
key.offset: 1412,
|
|
key.length: 11,
|
|
key.nameoffset: 1417,
|
|
key.namelength: 3,
|
|
key.bodyoffset: 1422,
|
|
key.bodylength: 0,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.objc
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
key.kind: source.lang.swift.decl.class,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "ClassObjcAttr2",
|
|
key.offset: 1439,
|
|
key.length: 66,
|
|
key.runtime_name: "Blah",
|
|
key.nameoffset: 1445,
|
|
key.namelength: 14,
|
|
key.bodyoffset: 1472,
|
|
key.bodylength: 32,
|
|
key.inheritedtypes: [
|
|
{
|
|
key.name: "NSObject"
|
|
}
|
|
],
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.objc.name
|
|
}
|
|
],
|
|
key.elements: [
|
|
{
|
|
key.kind: source.lang.swift.structure.elem.typeref,
|
|
key.offset: 1462,
|
|
key.length: 8
|
|
}
|
|
],
|
|
key.substructure: [
|
|
{
|
|
key.kind: source.lang.swift.decl.function.method.instance,
|
|
key.accessibility: source.lang.swift.accessibility.internal,
|
|
key.name: "m()",
|
|
key.offset: 1492,
|
|
key.length: 11,
|
|
key.nameoffset: 1497,
|
|
key.namelength: 3,
|
|
key.bodyoffset: 1502,
|
|
key.bodylength: 0,
|
|
key.attributes: [
|
|
{
|
|
key.attribute: source.decl.attribute.objc.name
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
key.diagnostics: [
|
|
{
|
|
key.line: 70,
|
|
key.column: 5,
|
|
key.filepath: main.swift,
|
|
key.severity: source.diagnostic.severity.error,
|
|
key.description: "getter/setter can only be defined for a single variable",
|
|
key.diagnostic_stage: source.diagnostic.stage.swift.parse
|
|
}
|
|
]
|
|
}
|