andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.86k stars 207 forks source link

"syntax error" message should contain more information #746

Closed nkh closed 2 years ago

nkh commented 2 years ago

I'm writing a sc file by hand, the error message would be much much more helpful if the line containing the error was also listed.

andmarti1424 commented 2 years ago

Try changing gram.y:1241 line to this: sc_error("syntax error: %s", line); and rebuild.

nkh commented 2 years ago

About a zillion times better. for 2 zilion time better a line number is needed.

that may be more difficult though

andmarti1424 commented 2 years ago

im afraid you'll have to get along with having it a zillion times better only..

nkh commented 2 years ago

A zillion times is not that bad at all, and it already helped fix one issue.

I tried to add yylineno but the parser groaked on an undefined variable. This article may be of help if you have the inclination to add it later.

https://stackoverflow.com/questions/66864607/yylineno-undeclared-when-using-flex-and-yacc

andmarti1424 commented 2 years ago

Done commit with the change to dev branch