Skip to content

Commit 7ea1084

Browse files
parsing removed
1 parent 6ce28c0 commit 7ea1084

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

include/common/parsing/CodePreprocessing.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,6 @@ struct ClassicCondition {
230230
size_t expectedValue;
231231
};
232232

233-
/**
234-
* @brief Represents a parsed load error with optional location metadata.
235-
*/
236-
struct ParsedLoadError {
237-
size_t line;
238-
size_t column;
239-
std::string detail;
240-
};
241-
242233
/**
243234
* @brief Represents a function definition in the code.
244235
*/
@@ -373,11 +364,4 @@ bool isBarrier(const std::string& line);
373364
*/
374365
std::vector<std::string> parseParameters(const std::string& instruction);
375366

376-
/**
377-
* @brief Parse a load error message into a structured error descriptor.
378-
* @param message The raw error message.
379-
* @return The parsed load error.
380-
*/
381-
ParsedLoadError parseLoadErrorMessage(const std::string& message);
382-
383367
} // namespace mqt::debugger

src/common/parsing/CodePreprocessing.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -531,42 +531,6 @@ std::vector<std::string> parseParameters(const std::string& instruction) {
531531
return parameters;
532532
}
533533

534-
ParsedLoadError parseLoadErrorMessage(const std::string& message) {
535-
const std::string trimmed = trim(message);
536-
const std::string prefix = "<input>:";
537-
if (!trimmed.starts_with(prefix)) {
538-
return {.line = 0, .column = 0, .detail = trimmed};
539-
}
540-
541-
const size_t lineStart = prefix.size();
542-
const size_t lineEnd = trimmed.find(':', lineStart);
543-
if (lineEnd == std::string::npos) {
544-
return {.line = 0, .column = 0, .detail = trimmed};
545-
}
546-
const size_t columnEnd = trimmed.find(':', lineEnd + 1);
547-
if (columnEnd == std::string::npos) {
548-
return {.line = 0, .column = 0, .detail = trimmed};
549-
}
550-
551-
const std::string lineStr = trimmed.substr(lineStart, lineEnd - lineStart);
552-
const std::string columnStr =
553-
trimmed.substr(lineEnd + 1, columnEnd - lineEnd - 1);
554-
auto isDigit = [](unsigned char c) { return std::isdigit(c) != 0; };
555-
if (lineStr.empty() || columnStr.empty() ||
556-
!std::ranges::all_of(lineStr, isDigit) ||
557-
!std::ranges::all_of(columnStr, isDigit)) {
558-
return {.line = 0, .column = 0, .detail = trimmed};
559-
}
560-
561-
const size_t line = std::stoul(lineStr);
562-
const size_t column = std::stoul(columnStr);
563-
std::string detail = trim(trimmed.substr(columnEnd + 1));
564-
if (detail.empty()) {
565-
detail = trimmed;
566-
}
567-
return {.line = line, .column = column, .detail = detail};
568-
}
569-
570534
std::vector<Instruction> preprocessCode(const std::string& code,
571535
std::string& processedCode) {
572536
std::map<std::string, size_t> definedRegisters;

0 commit comments

Comments
 (0)