X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e9ce56889c73b46052abd2ed2198d5c436cf5852..464c692789eba089bb21ebd3983ebeaa4a8d3312:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index 2224c85f..c5d8024f 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -189,7 +189,7 @@ declaration: | "%pure-parser" { pure_parser = 1; } | "%skeleton" string_content { skeleton = $2; } | "%token-table" { token_table_flag = 1; } -| "%verbose" { report_flag = 1; } +| "%verbose" { report_flag = report_states; } | "%yacc" { yacc_flag = 1; } | ";" ; @@ -413,20 +413,16 @@ static YYLTYPE lloc_default (YYLTYPE const *rhs, int n) { int i; - int j; YYLTYPE r; r.start = r.end = rhs[n].end; + /* Ignore empty nonterminals the start of the the right-hand side. + Do not bother to ignore them at the end of the right-hand side, + since empty nonterminals have the same end as their predecessors. */ for (i = 1; i <= n; i++) if (! equal_boundaries (rhs[i].start, rhs[i].end)) { r.start = rhs[i].start; - - for (j = n; i < j; j--) - if (! equal_boundaries (rhs[j].start, rhs[j].end)) - break; - r.end = rhs[j].end; - break; }