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

alexSetUserState/alexGetUserState with monadUserState-bytestring wrapper #220

Closed
zoeyfyi opened this issue Dec 14, 2022 · 6 comments · Fixed by #254
Closed

alexSetUserState/alexGetUserState with monadUserState-bytestring wrapper #220

zoeyfyi opened this issue Dec 14, 2022 · 6 comments · Fixed by #254

Comments

@zoeyfyi
Copy link

zoeyfyi commented Dec 14, 2022

Is there any reason these are not enabled for the monadUserState-bytestring wrapper?

#if !defined(ALEX_MONAD_BYTESTRING) && defined(ALEX_MONAD_USER_STATE)

@andreasabel
Copy link
Member

I suggest you try to find the author (e.g. via git blame) and then ask the author...

@emekoi
Copy link
Contributor

emekoi commented Dec 30, 2023

Tracing the change back to 13fd23e and 4de7cd8, it seems that this was a mistake.

emekoi added a commit to emekoi/alex that referenced this issue Dec 30, 2023
@andreasabel andreasabel mentioned this issue Dec 30, 2023
andreasabel added a commit that referenced this issue Dec 30, 2023
@andreasabel
Copy link
Member

Tracing the change back to 13fd23e and 4de7cd8, it seems that this was a mistake.

@emekoi : Is there a released version of alex that supports alex{G,S}etUserState in the monadUserState-bytestring wrapper?
According to my experiments,

  • alex-3.1.7 (Jan 2016) does not know about that wrapper
  • alex-3.2.0 (Oct 2016) knows about the wrapper but does not support alex{G,S}etUserState

So maybe this isn't a regression, but a feature that never worked.

@emekoi
Copy link
Contributor

emekoi commented Dec 30, 2023

I probably should've checked, but I think you're right that this never worked. In a4f43f8 (just before 13fd23e) monadUserState-bytestring also did not support alex{G,S}etUserState. I probably just assumed alex did at some point because I was following this tutorial by Serokell, and they use alex{G,S}etUserState with monadUserState-bytestring.

Also could you clarify what you meant by "alex-3.1.7 (Jan 2016) does not know about that wrapper"? Looking at Github, alex{G,S}etUserState were introduced in #23 which made it into alex-3.1.1, and monadUserState-bytestring was introduced in alex-2.3.1 (57d9d6d).

@andreasabel
Copy link
Member

Also could you clarify what you meant by "alex-3.1.7 (Jan 2016) does not know about that wrapper"?

Oh, I got a parse error for the test, so I assumed it was because of the %wrapper directive. I should check again...

@andreasabel
Copy link
Member

I checked 3.1.4; it also does not know about alex{S,G}etUserState. Older versions of alex can't be built on my mac.

andreasabel added a commit that referenced this issue Dec 30, 2023
andreasabel added a commit that referenced this issue Dec 30, 2023
…` wrapper (#254)

Corrects some CPP in the template.

Closes #220.

---------

Co-authored-by: Emeka Nkurumeh <[email protected]>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Apr 12, 2024
## Changes in 3.5.1.0

* Drop generating output for GHC < 6.4.
* Use qualified imports in generated code (except for `Prelude`)
  ([Issue #258](haskell/alex#258)).
* Suppress warnings `tabs` and `unused-imports` for generated code
  ([Issue #255](haskell/alex#255)).
* Tested with GHC 8.0 - 9.8.2.

## Changes in 3.5.0.0

 * Add option `--numeric-version`.
 * Remove deprecated `-v` as alias for `--version`.
 * Add `-v` as placeholder for a future `--verbose` option.
 * Make `alex{G,S}etUserState` available with the `monadUserState-bytestring` wrapper
   ([Issue #220](haskell/alex#220)).
 * Debugging lexer: print character in addition to its ASCII code
   ([PR #252](haskell/alex#252)).
 * Tested with GHC 8.0 - 9.8.1.
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 a pull request may close this issue.

3 participants