diff -r 083b0d8e220a -r c5830bce1c23 src/parser.cpp --- a/src/parser.cpp Thu Jul 14 16:47:59 2022 +0300 +++ b/src/parser.cpp Wed Jul 20 12:59:07 2022 +0300 @@ -22,9 +22,9 @@ #include "src/model.h" #include "src/parser.h" -#define NUMBER_REGEX R"([+-]?(?:(?:\d+\.?\d*)|(?:\.\d+)))" +#define NUMBER_REGEX R"(([+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))))" #define SPACE_REGEX R"(\s+)" -#define VEC3_REGEX "(" NUMBER_REGEX SPACE_REGEX NUMBER_REGEX SPACE_REGEX NUMBER_REGEX ")" +#define VEC3_REGEX NUMBER_REGEX SPACE_REGEX NUMBER_REGEX SPACE_REGEX NUMBER_REGEX #define TWO_VECTORS VEC3_REGEX SPACE_REGEX VEC3_REGEX #define THREE_VECTORS TWO_VECTORS SPACE_REGEX VEC3_REGEX #define FOUR_VECTORS THREE_VECTORS SPACE_REGEX VEC3_REGEX @@ -64,6 +64,7 @@ { const int index = attribIndex, Attrib>; const TextRange& range = parsed.positions[index]; + const QString content = parsed.content; return parsed.content.mid(range.start, range.length); } @@ -103,6 +104,7 @@ .length = match.capturedLength(i + 1), }; } + parsed->content = match.captured(0); return parsed; }; if (auto line1Match = tryRe(exprs().subfileRe)) {