Rudimentary support for reporting the line number of syntax errors.
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
* USA
|
||||
*/
|
||||
|
||||
%glr-parser
|
||||
%locations
|
||||
|
||||
%{
|
||||
#include "dtc.h"
|
||||
|
||||
@@ -69,8 +72,6 @@ extern struct boot_info *the_boot_info;
|
||||
%type <str> label
|
||||
%type <str> nodename
|
||||
|
||||
%glr-parser
|
||||
|
||||
%%
|
||||
|
||||
sourcefile: memreserves devicetree {
|
||||
@@ -160,5 +161,5 @@ label: DT_LABEL { $$ = $1; }
|
||||
|
||||
void yyerror (char const *s)
|
||||
{
|
||||
fprintf (stderr, "%s\n", s);
|
||||
fprintf (stderr, "%s at line %d\n", s, yylloc.first_line);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user