| 98 | static bool IsEmpty(const char* str) { return !(str && *str); } |
| 99 | |
| 100 | void SLaddError(ErrorContainer* errors, const char* messageId, |
| 101 | const char* fileName, uint32_t line, uint32_t col, |
| 102 | const char* objectName) { |
| 103 | if (errors == nullptr) return; |
| 104 | FileSystem* const fileSystem = FileSystem::getInstance(); |
| 105 | SymbolTable* symbolTable = errors->getSymbolTable(); |
| 106 | const PathId fileId = IsEmpty(fileName) |
| 107 | ? BadPathId |
| 108 | : fileSystem->toPathId(fileName, symbolTable); |
| 109 | const SymbolId objectId = IsEmpty(objectName) |
| 110 | ? BadSymbolId |
| 111 | : symbolTable->registerSymbol(objectName); |
| 112 | Location loc(fileId, line, col, objectId); |
| 113 | |
| 114 | ErrorDefinition::ErrorType type = ErrorDefinition::getErrorType(messageId); |
| 115 | Error err(type, loc); |
| 116 | errors->addError(err, false, false); |
| 117 | } |
| 118 | |
| 119 | void SLaddMLError(ErrorContainer* errors, const char* messageId, |
| 120 | const char* fileName1, uint32_t line1, uint32_t col1, |
no test coverage detected