add `__str__` methods on type structures to improve readability of diagnostics
1468 lines
26 KiB
JSON
1468 lines
26 KiB
JSON
{
|
|
"diagnostics": [
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
},
|
|
"message": "Missing required positional arguments: 'a' and 'b'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
11
|
|
]
|
|
},
|
|
"message": "Missing required positional argument: 'b'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
11
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
7,
|
|
5
|
|
],
|
|
"end": [
|
|
7,
|
|
16
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
8,
|
|
5
|
|
],
|
|
"end": [
|
|
8,
|
|
18
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
9,
|
|
17
|
|
],
|
|
"end": [
|
|
9,
|
|
23
|
|
]
|
|
},
|
|
"message": "Too many positional arguments"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
9,
|
|
5
|
|
],
|
|
"end": [
|
|
9,
|
|
24
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
10,
|
|
19
|
|
],
|
|
"end": [
|
|
10,
|
|
22
|
|
]
|
|
},
|
|
"message": "Multiple values for argument 'b'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
10,
|
|
5
|
|
],
|
|
"end": [
|
|
10,
|
|
23
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
11,
|
|
11
|
|
],
|
|
"end": [
|
|
11,
|
|
12
|
|
]
|
|
},
|
|
"message": "Unknown keyword argument 'a'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
11,
|
|
5
|
|
],
|
|
"end": [
|
|
11,
|
|
13
|
|
]
|
|
},
|
|
"message": "Missing required positional arguments: 'a' and 'b'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
11,
|
|
5
|
|
],
|
|
"end": [
|
|
11,
|
|
13
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
12,
|
|
11
|
|
],
|
|
"end": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
"message": "Unknown keyword argument 'g'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
12,
|
|
5
|
|
],
|
|
"end": [
|
|
12,
|
|
18
|
|
]
|
|
},
|
|
"message": "Missing required positional arguments: 'a' and 'b'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
12,
|
|
5
|
|
],
|
|
"end": [
|
|
12,
|
|
18
|
|
]
|
|
},
|
|
"message": "Missing required keyword argument: 'c'"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
18,
|
|
10
|
|
],
|
|
"end": [
|
|
18,
|
|
13
|
|
]
|
|
},
|
|
"message": "Wrong type for argument 'a', expected int, got str"
|
|
},
|
|
{
|
|
"type": "Error",
|
|
"location": {
|
|
"start": [
|
|
18,
|
|
20
|
|
],
|
|
"end": [
|
|
18,
|
|
25
|
|
]
|
|
},
|
|
"message": "Wrong type for argument 'c', expected str, got bool"
|
|
}
|
|
],
|
|
"judgments": [
|
|
{
|
|
"location": {
|
|
"from": "L5:5",
|
|
"to": "L5:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L5:5",
|
|
"to": "L5:10"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [],
|
|
"keywords": {}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L6:5",
|
|
"to": "L6:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L6:9",
|
|
"to": "L6:10"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L6:5",
|
|
"to": "L6:11"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
}
|
|
],
|
|
"keywords": {}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L7:5",
|
|
"to": "L7:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L7:9",
|
|
"to": "L7:10"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L7:12",
|
|
"to": "L7:15"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L7:5",
|
|
"to": "L7:16"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
}
|
|
],
|
|
"keywords": {}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L8:5",
|
|
"to": "L8:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L8:9",
|
|
"to": "L8:10"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L8:14",
|
|
"to": "L8:17"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L8:5",
|
|
"to": "L8:18"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
}
|
|
],
|
|
"keywords": {
|
|
"b": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L9:5",
|
|
"to": "L9:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L9:9",
|
|
"to": "L9:10"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L9:12",
|
|
"to": "L9:15"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L9:17",
|
|
"to": "L9:23"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L9:5",
|
|
"to": "L9:24"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
}
|
|
],
|
|
"keywords": {}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L10:5",
|
|
"to": "L10:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L10:9",
|
|
"to": "L10:10"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L10:12",
|
|
"to": "L10:15"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L10:19",
|
|
"to": "L10:22"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 3.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L10:5",
|
|
"to": "L10:23"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
}
|
|
],
|
|
"keywords": {
|
|
"b": {
|
|
"_type": "LiteralExpr",
|
|
"value": 3.0
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L11:5",
|
|
"to": "L11:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L11:11",
|
|
"to": "L11:12"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L11:5",
|
|
"to": "L11:13"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [],
|
|
"keywords": {
|
|
"a": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L12:5",
|
|
"to": "L12:8"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L12:11",
|
|
"to": "L12:17"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L12:5",
|
|
"to": "L12:18"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [],
|
|
"keywords": {
|
|
"g": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L14:6",
|
|
"to": "L14:9"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L14:10",
|
|
"to": "L14:11"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L14:13",
|
|
"to": "L14:16"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L14:20",
|
|
"to": "L14:26"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L14:6",
|
|
"to": "L14:27"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
}
|
|
],
|
|
"keywords": {
|
|
"c": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L15:6",
|
|
"to": "L15:9"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L15:10",
|
|
"to": "L15:11"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L15:15",
|
|
"to": "L15:18"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L15:22",
|
|
"to": "L15:28"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L15:6",
|
|
"to": "L15:29"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
}
|
|
],
|
|
"keywords": {
|
|
"b": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"c": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L16:6",
|
|
"to": "L16:9"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L16:10",
|
|
"to": "L16:11"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L16:15",
|
|
"to": "L16:21"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L16:25",
|
|
"to": "L16:28"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
},
|
|
"type": {
|
|
"name": "float"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L16:6",
|
|
"to": "L16:29"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 1
|
|
}
|
|
],
|
|
"keywords": {
|
|
"c": {
|
|
"_type": "LiteralExpr",
|
|
"value": "test"
|
|
},
|
|
"b": {
|
|
"_type": "LiteralExpr",
|
|
"value": 2.0
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L18:6",
|
|
"to": "L18:9"
|
|
},
|
|
"expr": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"type": {
|
|
"name": "foo",
|
|
"pos_args": [
|
|
{
|
|
"pos": 0,
|
|
"name": "a",
|
|
"type": {
|
|
"name": "int"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"args": [
|
|
{
|
|
"pos": 1,
|
|
"name": "b",
|
|
"type": {
|
|
"name": "float"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"kw_args": [
|
|
{
|
|
"pos": 2,
|
|
"name": "c",
|
|
"type": {
|
|
"name": "str"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"returns": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L18:10",
|
|
"to": "L18:13"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": "a"
|
|
},
|
|
"type": {
|
|
"name": "str"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L18:15",
|
|
"to": "L18:16"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": 3
|
|
},
|
|
"type": {
|
|
"name": "int"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L18:20",
|
|
"to": "L18:25"
|
|
},
|
|
"expr": {
|
|
"_type": "LiteralExpr",
|
|
"value": false
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
},
|
|
{
|
|
"location": {
|
|
"from": "L18:6",
|
|
"to": "L18:26"
|
|
},
|
|
"expr": {
|
|
"_type": "CallExpr",
|
|
"callee": {
|
|
"_type": "VariableExpr",
|
|
"name": "foo"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": "a"
|
|
},
|
|
{
|
|
"_type": "LiteralExpr",
|
|
"value": 3
|
|
}
|
|
],
|
|
"keywords": {
|
|
"c": {
|
|
"_type": "LiteralExpr",
|
|
"value": false
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"name": "bool"
|
|
}
|
|
}
|
|
]
|
|
} |