FsLexYacc
FsLexYacc copied to clipboard
Incorrect self-referencing line directives in generated files
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