Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-07-30 10:17:45 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-07-30 10:17:45 +0300
commit7c5ef6000bdeebfa8d51c0ead656ea554f1eb882 (patch)
tree170bd0a4bc3f8282d6a97f16498b356a64b2f925 /src/GCodes/GCodeBuffer
parent7b0dde7831f35450b6c5c077b00821b118eb9570 (diff)
parentd7fd1866ffbfbb87229fa89ae2c7add48307cd8a (diff)
Merge branch 'v3-chrishamm' into 3.4-input-shaping
Diffstat (limited to 'src/GCodes/GCodeBuffer')
-rw-r--r--src/GCodes/GCodeBuffer/ExpressionParser.cpp6
-rw-r--r--src/GCodes/GCodeBuffer/ExpressionParser.h2
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: