mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-27 19:41:50 +03:00
1189 lines
55 KiB
JSON
1189 lines
55 KiB
JSON
{
|
|
"name": "",
|
|
"expected_input": [],
|
|
"import_statements": [],
|
|
"imports": {},
|
|
"aliases": {},
|
|
"circuits": {},
|
|
"global_consts": {},
|
|
"functions": {
|
|
"{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}": {
|
|
"annotations": [],
|
|
"identifier": "{\"name\":\"main\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}",
|
|
"input": [
|
|
{
|
|
"Variable": {
|
|
"identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":15,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function main(str: [char; 20]) -> bool {\\\"}\"}",
|
|
"const_": false,
|
|
"mutable": true,
|
|
"type_": {
|
|
"Array": [
|
|
"Char",
|
|
[
|
|
{
|
|
"value": "20"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"output": "Boolean",
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Return": {
|
|
"expression": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":12,\\\"col_stop\\\":25,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":26,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return is_palindrome(str);\\\"}\"}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}": {
|
|
"annotations": [],
|
|
"identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":10,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}",
|
|
"input": [
|
|
{
|
|
"Variable": {
|
|
"identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function is_palindrome(str: [char; 20]) -> bool {\\\"}\"}",
|
|
"const_": false,
|
|
"mutable": true,
|
|
"type_": {
|
|
"Array": [
|
|
"Char",
|
|
[
|
|
{
|
|
"value": "20"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"output": "Boolean",
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Const",
|
|
"variable_names": [
|
|
{
|
|
"mutable": false,
|
|
"identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":11,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const str_len = 20u32; // saving const for convenience\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Integer": [
|
|
"U32",
|
|
"20"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":12,\\\"line_stop\\\":12,\\\"col_start\\\":9,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let result = true;\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Boolean": "true"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":13,\\\"line_stop\\\":13,\\\"col_start\\\":9,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let processed = 0u8;\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Integer": [
|
|
"U8",
|
|
"0"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Iteration": {
|
|
"variable": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":9,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}",
|
|
"start": {
|
|
"Value": {
|
|
"Implicit": "0"
|
|
}
|
|
},
|
|
"stop": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":15,\\\"line_stop\\\":15,\\\"col_start\\\":22,\\\"col_stop\\\":29,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for start in 0..(str_len / 2) {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Implicit": "2"
|
|
}
|
|
},
|
|
"op": "Div"
|
|
}
|
|
},
|
|
"inclusive": false,
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":13,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"ArrayAccess": {
|
|
"array": {
|
|
"Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":25,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}"
|
|
},
|
|
"index": {
|
|
"Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":16,\\\"line_stop\\\":16,\\\"col_start\\\":29,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let start_sym = str[start];\\\"}\"}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Conditional": {
|
|
"condition": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":17,\\\"line_stop\\\":17,\\\"col_start\\\":12,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if start_sym != ' ' {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"op": "Ne"
|
|
}
|
|
},
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":18,\\\"line_stop\\\":18,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let skipped = 0u8;\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Integer": [
|
|
"U8",
|
|
"0"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_empty = 0u8;\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Integer": [
|
|
"U8",
|
|
"0"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Definition": {
|
|
"declaration_type": "Let",
|
|
"variable_names": [
|
|
{
|
|
"mutable": true,
|
|
"identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":20,\\\"line_stop\\\":20,\\\"col_start\\\":17,\\\"col_stop\\\":24,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let end_sym = ' ';\\\"}\"}"
|
|
}
|
|
],
|
|
"type_": null,
|
|
"value": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Iteration": {
|
|
"variable": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":17,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}",
|
|
"start": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"str_len\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Implicit": "1"
|
|
}
|
|
},
|
|
"op": "Sub"
|
|
}
|
|
},
|
|
"stop": {
|
|
"Identifier": "{\"name\":\"start\",\"span\":\"{\\\"line_start\\\":22,\\\"line_stop\\\":22,\\\"col_start\\\":39,\\\"col_stop\\\":44,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" for end in (str_len - 1)..start {\\\"}\"}"
|
|
},
|
|
"inclusive": false,
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Conditional": {
|
|
"condition": {
|
|
"Binary": {
|
|
"left": {
|
|
"Binary": {
|
|
"left": {
|
|
"Binary": {
|
|
"left": {
|
|
"ArrayAccess": {
|
|
"array": {
|
|
"Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":20,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}"
|
|
},
|
|
"index": {
|
|
"Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}"
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"op": "Ne"
|
|
}
|
|
},
|
|
"right": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":39,\\\"col_stop\\\":46,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":50,\\\"col_stop\\\":59,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}"
|
|
},
|
|
"op": "Eq"
|
|
}
|
|
},
|
|
"op": "And"
|
|
}
|
|
},
|
|
"right": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":23,\\\"line_stop\\\":23,\\\"col_start\\\":63,\\\"col_stop\\\":70,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' && skipped == processed && end_sym == ' ' {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"op": "Eq"
|
|
}
|
|
},
|
|
"op": "And"
|
|
}
|
|
},
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Assign": {
|
|
"operation": "Assign",
|
|
"assignee": {
|
|
"identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":21,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}",
|
|
"accesses": []
|
|
},
|
|
"value": {
|
|
"ArrayAccess": {
|
|
"array": {
|
|
"Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":31,\\\"col_stop\\\":34,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}"
|
|
},
|
|
"index": {
|
|
"Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":35,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_sym = str[end];\\\"}\"}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"next": {
|
|
"Block": {
|
|
"statements": [
|
|
{
|
|
"Assign": {
|
|
"operation": "Assign",
|
|
"assignee": {
|
|
"identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":21,\\\"col_stop\\\":30,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}",
|
|
"accesses": []
|
|
},
|
|
"value": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"end_empty\",\"span\":\"{\\\"line_start\\\":26,\\\"line_stop\\\":26,\\\"col_start\\\":33,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" end_empty = end_empty + 1;\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Implicit": "1"
|
|
}
|
|
},
|
|
"op": "Add"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Conditional": {
|
|
"condition": {
|
|
"Binary": {
|
|
"left": {
|
|
"ArrayAccess": {
|
|
"array": {
|
|
"Identifier": "{\"name\":\"str\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":24,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}"
|
|
},
|
|
"index": {
|
|
"Identifier": "{\"name\":\"end\",\"span\":\"{\\\"line_start\\\":27,\\\"line_stop\\\":27,\\\"col_start\\\":28,\\\"col_stop\\\":31,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if str[end] != ' ' {\\\"}\"}"
|
|
}
|
|
}
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"op": "Ne"
|
|
}
|
|
},
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Assign": {
|
|
"operation": "Assign",
|
|
"assignee": {
|
|
"identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":25,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}",
|
|
"accesses": []
|
|
},
|
|
"value": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"skipped\",\"span\":\"{\\\"line_start\\\":28,\\\"line_stop\\\":28,\\\"col_start\\\":35,\\\"col_stop\\\":42,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" skipped = skipped + 1;\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Implicit": "1"
|
|
}
|
|
},
|
|
"op": "Add"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"next": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Conditional": {
|
|
"condition": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":34,\\\"line_stop\\\":34,\\\"col_start\\\":16,\\\"col_stop\\\":23,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if end_sym != ' ' {\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Char": {
|
|
"character": {
|
|
"Scalar": 32
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"op": "Ne"
|
|
}
|
|
},
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Log": {
|
|
"string": [
|
|
{
|
|
"Scalar": 67
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 109
|
|
},
|
|
{
|
|
"Scalar": 112
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 114
|
|
},
|
|
{
|
|
"Scalar": 105
|
|
},
|
|
{
|
|
"Scalar": 110
|
|
},
|
|
{
|
|
"Scalar": 103
|
|
},
|
|
{
|
|
"Scalar": 58
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 123
|
|
},
|
|
{
|
|
"Scalar": 125
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 63
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 123
|
|
},
|
|
{
|
|
"Scalar": 125
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":51,\\\"col_stop\\\":60,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}"
|
|
},
|
|
{
|
|
"Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":35,\\\"line_stop\\\":35,\\\"col_start\\\":62,\\\"col_stop\\\":69,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Comparing: {} ? {}\\\\\\\", start_sym, end_sym);\\\"}\"}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Conditional": {
|
|
"condition": {
|
|
"Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":37,\\\"line_stop\\\":37,\\\"col_start\\\":20,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" if result {\\\"}\"}"
|
|
},
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Assign": {
|
|
"operation": "Assign",
|
|
"assignee": {
|
|
"identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":21,\\\"col_stop\\\":27,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}",
|
|
"accesses": []
|
|
},
|
|
"value": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"start_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":31,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Identifier": "{\"name\":\"end_sym\",\"span\":\"{\\\"line_start\\\":38,\\\"line_stop\\\":38,\\\"col_start\\\":44,\\\"col_stop\\\":51,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" result = (start_sym == end_sym);\\\"}\"}"
|
|
},
|
|
"op": "Eq"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"next": null
|
|
}
|
|
},
|
|
{
|
|
"Assign": {
|
|
"operation": "Assign",
|
|
"assignee": {
|
|
"identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":17,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}",
|
|
"accesses": []
|
|
},
|
|
"value": {
|
|
"Binary": {
|
|
"left": {
|
|
"Identifier": "{\"name\":\"processed\",\"span\":\"{\\\"line_start\\\":41,\\\"line_stop\\\":41,\\\"col_start\\\":29,\\\"col_stop\\\":38,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" processed = processed + 1;\\\"}\"}"
|
|
},
|
|
"right": {
|
|
"Value": {
|
|
"Implicit": "1"
|
|
}
|
|
},
|
|
"op": "Add"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"next": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"next": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Log": {
|
|
"string": [
|
|
{
|
|
"Scalar": 82
|
|
},
|
|
{
|
|
"Scalar": 101
|
|
},
|
|
{
|
|
"Scalar": 115
|
|
},
|
|
{
|
|
"Scalar": 117
|
|
},
|
|
{
|
|
"Scalar": 108
|
|
},
|
|
{
|
|
"Scalar": 116
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 105
|
|
},
|
|
{
|
|
"Scalar": 115
|
|
},
|
|
{
|
|
"Scalar": 58
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 123
|
|
},
|
|
{
|
|
"Scalar": 125
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":46,\\\"line_stop\\\":46,\\\"col_start\\\":34,\\\"col_stop\\\":40,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.log(\\\\\\\"Result is: {}\\\\\\\", result);\\\"}\"}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Return": {
|
|
"expression": {
|
|
"Identifier": "{\"name\":\"result\",\"span\":\"{\\\"line_start\\\":48,\\\"line_stop\\\":48,\\\"col_start\\\":12,\\\"col_stop\\\":18,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" return result;\\\"}\"}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}": {
|
|
"annotations": [
|
|
{
|
|
"arguments": [],
|
|
"name": "{\"name\":\"test\",\"span\":\"{\\\"line_start\\\":51,\\\"line_stop\\\":51,\\\"col_start\\\":2,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"@test\\\"}\"}"
|
|
}
|
|
],
|
|
"identifier": "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":52,\\\"line_stop\\\":52,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}",
|
|
"input": [],
|
|
"output": null,
|
|
"block": {
|
|
"statements": [
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":53,\\\"line_stop\\\":53,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"a b a \\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"😀😀😀😀😀 😀😀😀😀😀\\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
},
|
|
{
|
|
"Scalar": 128512
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":55,\\\"line_stop\\\":55,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"borrow or rob \\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 114
|
|
},
|
|
{
|
|
"Scalar": 114
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 119
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 114
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 114
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":56,\\\"line_stop\\\":56,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"bbbb aaaa aaaa bbbb\\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
},
|
|
{
|
|
"Scalar": 98
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":57,\\\"line_stop\\\":57,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"aaaaaaaaaaaaaaaaaaaa\\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Console": {
|
|
"function": {
|
|
"Assert": {
|
|
"Call": {
|
|
"function": {
|
|
"Identifier": "{\"name\":\"is_palindrome\",\"span\":\"{\\\"line_start\\\":58,\\\"line_stop\\\":58,\\\"col_start\\\":20,\\\"col_stop\\\":33,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" console.assert(is_palindrome(\\\\\\\"taco cat \\\\\\\"));\\\"}\"}"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"Value": {
|
|
"String": [
|
|
{
|
|
"Scalar": 116
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 99
|
|
},
|
|
{
|
|
"Scalar": 111
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 99
|
|
},
|
|
{
|
|
"Scalar": 97
|
|
},
|
|
{
|
|
"Scalar": 116
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
},
|
|
{
|
|
"Scalar": 32
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
} |