Files
modeling-app/rust/kcl-lib/tests/comparisons/ast.snap

806 lines
21 KiB
Plaintext
Raw Normal View History

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing comparisons.kcl
---
{
"Ok": {
"body": [
{
"commentStart": 0,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 7,
"end": 0,
"left": {
"commentStart": 7,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "==",
"right": {
"commentStart": 12,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 15,
"end": 0,
"raw": "\"equality\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "equality"
}
],
"callee": {
"commentStart": 0,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 27,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 34,
"end": 0,
"left": {
"commentStart": 34,
"end": 0,
"raw": "3.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "==",
"right": {
"commentStart": 41,
"end": 0,
"raw": "3.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 46,
"end": 0,
"raw": "\"equality of floats\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "equality of floats"
}
],
"callee": {
"commentStart": 27,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 27,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 68,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 75,
"end": 0,
"left": {
"commentStart": 75,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "!=",
"right": {
"commentStart": 80,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 83,
"end": 0,
"raw": "\"non-equality\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "non-equality"
}
],
"callee": {
"commentStart": 68,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 68,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 99,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 106,
"end": 0,
"left": {
"commentStart": 106,
"end": 0,
"raw": "3.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "!=",
"right": {
"commentStart": 113,
"end": 0,
"raw": "4.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 118,
"end": 0,
"raw": "\"non-equality of floats\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "non-equality of floats"
}
],
"callee": {
"commentStart": 99,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 99,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 144,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 151,
"end": 0,
"left": {
"commentStart": 151,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "<",
"right": {
"commentStart": 155,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 158,
"end": 0,
"raw": "\"lt\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "lt"
}
],
"callee": {
"commentStart": 144,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 144,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 164,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 171,
"end": 0,
"left": {
"commentStart": 171,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "<=",
"right": {
"commentStart": 176,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 179,
"end": 0,
"raw": "\"lte but actually lt\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "lte but actually lt"
}
],
"callee": {
"commentStart": 164,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 164,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 202,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 209,
"end": 0,
"left": {
"commentStart": 209,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"operator": "<=",
"right": {
"commentStart": 214,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 217,
"end": 0,
"raw": "\"lte but actually eq\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "lte but actually eq"
}
],
"callee": {
"commentStart": 202,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 202,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 240,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 247,
"end": 0,
"left": {
"commentStart": 247,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"operator": ">",
"right": {
"commentStart": 251,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 254,
"end": 0,
"raw": "\"gt\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "gt"
}
],
"callee": {
"commentStart": 240,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 240,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 260,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 267,
"end": 0,
"left": {
"commentStart": 267,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"operator": ">=",
"right": {
"commentStart": 272,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 275,
"end": 0,
"raw": "\"gte but actually gt\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "gte but actually gt"
}
],
"callee": {
"commentStart": 260,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 260,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 298,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 305,
"end": 0,
"left": {
"commentStart": 305,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": ">=",
"right": {
"commentStart": 310,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 313,
"end": 0,
"raw": "\"gte but actually eq\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "gte but actually eq"
}
],
"callee": {
"commentStart": 298,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 298,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 335,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 344,
"end": 0,
"left": {
"commentStart": 344,
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"operator": "==",
"right": {
"commentStart": 351,
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 356,
"end": 0,
"raw": "\"equality of zero\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "equality of zero"
}
],
"callee": {
"commentStart": 337,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 337,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 376,
"end": 0,
"expression": {
"arguments": [
{
"commentStart": 383,
"end": 0,
"left": {
"commentStart": 383,
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"operator": "==",
"right": {
"argument": {
"commentStart": 391,
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"commentStart": 390,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 396,
"end": 0,
"raw": "\"equality of zero and neg zero\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "equality of zero and neg zero"
}
],
"callee": {
"commentStart": 376,
"end": 0,
"name": "assert",
"start": 0,
"type": "Identifier"
},
"commentStart": 376,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"commentStart": 0,
"end": 0,
"nonCodeMeta": {
"nonCodeNodes": {
"9": [
{
"commentStart": 335,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}