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

Any ; at the end of if-else statement should be ignored #23

Open
LeeKaiXuan opened this issue Oct 7, 2024 · 0 comments
Open

Any ; at the end of if-else statement should be ignored #23

LeeKaiXuan opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@LeeKaiXuan
Copy link
Collaborator

Description

When accidentally adding an extra semicolon (i.e., ;) at the end of the if-else statement, PSSGen will be traversed incorrectly and any previous action may be re-executed.

Scenario Code

component pss_top {
    action root_a {
        activity {
            do printStr with { str == "normal"; };
            if (1) {
                do print1;
            };
        }
    }

    action printStr {
        rand string str;
        exec body ASM = """printStr: {{str}}""";
    }

    action print1 {
        exec body ASM = """print1""";
    }

}

Expected Output or Behaviour

test.s.golden:

printStr: normal
print1

Error Message from PSSGen or JAVA

test.s:

printStr: normal
print1
printStr: normal

Error Message:

3d2
< printStr: normal
Test Result: FAIL
@LeeKaiXuan LeeKaiXuan added the bug Something isn't working label Oct 7, 2024
@LeeKaiXuan LeeKaiXuan self-assigned this Oct 7, 2024
LeeKaiXuan added a commit that referenced this issue Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant