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

163 lines
4.1 KiB
Plaintext
Raw Normal View History

---
source: kcl/src/simulation_tests.rs
description: Result of parsing array_range_negative_expr.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 19,
"id": {
"end": 2,
"name": "xs",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 19,
"endElement": {
"end": 18,
"raw": "5",
"start": 17,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"endInclusive": true,
"start": 5,
"startElement": {
"arguments": [
{
"argument": {
"end": 12,
"raw": "5",
"start": 11,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"end": 12,
"operator": "-",
"start": 10,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"callee": {
"end": 9,
"name": "int",
"start": 6,
"type": "Identifier"
},
"end": 13,
"start": 6,
"type": "CallExpression",
"type": "CallExpression"
},
"type": "ArrayRangeExpression",
"type": "ArrayRangeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 19,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 72,
"expression": {
"arguments": [
{
"computed": false,
"end": 37,
"object": {
"end": 34,
"name": "xs",
"start": 32,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 36,
"raw": "0",
"start": 35,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"start": 32,
"type": "MemberExpression",
"type": "MemberExpression"
},
{
"argument": {
"end": 41,
"raw": "5",
"start": 40,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"end": 41,
"operator": "-",
"start": 39,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 48,
"raw": "0.001",
"start": 43,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.001,
"suffix": "None"
}
},
{
"end": 71,
"raw": "\"first element is -5\"",
"start": 50,
"type": "Literal",
"type": "Literal",
"value": "first element is -5"
}
],
"callee": {
"end": 31,
"name": "assertEqual",
"start": 20,
"type": "Identifier"
},
"end": 72,
"start": 20,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 20,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 73,
"start": 0
}
}