Files
swift-mirror/test/Syntax/Inputs/serialize_struct_decl.json
Alex Hoppen 9d59cd286b [incrParse] Add a stable id to the syntax nodes
The id is meant to be stable across incremental parses
2018-07-13 16:56:03 -07:00

446 lines
20 KiB
JSON

{
"kind": "SourceFile",
"layout": [
{
"kind": "CodeBlockItemList",
"layout": [
{
"kind": "CodeBlockItem",
"layout": [
{
"kind": "StructDecl",
"layout": [
null,
null,
{
"tokenKind": {
"kind": "kw_struct"
},
"leadingTrivia": [
{
"kind": "LineComment",
"value": "\/\/ RUN: %swift-syntax-test -input-source-filename %s -serialize-raw-tree > %t"
},
{
"kind": "Newline",
"value": 1
},
{
"kind": "LineComment",
"value": "\/\/ RUN: diff %t %S\/Inputs\/serialize_struct_decl.json -u"
},
{
"kind": "Newline",
"value": 2
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 1
},
{
"tokenKind": {
"kind": "identifier",
"text": "Foo"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 2
},
null,
null,
null,
{
"kind": "MemberDeclBlock",
"layout": [
{
"tokenKind": {
"kind": "l_brace"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present",
"id": 3
},
{
"kind": "MemberDeclList",
"layout": [
{
"kind": "MemberDeclListItem",
"layout": [
{
"kind": "VariableDecl",
"layout": [
null,
null,
{
"tokenKind": {
"kind": "kw_let"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
},
{
"kind": "Space",
"value": 2
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 3
}
],
"presence": "Present",
"id": 4
},
{
"kind": "PatternBindingList",
"layout": [
{
"kind": "PatternBinding",
"layout": [
{
"kind": "IdentifierPattern",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "bar"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 5
}
],
"presence": "Present",
"id": 6
},
{
"kind": "TypeAnnotation",
"layout": [
{
"tokenKind": {
"kind": "colon"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 7
},
{
"kind": "SimpleTypeIdentifier",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "Int"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present",
"id": 8
},
null
],
"presence": "Present",
"id": 9
}
],
"presence": "Present",
"id": 10
},
null,
null,
null
],
"presence": "Present",
"id": 11
}
],
"presence": "Present",
"id": 12
}
],
"presence": "Present",
"id": 13
},
null
],
"presence": "Present",
"id": 14
},
{
"kind": "MemberDeclListItem",
"layout": [
{
"kind": "VariableDecl",
"layout": [
null,
null,
{
"tokenKind": {
"kind": "kw_let"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 2
},
{
"kind": "Space",
"value": 2
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 15
},
{
"kind": "PatternBindingList",
"layout": [
{
"kind": "PatternBinding",
"layout": [
{
"kind": "IdentifierPattern",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "baz"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 16
}
],
"presence": "Present",
"id": 17
},
{
"kind": "TypeAnnotation",
"layout": [
{
"tokenKind": {
"kind": "colon"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 18
},
{
"kind": "SimpleTypeIdentifier",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "Array"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 19
},
{
"kind": "GenericArgumentClause",
"layout": [
{
"tokenKind": {
"kind": "l_angle"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 20
},
{
"kind": "GenericArgumentList",
"layout": [
{
"kind": "GenericArgument",
"layout": [
{
"kind": "SimpleTypeIdentifier",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "Int"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present",
"id": 21
},
null
],
"presence": "Present",
"id": 22
},
null
],
"presence": "Present",
"id": 23
}
],
"presence": "Present",
"id": 24
},
{
"tokenKind": {
"kind": "r_angle"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present",
"id": 25
}
],
"presence": "Present",
"id": 26
}
],
"presence": "Present",
"id": 27
}
],
"presence": "Present",
"id": 28
},
null,
null,
null
],
"presence": "Present",
"id": 29
}
],
"presence": "Present",
"id": 30
}
],
"presence": "Present",
"id": 31
},
null
],
"presence": "Present",
"id": 32
}
],
"presence": "Present",
"id": 33
},
{
"tokenKind": {
"kind": "r_brace"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
},
{
"kind": "Space",
"value": 6
}
],
"trailingTrivia": [],
"presence": "Present",
"id": 34
}
],
"presence": "Present",
"id": 35
}
],
"presence": "Present",
"id": 36
},
null,
null
],
"presence": "Present",
"id": 37
}
],
"presence": "Present",
"id": 40
},
{
"tokenKind": {
"kind": "eof",
"text": ""
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
}
],
"trailingTrivia": [],
"presence": "Present",
"id": 39
}
],
"presence": "Present",
"id": 41
}