Skip to content

Transparent handling of #line directives in input files #98

@skvadrik

Description

@skvadrik

I was playing around with a project where I pass the re2c input file through a preprocessor (m4) first. For best results in this situation, it’s best if re2c can handle #file directives in its input file.

The attached patch to 0.13.3 accomplishes this. While it takes reasonable precautions against false matches for #line directives, it does not strictly check for the directives to start at the beginning of a line (as far as I know, re2c does not yet support the ^pattern syntax, does it?)

While I tried to match the general style of re2c’s source code, I’m open to reworking the patch to meet any further standards I may have missed.

Original comment by: neeri

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions