end curses on exit, s:-

This commit is contained in:
vrd
2023-03-03 15:18:26 +02:00
parent c796f69331
commit cc7e4c07e6
4 changed files with 26 additions and 72 deletions
+13 -5
View File
@@ -46,14 +46,15 @@ namespace /* internal */
void unexpected_char(char c)
{
cerr << "Line " << line << ": Unexpected '" << c << "'\n";
endwin();
cerr << "Line " << line << ": Unexpected '" << c << std::endl;
exit(1);
/* throw 0; */
}
void unexpected_end()
{
cerr << "Unexpected end of file";
endwin();
cerr << "Unexpected end of file" << std::endl;
exit(1);
}
@@ -166,7 +167,7 @@ namespace /* internal */
else if(res.second == Nobody)
res.second = cur_tree->findId(name.data())[same_name_index];
else
/* todo */exit(1);
/* todo */TFT_EXIT(1);
same_name_index = 0;
name.clear();
break;
@@ -204,6 +205,12 @@ namespace /* internal */
{
switch(*it_data)
{
case '-':
if(name.empty())
res.push_back( cur_tree->last() );
else
unexpected_char('-');
break;
case ',':
if(!name.empty())
{
@@ -216,7 +223,8 @@ namespace /* internal */
break;
case '\n':
++line;
res.push_back( cur_tree->findId(name.data())[same_name_index] );
if(!name.empty())
res.push_back( cur_tree->findId(name.data())[same_name_index] );
return res;
case '_':
name.push_back(' ');