| 890 | } |
| 891 | |
| 892 | void FileInfoParser::ProcessCustomInfo(const char *_ecv_array k, const char *_ecv_array p, const char *_ecv_array lineEnd, int param) noexcept |
| 893 | { |
| 894 | if (vars != nullptr && isAlpha(*p)) |
| 895 | { |
| 896 | const char *_ecv_array kStart = p; |
| 897 | do |
| 898 | { |
| 899 | ++p; |
| 900 | } while (isAlnum(*p) || *p == '_'); |
| 901 | const size_t nameLength = p - kStart; |
| 902 | |
| 903 | while (*p == ' ' || *p == '\t') { ++p; } |
| 904 | if (*p == '=') |
| 905 | { |
| 906 | ++p; |
| 907 | ExpressionParser parser(nullptr, p, lineEnd); |
| 908 | try |
| 909 | { |
| 910 | ExpressionValue ev = parser.Parse(true); // may throw |
| 911 | auto vset = vars->GetForWriting(); |
| 912 | if (vset->Lookup(kStart, nameLength, false) == nullptr) |
| 913 | { |
| 914 | vset->InsertNew(kStart, nameLength, ev, 0); // may throw |
| 915 | } |
| 916 | } |
| 917 | catch (GCodeException& exc) |
| 918 | { |
| 919 | if (reprap.Debug(Module::PrintMonitor)) |
| 920 | { |
| 921 | exc.DebugPrint(); |
| 922 | } |
| 923 | } |
| 924 | } |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | #endif |
| 929 |
nothing calls this directly
no test coverage detected