Skip to content

Commit

Permalink
add support for intersection type and parenthesized type
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Jul 23, 2017
1 parent 9598efd commit 598fb2b
Show file tree
Hide file tree
Showing 6 changed files with 372 additions and 258 deletions.
191 changes: 163 additions & 28 deletions demo/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,41 @@
{
"kind": "object",
"name": "RequestProtocol",
"members": [],
"isEntry": true
"members": [
{
"name": "requestId",
"type": "number",
"optional": false,
"tag": 1
},
{
"name": "kind",
"type": {
"kind": "enum",
"type": "string",
"enums": [
"search logs",
"search samples",
"resave failed logs"
]
},
"optional": false,
"tag": 2
},
{
"name": "searchLogs",
"type": "SearchLogs",
"optional": true,
"tag": 3
},
{
"name": "searchSamples",
"type": "SearchSamples",
"optional": true,
"tag": 4
}
],
"entry": "request-protocol"
},
{
"kind": "object",
Expand Down Expand Up @@ -79,8 +112,7 @@
"optional": false,
"tag": 5
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand All @@ -98,8 +130,7 @@
"optional": false,
"tag": 2
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand Down Expand Up @@ -154,8 +185,7 @@
"optional": true,
"tag": 6
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand All @@ -173,29 +203,139 @@
"kind": "array",
"element": "Flow"
},
"optional": true,
"optional": false,
"tag": 2
}
],
"isEntry": false
]
},
{
"kind": "object",
"name": "SearchLogsResult",
"members": [],
"isEntry": false
"members": [
{
"name": "requestId",
"type": "number",
"optional": false,
"tag": 1
},
{
"name": "kind",
"type": {
"kind": "enum",
"type": "string",
"enums": [
"success",
"fail"
]
},
"optional": false,
"tag": 2
},
{
"name": "total",
"type": "number",
"optional": true,
"tag": 3
},
{
"name": "logs",
"type": {
"kind": "array",
"element": "Log"
},
"optional": true,
"tag": 4
},
{
"name": "error",
"type": "string",
"optional": true,
"tag": 5
}
]
},
{
"kind": "object",
"name": "SearchSamplesResult",
"members": [],
"isEntry": false
"members": [
{
"name": "requestId",
"type": "number",
"optional": false,
"tag": 1
},
{
"name": "kind",
"type": {
"kind": "enum",
"type": "string",
"enums": [
"success",
"fail"
]
},
"optional": false,
"tag": 2
},
{
"name": "searchSampleResult",
"type": {
"kind": "array",
"element": "SampleFrame"
},
"optional": true,
"tag": 3
},
{
"name": "error",
"type": "string",
"optional": true,
"tag": 4
}
]
},
{
"kind": "object",
"name": "ResaveFailedLogsResult",
"members": [],
"isEntry": false
"members": [
{
"name": "requestId",
"type": "number",
"optional": false,
"tag": 1
},
{
"name": "kind",
"type": {
"kind": "enum",
"type": "string",
"enums": [
"success",
"fail"
]
},
"optional": false,
"tag": 2
},
{
"name": "savedCount",
"type": "number",
"optional": true,
"tag": 3
},
{
"name": "totalCount",
"type": "number",
"optional": true,
"tag": 4
},
{
"name": "error",
"type": "string",
"optional": true,
"tag": 5
}
]
},
{
"kind": "object",
Expand All @@ -216,8 +356,7 @@
"optional": true,
"tag": 2
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand All @@ -229,11 +368,10 @@
"kind": "array",
"element": "Flow"
},
"optional": true,
"optional": false,
"tag": 1
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand Down Expand Up @@ -264,8 +402,7 @@
"optional": true,
"tag": 3
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand Down Expand Up @@ -295,8 +432,7 @@
"optional": false,
"tag": 4
}
],
"isEntry": false
]
},
{
"kind": "object",
Expand Down Expand Up @@ -324,7 +460,6 @@
"optional": false,
"tag": 3
}
],
"isEntry": false
]
}
]

0 comments on commit 598fb2b

Please sign in to comment.