| 23 | }; |
| 24 | |
| 25 | QByteArray preprocess(QByteArray json) |
| 26 | { |
| 27 | int commentIndex = json.indexOf('#', 0); |
| 28 | while (commentIndex > -1) { |
| 29 | int commentEnd = json.indexOf('\n', commentIndex); |
| 30 | if (commentEnd == -1) { |
| 31 | json.truncate(commentIndex); |
| 32 | break; |
| 33 | } |
| 34 | json.remove(commentIndex, commentEnd - commentIndex); |
| 35 | commentIndex = json.indexOf('#', commentIndex); |
| 36 | } |
| 37 | |
| 38 | return '{' + json + '}'; |
| 39 | } |
| 40 | |
| 41 | DeclarationValidator::DeclarationValidator(TestDataEditor testDataAdjuster) |
| 42 | : d_ptr(new DeclarationValidatorPrivate{std::move(testDataAdjuster)}) |