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

Fixed crash in issue 71 #152

Merged
merged 4 commits into from
Jan 25, 2020
Merged

Fixed crash in issue 71 #152

merged 4 commits into from
Jan 25, 2020

Conversation

andreasabel
Copy link
Member

[ #71 ] Fixed crash in DFAMin

DFA minimization used to crash on tokens of the form c* which produce
automata with only accepting states. Considering the empty set of
non-accepting states as an equivalence class caused minimization to
crash with exception

Prelude.head: empty list

Now, DFA minimization succeeds.

There is still a problem with nullable tokens like c*. Alex produces an
infinite token sequence at the end of the input.

@simonmar
Copy link
Member

I'm not really a fan of all the local definitions of head. Doesn't profiling work to debug head [] when it happens?

(but thanks for diagnosing and fixing the bug!)

To increase documentation and readability, I added type signatures also
to some local definitions.

Needs language extension ScopedTypeVariables.
DFA minimization used to crash on tokens of the form c* which produce
automata with only accepting states.  Considering the empty set of
non-accepting states as an equivalence class caused minimization to
crash with exception

  Prelude.head: empty list

Now, DFA minimization succeeds.

There is still a problem with nullable tokens like c*.  Alex produces an
infinite token sequence at the end of the input.
@andreasabel
Copy link
Member Author

I'm not really a fan of all the local definitions of head.

Ok, understood. I deleted the patch that does the local head definitions. I also rebased this PR onto the latest master.

Doesn't profiling work to debug head [] when it happens?

I am yet lacking profiling skills, I am afraid.

@simonmar simonmar merged commit 0198f73 into haskell:master Jan 25, 2020
@simonmar
Copy link
Member

Thanks!

@andreasabel andreasabel deleted the issue71 branch January 25, 2020 17:10
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