FsLexYacc icon indicating copy to clipboard operation
FsLexYacc copied to clipboard

Suggestion: place code block from .fsy after token declaration in generated .fs

Open miegir opened this issue 7 years ago • 0 comments

Now the code block surrounded by %{ and %} is output before the token type declaration in .fs file. This prevents error handler from using token type directly and requires boxing/unboxing trick. Outputting the code block after the token type declaration and related helper functions such as token_to_string can simplify writing rich error handlers which depend on token type. And only drawback I can see is that if the code block opens a namespace, this opened namespace will not be available in token types. But it is not a problem really, especially because the code block is not output to the .fsi file and .fsi code will not be vaild either if token elements use namespaces opened in code block.

miegir avatar Mar 27 '17 20:03 miegir