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 · 3 comments
Open

We accidentally lost the ability to detect ambiguities #438

katef opened this issue Jun 28, 2023 · 3 comments
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?

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