MCPcopy Create free account
hub / github.com/Schildkroet/Candle2 / parseComment

Method parseComment

src/parser/gcodepreprocessorutils.cpp:58–70  ·  view source on GitHub ↗

* Searches for a comment in the input string and returns the first match. */

Source from the content-addressed store, hash-verified

56* Searches for a comment in the input string and returns the first match.
57*/
58QString GcodePreprocessorUtils::parseComment(QString command)
59{
60 // REGEX: Find any comment, includes the comment characters:
61 // "(?<=\()[^\(\)]*|(?<=\;)[^;]*"
62 // "(?<=\\()[^\\(\\)]*|(?<=\\;)[^;]*"
63
64 static QRegExp re("(\\([^\\(\\)]*\\)|;[^;].*)");
65
66 if (re.indexIn(command) != -1) {
67 return re.cap(1);
68 }
69 return "";
70}
71
72QString GcodePreprocessorUtils::truncateDecimals(int length, QString command)
73{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected