-
Notifications
You must be signed in to change notification settings - Fork 203
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
Build fails due to missing Alex data constructors #1040
Comments
I was working on this last week -- the crazy part about this bug is that the data constructors are actually there for me (with alex 3.2.1), but aren't detected in some later phase of the build (hence the error). Another crazy thing is that, while common.hsinc is used in more than just The last thing I was doing was removing most of the |
Thanks! The offending lines are the following: --- a/yi-misc-modes/src/Yi/Lexer/common.hsinc
+++ b/yi-misc-modes/src/Yi/Lexer/common.hsinc
@@ -71,18 +71,6 @@ alex_scan_tkn' user orig_input len input s last_acc =
check_accs (AlexAccNone) = last_acc
check_accs (AlexAcc a ) = AlexLastAcc a input IBOX(len)
check_accs (AlexAccSkip) = AlexLastSkip input IBOX(len)
-#ifndef NO_ALEX_CONTEXTS
- check_accs (AlexAccPred a predx rest)
- | predx user orig_input IBOX(len) input
- = AlexLastAcc a input IBOX(len)
- | otherwise
- = check_accs rest
- check_accs (AlexAccSkipPred predx rest)
- | predx user orig_input IBOX(len) input
- = AlexLastSkip input IBOX(len)
- | otherwise
- = check_accs rest
-#endif The |
Yup! For me, I can confirm that running alex (via stack) on any of these files correctly generates these data constructors, they just don't exist in the common file. Furthermore, when I c/p'd this common.hsinc into one of the files and ran this, the error propagated to Also, it seems like common.hsinc is copy-pasta'd into all of the Lexer modules (see: yi-mode-haskell, yi-mode-javascript, yi-language) |
Note that |
I have no input except that we should strive to throw away all this Alex stuff at any cost. |
haha! In that case, I'll link #946 for posterity since that seems to be the preferred ticket. |
Nevermind, I found the bug and made a PR -- solved it by making a python-mode package (as a workaround), then slowly reintroducing new languages. @siddhanathan can you confirm that this fixes your issue? |
Wait, I have discovered now that |
I can now confirm that it doesn't compile To reproduce:
|
I found the issue/cause! A newer |
I also found that some lexers use the alex contexts (these do not contain
|
Nice going! Yes, I recall hpack (0.18.1) adding new |
I'm not sure where to put this (I remember seeing |
@stites After looking at #914 again I don't think that this can be solved with backpack or type classes. The problem lies in the fact that the lexers get generated by alex which declares its own data types during code generation, so it is necessary to include the common.hsinc file and it is not possible to make it a proper imported module. |
Just did git clone and stack build.
The text was updated successfully, but these errors were encountered: