* Support paths to names rather than just raw idents Signed-off-by: Nick Cameron <nrc@ncameron.org> * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
548 lines
15 KiB
Plaintext
548 lines
15 KiB
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of parsing boolean_logical_multiple.kcl
|
|
---
|
|
{
|
|
"Ok": {
|
|
"body": [
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "ii",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 5,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 5,
|
|
"end": 0,
|
|
"raw": "true",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": true
|
|
},
|
|
"operator": "|",
|
|
"right": {
|
|
"commentStart": 12,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 12,
|
|
"end": 0,
|
|
"raw": "false",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": false
|
|
},
|
|
"operator": "&",
|
|
"right": {
|
|
"commentStart": 20,
|
|
"end": 0,
|
|
"raw": "false",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": false
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 26,
|
|
"declaration": {
|
|
"commentStart": 26,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 26,
|
|
"end": 0,
|
|
"name": "i",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 30,
|
|
"cond": {
|
|
"abs_path": false,
|
|
"commentStart": 33,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 33,
|
|
"end": 0,
|
|
"name": "ii",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"digest": null,
|
|
"else_ifs": [],
|
|
"end": 0,
|
|
"final_else": {
|
|
"body": [
|
|
{
|
|
"commentStart": 53,
|
|
"end": 0,
|
|
"expression": {
|
|
"commentStart": 53,
|
|
"end": 0,
|
|
"raw": "2",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 2.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
}
|
|
],
|
|
"commentStart": 53,
|
|
"end": 0,
|
|
"start": 0
|
|
},
|
|
"start": 0,
|
|
"then_val": {
|
|
"body": [
|
|
{
|
|
"commentStart": 40,
|
|
"end": 0,
|
|
"expression": {
|
|
"commentStart": 40,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
}
|
|
],
|
|
"commentStart": 40,
|
|
"end": 0,
|
|
"start": 0
|
|
},
|
|
"type": "IfExpression",
|
|
"type": "IfExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 57,
|
|
"end": 0,
|
|
"expression": {
|
|
"arguments": [
|
|
{
|
|
"commentStart": 64,
|
|
"end": 0,
|
|
"left": {
|
|
"abs_path": false,
|
|
"commentStart": 64,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 64,
|
|
"end": 0,
|
|
"name": "i",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"operator": "==",
|
|
"right": {
|
|
"commentStart": 69,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"commentStart": 72,
|
|
"end": 0,
|
|
"raw": "\"and has higher precedence than or\"",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": "and has higher precedence than or"
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 57,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 57,
|
|
"end": 0,
|
|
"name": "assert",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 57,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
},
|
|
{
|
|
"commentStart": 108,
|
|
"declaration": {
|
|
"commentStart": 110,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 110,
|
|
"end": 0,
|
|
"name": "jj",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 115,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 115,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 115,
|
|
"end": 0,
|
|
"raw": "false",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": false
|
|
},
|
|
"operator": "|",
|
|
"right": {
|
|
"commentStart": 123,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 123,
|
|
"end": 0,
|
|
"raw": "true",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": true
|
|
},
|
|
"operator": "&",
|
|
"right": {
|
|
"argument": {
|
|
"commentStart": 131,
|
|
"end": 0,
|
|
"raw": "false",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": false
|
|
},
|
|
"commentStart": 130,
|
|
"end": 0,
|
|
"operator": "!",
|
|
"start": 0,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"operator": "|",
|
|
"right": {
|
|
"commentStart": 139,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 139,
|
|
"end": 0,
|
|
"raw": "false",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": false
|
|
},
|
|
"operator": "&",
|
|
"right": {
|
|
"commentStart": 147,
|
|
"end": 0,
|
|
"raw": "true",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": true
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 152,
|
|
"declaration": {
|
|
"commentStart": 152,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 152,
|
|
"end": 0,
|
|
"name": "j",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 156,
|
|
"cond": {
|
|
"abs_path": false,
|
|
"commentStart": 159,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 159,
|
|
"end": 0,
|
|
"name": "jj",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"digest": null,
|
|
"else_ifs": [],
|
|
"end": 0,
|
|
"final_else": {
|
|
"body": [
|
|
{
|
|
"commentStart": 179,
|
|
"end": 0,
|
|
"expression": {
|
|
"commentStart": 179,
|
|
"end": 0,
|
|
"raw": "2",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 2.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
}
|
|
],
|
|
"commentStart": 179,
|
|
"end": 0,
|
|
"start": 0
|
|
},
|
|
"start": 0,
|
|
"then_val": {
|
|
"body": [
|
|
{
|
|
"commentStart": 166,
|
|
"end": 0,
|
|
"expression": {
|
|
"commentStart": 166,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
}
|
|
],
|
|
"commentStart": 166,
|
|
"end": 0,
|
|
"start": 0
|
|
},
|
|
"type": "IfExpression",
|
|
"type": "IfExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 183,
|
|
"end": 0,
|
|
"expression": {
|
|
"arguments": [
|
|
{
|
|
"commentStart": 190,
|
|
"end": 0,
|
|
"left": {
|
|
"abs_path": false,
|
|
"commentStart": 190,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 190,
|
|
"end": 0,
|
|
"name": "j",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"operator": "==",
|
|
"right": {
|
|
"commentStart": 195,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"commentStart": 198,
|
|
"end": 0,
|
|
"raw": "\"multiple logical operators\"",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": "multiple logical operators"
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 183,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 183,
|
|
"end": 0,
|
|
"name": "assert",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 183,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "ExpressionStatement",
|
|
"type": "ExpressionStatement"
|
|
}
|
|
],
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"2": [
|
|
{
|
|
"commentStart": 108,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 0
|
|
}
|
|
}
|