Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flex --noline outputs a #line directive #55

Closed
srivasta opened this issue Feb 17, 2016 · 1 comment
Closed

flex --noline outputs a #line directive #55

srivasta opened this issue Feb 17, 2016 · 1 comment

Comments

@srivasta
Copy link
Contributor

Hi,

This issue was reported by a Debian user in Bug 729927

The command
flex --noline name.lex

generates the line
#line 3 "lex.yy.c"

This causes some confusion when:
1: line 3 is really line 2, and,
2: when (in order to compile using C++) the file has
been renamed to (something like) lex.yy.cpp causing
error messages to specify file lex.yy.c instead of
lex.yy.cpp (or some other name).

Manoj

tklauser added a commit to tklauser/flex that referenced this issue Feb 23, 2016
There are two instances in the code which will print a #line directive
to the resulting lexer, regardless of the value of gen_line_dirs. Fix
them, so they also respect gen_line_dirs.

This fixes issue westes#55.

Signed-off-by: Tobias Klauser <[email protected]>
@westes westes closed this as completed Feb 24, 2016
@westes
Copy link
Owner

westes commented Feb 24, 2016

As per recent changes to master, this is now resolved.

tklauser added a commit to tklauser/flex that referenced this issue Jan 12, 2017
One place emitting a #line directive to the generated header was missed
in commit 647a92b when resolving westes#55. Fix it to respect gen_line_dirs
as well.
westes pushed a commit that referenced this issue Jan 12, 2017
One place emitting a #line directive to the generated header was
missed in commit 647a92b when resolving #55. Fix it to respect
gen_line_dirs as well.
eric-s-raymond added a commit to eric-s-raymond/flex that referenced this issue Oct 2, 2020
Formerly, Flex's own lexer and the logic for pocessing command-line
options both did calls to write M4 conditionals to a buffer that was
later dumped into the befinning of the text that m4 expands, before
the body of the skel file.

This was bad layering.  Instead, both these places now set flags in
the ctrl structure.  Later, (almost) all the generated m4 conditionals
are shipped at once.

It's "almost" because there are a couple of awkward cases to be
cleaned up.  Again, this was the part that could be done
simply via almost mechanical cut and paste.

In generated code, there are some comment diffs because symbols that
used to be invisibly set are now visibly set - that is, shown at the
beginning of the generated C.

westes#55 in the retargeting patch series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants