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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
miegir opened this issue Mar 27, 2017 · 0 comments

Comments

@miegir
Copy link

miegir commented Mar 27, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants