Skip to content

Commit

Permalink
operators: nearly done! /10
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Dec 27, 2024
1 parent 7e1cbf8 commit 8bb53da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ Also note the focus on easy integration into other products and easy customizabi
- [Constants](./documentation/README-Constants.md)


## 3. Links
# 3. Links

- MinitScript, see [README.md](./README.md)
- MinitScript - How to build, see [README-BuildingHowTo.md](./README-BuildingHowTo.md)
- MinitScript - How to use, see [README-Tools.md](./README-Tools.md)
- The Mindty Kollektiv [Discord Server](https://discord.gg/Na4ACaFD)

# 11. Donation
# 4. Donation
- I have to pay my bills, beer and stuff, so if you have any use for this open source project, like educational, productive or fun, ..., consider a donation here [PayPal](https://www.paypal.me/andreasdrewke), here [GitHub Sponsors](https://github.com/sponsors/andreasdr) or via [Amazon Wishlist](https://www.amazon.de/hz/wishlist/ls/250IBUL4JSZVR?ref_=wl_share)

# 12. Bounties
# 5. Bounties
- We will most likely accept MinitScript (related) tasks as kind of bounties for a customized MinitScript or default MinitScript
8 changes: 5 additions & 3 deletions resources/minitscript/tests/initializeroperator-test.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ on: nothing
console.printLine("application.getArguments()[0]: " + application.getArguments()[0])
console.printLine("{\"a\":1}->contains(\"a\"): " + {"a":1}->contains("a"))
console.printLine("{\"a\":1}.a: " + {"a":1}.a)
#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("\"Hi there!!! OpenBSD!!!->getSize()\": " + "Hi there!!! OpenBSD!!!"->getSize())
console.printLine("[\"FreeBSD\", \"NetBSD\", \"OpenBSD\"]->contains($$.application::OS): " + ["FreeBSD", "NetBSD", "OpenBSD"]->contains($$.application::OS))
# test: not working yet
# 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].b[1])
script.stop()
end

Expand Down
11 changes: 4 additions & 7 deletions src/minitscript/minitscript/MinitScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3560,7 +3560,7 @@ const string MinitScript::doStatementPreProcessing(const string& processedStatem
//
string operatorCandidate;
operatorCandidate+= processedStatement[i];
if (isOperatorChar(processedStatement[i + 1]) == true) operatorCandidate+= processedStatement[i + 1];
if (i + 1 < processedStatement.size() && isOperatorChar(processedStatement[i + 1]) == true) operatorCandidate+= processedStatement[i + 1];
//
auto priorizedOperator = static_cast<Operator>(j);
auto operatorString = getOperatorAsString(priorizedOperator);
Expand Down Expand Up @@ -3589,11 +3589,6 @@ const string MinitScript::doStatementPreProcessing(const string& processedStatem
isOperator(operatorString + processedStatement[i + 1]) == true)) {
continue;
}
if (operatorString.size() == 2 &&
i > 0 &&
isOperatorChar(processedStatement[i - 1]) == true) {
continue;
}
if (operatorString.size() == 2 &&
i + 2 < processedStatement.size() &&
isOperatorChar(processedStatement[i + 2]) == true) {
Expand Down Expand Up @@ -3740,7 +3735,9 @@ const string MinitScript::doStatementPreProcessing(const string& processedStatem
(leftArgument[0] != '$' &&
leftArgument[leftArgument.size() - 1] != ')' &&
leftArgument[0] != '{' &&
leftArgument[leftArgument.size() - 1] != '}')) {
leftArgument[leftArgument.size() - 1] != '}' &&
leftArgument[0] != '[' &&
leftArgument[leftArgument.size() - 1] != ']')) {
continue;
}
// no $$, $GLOBAL
Expand Down
2 changes: 1 addition & 1 deletion src/minitscript/minitscript/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using std::string;
using minitscript::minitscript::Version;

string Version::getVersion() {
return "0.9.31 PRE-BETA";
return "0.9.32 PRE-BETA";
}

string Version::getCopyright() {
Expand Down

0 comments on commit 8bb53da

Please sign in to comment.