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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs with option: re2c:flags:no-debug-info #201

Closed
Durimar opened this issue Apr 13, 2018 · 2 comments

Comments

@Durimar
Copy link

commented Apr 13, 2018

Hello,
i test re2c with simple file test.re:
//---------------------------
/*!re2c
re2c馃帍no-debug-info = 1;
*/
int get_token(const char *cur)
{
return 0;
}
//--------------------

and found that:

re2c always generate debug #line1 (with no-debug-info = 1 and with no-debug-info = 0):
#line 1 "D:\Proj\ConsoleApp1\test.re"

Visual Studio 2017 generate warning
1>d:\proj\consoleapp1\test.cpp(2): warning C4129: 'P': unrecognized character escape sequence
1>d:\proj\consoleapp1\test.cpp(2): warning C4129: 'C': unrecognized character escape sequence

I think all '' symbols must be escaped like this:
#line 1 "D:\Proj\ConsoleApp1\test.re"

Thanks.

skvadrik added a commit that referenced this issue Apr 13, 2018

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Apr 13, 2018

Both issues confirmed, thanks for reporting.

I pushed the fix for backslash escapes: 4a614d6.

I might have a look at line info issue tomorrow, it's not that difficult. A long time ago re2c used to make one pass over the input and write output straight away, and in some places that one-pass approach still remains. In particular, the first line info is generated before re2c even reads the configuration.

skvadrik added a commit that referenced this issue Apr 14, 2018

@skvadrik

This comment has been minimized.

Copy link
Owner

commented Apr 14, 2018

Pushed the fix for #line directives: fe4bf2e.

@skvadrik skvadrik closed this Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.