Skip to content

Implementation of Features from #489 #522

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

Merged
merged 8 commits into from
Apr 30, 2025
Merged

Implementation of Features from #489 #522

merged 8 commits into from
Apr 30, 2025

Conversation

koniksedy
Copy link
Collaborator

This PR extends the functionality of print_to_dot. And closes #489

It now:

  1. Merges multiple edges between two states and places a list of labels on the merged edge.
    Optional:
  2. Collapses contiguous sequences of symbols in labels into intervals.
  3. Truncates long labels (the full label can be seen when hovering over the edge).
  4. Removes all labels.

@koniksedy koniksedy requested review from jurajsic and Adda0 April 28, 2025 13:56
Copy link
Collaborator

@Adda0 Adda0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment on lines +452 to +455
switch (symbol) {
case EPSILON: return "<eps>";
default: break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simpler:

Suggested change
switch (symbol) {
case EPSILON: return "<eps>";
default: break;
}
if (symbol == EPSILON) {
return "<eps>";
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I put the switch there on purpose, so when we introduce new — I don't know how many — symbols, it won't become a mess of if-else statements.

@Adda0
Copy link
Collaborator

Adda0 commented Apr 30, 2025

Can we merge this PR, or do we plan to work on this more?

@koniksedy
Copy link
Collaborator Author

It's done. We can merge it.

@Adda0 Adda0 merged commit eaf5fc4 into devel Apr 30, 2025
15 checks passed
@Adda0 Adda0 deleted the nice_dot branch April 30, 2025 14:35
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.

Improve Readability of print_to_dot() Output
3 participants