src/exception/ErrorManager.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2026 ChilliBits. All rights reserved. | ||
| 2 | |||
| 3 | #include "ErrorManager.h" | ||
| 4 | |||
| 5 | #include <ast/ASTNodes.h> | ||
| 6 | |||
| 7 | namespace spice::compiler { | ||
| 8 | |||
| 9 | 193 | void ErrorManager::addSoftError(const CodeLoc &codeLoc, const std::string &message) { | |
| 10 | // Avoid duplicate errors | ||
| 11 |
2/2✓ Branch 3 → 4 taken 184 times.
✓ Branch 3 → 8 taken 9 times.
|
451 | if (std::ranges::none_of(softErrors, [&](const SoftError &err) { return err.codeLoc == codeLoc; })) |
| 12 |
2/4✓ Branch 4 → 5 taken 184 times.
✗ Branch 4 → 11 not taken.
✓ Branch 5 → 6 taken 184 times.
✗ Branch 5 → 9 not taken.
|
184 | softErrors.emplace_back(SoftError{codeLoc, message}); |
| 13 | 193 | } | |
| 14 | |||
| 15 | 193 | void ErrorManager::addSoftError(const ASTNode *astNode, SemanticErrorType errorType, const std::string &message) { | |
| 16 | // Build error message | ||
| 17 |
1/2✓ Branch 2 → 3 taken 193 times.
✗ Branch 2 → 20 not taken.
|
193 | const SemanticError semanticError(astNode, errorType, message); |
| 18 | // Add to soft errors list | ||
| 19 |
2/4✓ Branch 6 → 7 taken 193 times.
✗ Branch 6 → 14 not taken.
✓ Branch 7 → 8 taken 193 times.
✗ Branch 7 → 12 not taken.
|
193 | addSoftError(astNode->codeLoc, semanticError.what()); |
| 20 | 193 | } | |
| 21 | |||
| 22 | } // namespace spice::compiler | ||
| 23 |