Replay errors show line number of action

I would have done this FOREVER ago but every time I looked
in ticpp for a way to get element file positions I somehow
missed Row() and Column()
This commit is contained in:
2025-04-25 11:17:23 -05:00
parent c0008e183a
commit 973cd71627
4 changed files with 10 additions and 2 deletions

View File

@@ -202,6 +202,13 @@ std::string next_action_type() {
return next_action->Value();
}
int next_action_line() {
if(next_action == nullptr){
throw std::string { "Replay error! No action left to check row" };
}
return next_action->Row();
}
Element& pop_next_action(std::string expected_action_type) {
if(next_action == nullptr){
throw std::string { "Replay error! No action left to pop" };

View File

@@ -38,6 +38,7 @@ extern void record_action(Element& action);
extern void record_field_input(cKey key);
extern bool has_next_action(std::string type = "");
extern std::string next_action_type();
extern int next_action_line();
extern Element& pop_next_action(std::string expected_action_type="");
extern std::map<std::string,std::string> info_from_action(Element& action);
extern std::string encode_file(fs::path file);