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

Partial fix for #14 #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Partial fix for #14 #15

wants to merge 3 commits into from

Conversation

flip111
Copy link

@flip111 flip111 commented Dec 26, 2018

Before the line pragma of Special token was dependent on the creation of empty Text tokens (not to be confused with Data.Text). The empty Text tokens create empty sections in the generated .hs file and in generally it's better to let the Special tokens be responsible for it's own line pragma's.

I added state for starttype / stoptype so the line numbers get tracked. The thing was that the C macro for hsc_starttype and the hsc_field to not generated any hs code. All the code is only generated at the hsc_stoptype macro. But the offset in the original hsc file is counted from the line number of the hsc_starttype not hsc_stoptype. This is the main fix for #14

@flip111
Copy link
Author

flip111 commented Dec 26, 2018

By the way, as i was diving into the bindings.dsl.h code and also the code of hsc2hs i was wondering why this was written in C. Maybe it makes more sense there to skip the C step and write out the HS file straight from haskell.

@flip111 flip111 changed the title Fix for #14 Partial fix for #14 Dec 26, 2018
@flip111
Copy link
Author

flip111 commented Dec 26, 2018

The situation with the line numbers seem to be better than as it was. However need support from bindings.dsl.h for printing correct line pragma's see rethab/bindings-dsl#33

@l29ah
Copy link

l29ah commented Jun 5, 2020

Why wasn't this PR merged? Can i help it somehow?

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

Successfully merging this pull request may close these issues.

2 participants