Remove some set_location calls from parser
Older versions of Bison (current is 3.0.4) had problems assigning
location data to rules with empty production, possibly related to the
definition of YYLLOCA_DEFAULT when N is zero.
This lead to several workarounds in the code base. A number of them
dropped through the floor in the course of refactoring without
apparent problem, and the original problem does not appear to be
reproducible with the current versions of Bison.
This removes the remaining instances. Should the original problem
reoccur at some point of time (or with some versions of Bison), it
would be noticeable as bad point-and-click messages and/or error
messages with bad location data.
Diff:
Fails make
/home/jlowe/lilypond-git/lily/parser.yy:2923:45: error: stray '@' in program
Then a bunch of errors after that, I assume caused by this first line:
--snip--
/home/jlowe/lilypond-git/lily/parser.yy:196:36: note: in definition of macro 'LOWLEVEL_MAKE_SYNTAX'
(parser->lexer_->override_input (location).smobbed_copy (), \
^
/home/jlowe/lilypond-git/lily/parser.yy:2923:13: note: in expansion of macro 'MAKE_SYNTAX'
$$ = MAKE_SYNTAX (repetition_chord, $@,
^
out/lexer.cc: In member function 'virtual int Lily_lexer::yylex()':
out/lexer.cc:4670:9: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
yyleng = (size_t) (yy_cp - yy_bp); \
^
out/lexer.cc:5180:3: note: in expansion of macro 'YY_DO_BEFORE_ACTION'
YY_DO_BEFORE_ACTION;
^
out/lexer.cc:4670:9: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
yyleng = (size_t) (yy_cp - yy_bp); \
etc.
The warnings unfortunately are as expected and, as opposed to quite a few other warnings we have in other files, hardly avoidable since they are for automatically generated code which we don't have control over.
With regard to the error: the evidence would suggest otherwise but I tested everything before submission. Nor is this the first time this happened. Huh. Will get things in order and resubmit. Sorry for the extra work.
typo fix
http://codereview.appspot.com/298660043
Passes make, make check and a ful make doc.
Patch on countdown for July 10th.
Patch counted down - please push.
Pushed to staging as
commit 7d7589bdf70cb227b032220bae87eda2045ccc8e
Author: David Kastrup dak@gnu.org
Date: Mon Jul 4 10:08:41 2016 +0200