Skip to content

Commit

Permalink
operators: nearly done! /13
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Dec 27, 2024
1 parent f1879c1 commit 3e1bfcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion resources/minitscript/tests/initializeroperator-test.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on: nothing
console.printLine("\"Hi there!!! OpenBSD!!!->getSize()\": " + "Hi there!!! OpenBSD!!!"->getSize())
console.printLine("[\"FreeBSD\", \"NetBSD\", \"OpenBSD\"]->contains($$.application::OS): " + ["FreeBSD", "NetBSD", "OpenBSD"]->contains($$.application::OS))
console.printLine("test: " + [{"a": 1, "b": [1, 2, 3], "c": {a: 1, b: 2, c:3}}, 1, 2, 3][0].c)
console.printLine("test: " + [{"a": 1, "b": [1, 2, 3], "c": {a: 1, b: 2, c:3}}, 1, 2, 3][0].c.a)
console.printLine("test: " + [{"a": 1, "b": [1, 2, 3], "c": {"a": {"x": 20, "y": 21, "z": 22}, b: 2, c:3}}, 1, 2, 3][0].c.a)
console.printLine("test: " + [{"a": 1, "b": [1, 2, 3], "c": {"a": {"x": 20, "y": 21, "z": 22}, b: 2, c:3}}, 1, 2, 3][0].c.a.x)
# test: not working yet
# console.printLine("test: " + [{"a": 1, "b": [1, 2, 3], "c": {a: 1, b: 2, c:3}}, 1, 2, 3][0].b[1])
script.stop()
Expand Down
2 changes: 1 addition & 1 deletion src/minitscript/minitscript/MinitScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3900,7 +3900,7 @@ const string MinitScript::doStatementPreProcessing(const string& processedStatem
properties.push_back(property);
property.clear();
}
for (int i = properties.size() - 1; i >= 1 ; i--) {
for (int i = 1; i < properties.size() ; i++) {
const auto& property = properties[i];
outerLeftStatement+= method->getMethodName() + "(";
outerRightStatement+= ", " + property + ", " + to_string(encodeOperatorString(operatorString)) + ")";
Expand Down

0 comments on commit 3e1bfcc

Please sign in to comment.