* Searches for a comment in the input string and returns the first match. */
| 56 | * Searches for a comment in the input string and returns the first match. |
| 57 | */ |
| 58 | QString 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 | |
| 72 | QString GcodePreprocessorUtils::truncateDecimals(int length, QString command) |
| 73 | { |
nothing calls this directly
no outgoing calls
no test coverage detected