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

Fixed typo in line 47 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gregvinyard
Copy link

The original statement, "x=0 :out=ifa" makes no sense as the :out assignment makes no reference to x.

The original statement, "x=0 :out=ifa" makes no sense as the :out assignment makes no reference to x.
@martindevans
Copy link
Collaborator

Did you double check this result in game to make sure it still produces the expected value?

@gregvinyard
Copy link
Author

I did not, originally. It just didn't make sense to assign 0 to x, and then not use x. I did just do some testing, and the whole line seems fishy now. You can put anything after the "if" and :out will still equal 0.

x=0 :out=ifa -> 0
x=0 :out=ifx -> 0
x=0 :out=if1 -> 0
x=0 :out=if(1) -> 0
x=1 :out=ifx -> 0

I think the issue is "if" doesn't return anything that can be assigned to the variable :out.

image

@dbaumgarten
Copy link
Contributor

I think originally this line was intended to test yolol's weird Contest-sensitive parsing.
Code sometimes parses differently depending on if some variable has been previously used or not.
(These lines had been tested one by one, so during testing that line "a" was not assigned).

Also: The whole line IS fishy. Any variable containing a keyword will break things. "ifa" contains "if" and therefore causes a parser-error.

@gregvinyard
Copy link
Author

In that case, the line seems like it's testing two things. One, whether using the keyword "if" will cause a parsing error and two, if using an undeclared variable will cause an error.

If that's the case then it makes more sense to have two lines so you're only doing one test at a time:
x=0 :out=a -> 0
x=0 :out=ifx -> 0

Either that or I am missing something, which is completely possible. 😅

@dbaumgarten
Copy link
Contributor

Yes, splitting it in different tests would probably be good.
Additionally the test-case with "ifx" should have a check to verify that the remaining part of the line is actually skipped.

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.

3 participants