Files
modeling-app/rust/kcl-lib/tests/boolean_logical_multiple/ast.snap
Nick Cameron a7e09a89ef Improve snapshot testing (#5856)
* Improve snapshot testing

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* 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>
2025-03-19 15:06:27 -07:00

441 lines
11 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing boolean_logical_multiple.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "ii",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"raw": "true",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "|",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "false",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"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"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "i",
"start": 0,
"type": "Identifier"
},
"init": {
"cond": {
"end": 0,
"name": "ii",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 0,
"final_else": {
"body": [
{
"end": 0,
"expression": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"start": 0
},
"start": 0,
"then_val": {
"body": [
{
"end": 0,
"expression": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"start": 0
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 0,
"expression": {
"arguments": [
{
"end": 0,
"left": {
"end": 0,
"name": "i",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 0,
"raw": "\"and has higher precedence than or\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "and has higher precedence than or"
}
],
"callee": {
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "jj",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"left": {
"end": 0,
"raw": "false",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "|",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "true",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "&",
"right": {
"argument": {
"end": 0,
"raw": "false",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": false
},
"end": 0,
"operator": "!",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "|",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "false",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"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"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "j",
"start": 0,
"type": "Identifier"
},
"init": {
"cond": {
"end": 0,
"name": "jj",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 0,
"final_else": {
"body": [
{
"end": 0,
"expression": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"start": 0
},
"start": 0,
"then_val": {
"body": [
{
"end": 0,
"expression": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"start": 0
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 0,
"expression": {
"arguments": [
{
"end": 0,
"left": {
"end": 0,
"name": "j",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 0,
"raw": "\"multiple logical operators\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "multiple logical operators"
}
],
"callee": {
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}