Skip to content

Instantly share code, notes, and snippets.

@bannzai
Last active January 20, 2019 07:40
Show Gist options
  • Save bannzai/0fae75994c61d9ecf8cfb440de003515 to your computer and use it in GitHub Desktop.
Save bannzai/0fae75994c61d9ecf8cfb440de003515 to your computer and use it in GitHub Desktop.
swift-syntax-output
{
"kind": "SourceFile",
"layout": [
{
"kind": "CodeBlockItemList",
"layout": [
{
"kind": "CodeBlockItem",
"layout": [
{
"kind": "ImportDecl",
"layout": [
null,
null,
{
"tokenKind": {
"kind": "kw_import"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
null,
{
"kind": "AccessPath",
"layout": [
{
"kind": "AccessPathComponent",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "Foundation"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null
],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
null
],
"presence": "Present"
},
{
"kind": "CodeBlockItem",
"layout": [
{
"kind": "ClassDecl",
"layout": [
null,
{
"kind": "ModifierList",
"layout": [
{
"kind": "DeclModifier",
"layout": [
{
"tokenKind": {
"kind": "kw_public"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 2
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"kind": "TokenList",
"layout": [],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "kw_class"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "identifier",
"text": "TestFunctionDeclNoReturn"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
null,
null,
null,
{
"kind": "MemberDeclBlock",
"layout": [
{
"tokenKind": {
"kind": "l_brace"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
{
"kind": "DeclList",
"layout": [
{
"kind": "FunctionDecl",
"layout": [
null,
null,
{
"tokenKind": {
"kind": "kw_func"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
},
{
"kind": "Space",
"value": 4
}
],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "identifier",
"text": "twoArgumentNoReturn"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null,
{
"kind": "FunctionSignature",
"layout": [
{
"kind": "ParameterClause",
"layout": [
{
"tokenKind": {
"kind": "l_paren"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
{
"kind": "FunctionParameterList",
"layout": [
{
"kind": "FunctionParameter",
"layout": [
null,
{
"tokenKind": {
"kind": "identifier",
"text": "argument1"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null,
{
"tokenKind": {
"kind": "colon"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"kind": "SimpleTypeIdentifier",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "Int"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "comma"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
null,
null
],
"presence": "Present"
},
{
"kind": "FunctionParameter",
"layout": [
null,
{
"tokenKind": {
"kind": "identifier",
"text": "argument2"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null,
{
"tokenKind": {
"kind": "colon"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"kind": "SimpleTypeIdentifier",
"layout": [
{
"tokenKind": {
"kind": "identifier",
"text": "String"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
null
],
"presence": "Present"
},
null,
null,
null
],
"presence": "Present"
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "r_paren"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
}
],
"presence": "Present"
},
null,
null
],
"presence": "Present"
},
null,
{
"kind": "CodeBlock",
"layout": [
{
"tokenKind": {
"kind": "l_brace"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
},
{
"kind": "CodeBlockItemList",
"layout": [],
"presence": "Present"
},
{
"tokenKind": {
"kind": "r_brace"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
},
{
"kind": "Space",
"value": 8
},
{
"kind": "Newline",
"value": 1
},
{
"kind": "Space",
"value": 4
}
],
"trailingTrivia": [],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "r_brace"
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
}
],
"trailingTrivia": [],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
null
],
"presence": "Present"
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "eof",
"text": ""
},
"leadingTrivia": [
{
"kind": "Newline",
"value": 1
}
],
"trailingTrivia": [],
"presence": "Present"
}
],
"presence": "Present"
}
import Foundation
public class TestFunctionDeclNoReturn {
func twoArgumentNoReturn(argument1: Int, argument2: String) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment