FsLexYacc icon indicating copy to clipboard operation
FsLexYacc copied to clipboard

Incorrect self-referencing line directives in generated files

Open miegir opened this issue 7 years ago • 0 comments

Generated source files (.fs) from both fslex and fsyacc contain line directives. Inserted directives are good when referencing external files (such as source .fsl/.fsy) but are incorrect when referencing the generated file itself. Line number should contain the next line for tooling (such as syntax highlighting, etc.) to work properly.

For example, incorrect line numbers in file.fs that can be generated now are:

# 1 "file.fs" // this is the actual line 1, stating that the next line number is 1 (incorrect)
// some code on line 2

Correct directive that should be generated is:

# 2 "file.fs" // this is the actual line 1, stating that the next line number is 2 (correct)
// some code on line 2

miegir avatar Mar 27 '17 20:03 miegir