diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-07-30 10:17:45 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-07-30 10:17:45 +0300 |
commit | 7c5ef6000bdeebfa8d51c0ead656ea554f1eb882 (patch) | |
tree | 170bd0a4bc3f8282d6a97f16498b356a64b2f925 /src/GCodes/GCodeBuffer | |
parent | 7b0dde7831f35450b6c5c077b00821b118eb9570 (diff) | |
parent | d7fd1866ffbfbb87229fa89ae2c7add48307cd8a (diff) |
Merge branch 'v3-chrishamm' into 3.4-input-shaping
Diffstat (limited to 'src/GCodes/GCodeBuffer')
-rw-r--r-- | src/GCodes/GCodeBuffer/ExpressionParser.cpp | 6 | ||||
-rw-r--r-- | src/GCodes/GCodeBuffer/ExpressionParser.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/GCodes/GCodeBuffer/ExpressionParser.cpp b/src/GCodes/GCodeBuffer/ExpressionParser.cpp index 60d5db79..0c65a39c 100644 --- a/src/GCodes/GCodeBuffer/ExpressionParser.cpp +++ b/src/GCodes/GCodeBuffer/ExpressionParser.cpp @@ -812,10 +812,12 @@ void ExpressionParser::SkipWhiteSpace() noexcept } } -void ExpressionParser::CheckForExtraCharacters() THROWS(GCodeException) +void ExpressionParser::CheckForExtraCharacters(bool isArrayExpression) THROWS(GCodeException) { SkipWhiteSpace(); - if (CurrentCharacter() != 0) + + char c = CurrentCharacter(); + if (c != 0 && (!isArrayExpression || (c != EXPRESSION_LIST_SEPARATOR && c != LIST_SEPARATOR))) { ThrowParseException("Unexpected characters after expression"); } diff --git a/src/GCodes/GCodeBuffer/ExpressionParser.h b/src/GCodes/GCodeBuffer/ExpressionParser.h index 25ad7470..adfff7c7 100644 --- a/src/GCodes/GCodeBuffer/ExpressionParser.h +++ b/src/GCodes/GCodeBuffer/ExpressionParser.h @@ -33,7 +33,7 @@ public: void ParseDriverIdArray(DriverId arr[], size_t& length) THROWS(GCodeException); void SkipWhiteSpace() noexcept; - void CheckForExtraCharacters() THROWS(GCodeException); + void CheckForExtraCharacters(bool isArrayExpression = false) THROWS(GCodeException); const char *GetEndptr() const noexcept { return currentp; } private: |