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

We accidentally lost the ability to detect ambiguities #438

Open
katef opened this issue Jun 28, 2023 · 4 comments
Open

We accidentally lost the ability to detect ambiguities #438

katef opened this issue Jun 28, 2023 · 4 comments
Assignees
Labels

Comments

@katef
Copy link
Owner

katef commented Jun 28, 2023

This should error:

; echo '/ab?c/ -> $t1; /abc/ -> $t2;' | ./build/bin/lx > /dev/null
; 

The error code is still there (calling fsm_example), but it's never reached.

Equivalent stuff in re(1), I'm suspicious about using just one element from the array in find_first_match_for_end_state(), rather than checking them all:

    return find_match_with_id(end_id_buf[0]);
@silentbicycle
Copy link
Collaborator

silentbicycle commented Jul 20, 2023

Do you have an example input & set of CLI flags handy for re? Otherwise I'll figure it out later.

@katef
Copy link
Owner Author

katef commented Aug 6, 2023

An equivalent case for re, -u should report the ambiguities
image

@silentbicycle
Copy link
Collaborator

On da28efb (the #439 branch) this appears to be working as expected:

$ echo '/abc*/ -> $t1; /abc/ -> $t2;' | build/bin/lx -ldot | todot
ambiguous mappings to $t1, $t2; for example on input 'abc'

out

Am I missing something?

@katef
Copy link
Owner Author

katef commented Jun 19, 2024

Oh I think fsm_example() is broken.

katef added a commit that referenced this issue Jun 19, 2024
I think at the time of writing, fsm_example() is broken, because I get no output here. Possibly related to #438
@katef katef self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants