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

SPT syntax tests succeed even if the parse result is ambiguous #41

Closed
molenzwiebel opened this issue Sep 7, 2021 · 2 comments
Closed
Assignees
Labels
C-Bug Category: bug. Not working as expected P-High Priority: high. Should take priority over low and non-prioritized

Comments

@molenzwiebel
Copy link
Contributor

Summary

A parse test that yields an ambiguous AST succeeds, whereas the same test in Spoofax 2 would fail.

What you did

SDF3:

Term.Lit = INT
Term.Add = Term "+" Term

SPT:

test ambiguous [[
3 + 1 + 2
]] parse succeeds

What you expected to happen

The test fails.

What actually happened

The test succeeds.

Context

  • Spoofax version: 0.11.6
  • Operating system & version: All

Additional information

Especially annoying because the WebLab tests for CS4200 still use Spoofax 2, so students end up having a solution that works in their own Eclipse but fails on WebLab (rightfully so, since it is ambiguous).

@molenzwiebel molenzwiebel added the C-Bug Category: bug. Not working as expected label Sep 7, 2021
@Gohla Gohla self-assigned this Sep 8, 2021
@Gohla Gohla added the P-High Priority: high. Should take priority over low and non-prioritized label Sep 8, 2021
@Gohla
Copy link
Member

Gohla commented Sep 8, 2021

I'm changing it to:

  • ParseSucceeds: parsing succeeds (produces AST & no error messages), is unambiguous, does not recover.
  • ParseFails: parsing fails (doesn't produce AST or produces error messages)
  • ParseAmbiguous: parsing succeeds (produces AST & no error messages), is ambiguous.

Do you think that is ok?

@Gohla
Copy link
Member

Gohla commented Sep 8, 2021

Fixed by c4be02c

@Gohla Gohla closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected P-High Priority: high. Should take priority over low and non-prioritized
Projects
None yet
Development

No branches or pull requests

2 participants