Skip to content

Instantly share code, notes, and snippets.

@bannzai
Created January 20, 2019 06:40
Show Gist options
  • Save bannzai/dfc79a80890e523ee193afed9afb7b03 to your computer and use it in GitHub Desktop.
Save bannzai/dfc79a80890e523ee193afed9afb7b03 to your computer and use it in GitHub Desktop.
with default argument
{
"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": "TestFunctionDeclDefaultArgument"
},
"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": "multipleArgument"
},
"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": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
null
],
"presence": "Present"
},
null,
{
"kind": "InitializerClause",
"layout": [
{
"tokenKind": {
"kind": "equal"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"kind": "IntegerLiteralExpr",
"layout": [
{
"tokenKind": {
"kind": "integer_literal",
"text": "1"
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
{
"tokenKind": {
"kind": "comma"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
}
],
"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": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
null
],
"presence": "Present"
},
null,
{
"kind": "InitializerClause",
"layout": [
{
"tokenKind": {
"kind": "equal"
},
"leadingTrivia": [],
"trailingTrivia": [
{
"kind": "Space",
"value": 1
}
],
"presence": "Present"
},
{
"kind": "StringLiteralExpr",
"layout": [
{
"tokenKind": {
"kind": "string_literal",
"text": "\"string\""
},
"leadingTrivia": [],
"trailingTrivia": [],
"presence": "Present"
}
],
"presence": "Present"
}
],
"presence": "Present"
},
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 TestFunctionDeclDefaultArgument {
func multipleArgument(argument1: Int = 1, argument2: String = "string") {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment