Skip to content

LE THEN GOTO should be parsed as LET HEN GOTO #51

Closed as not planned
Closed as not planned
@greenonline

Description

@greenonline

This is related to this answer to Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?.

It turns out then someone was using this emulator to develop some code, and came up with the following line:

7010 IF LS > LE THEN GOTO  7060

They then submitted the code, snake_expanded.a, to a repo. However, this code breaks on a real Apple II, and most other emulators.

It breaks because the line should be parsed as

7010 IF LS > LET HEN GOTO  7060

A screenshot illustrating the "correct" behaviour (as implemented by Applesoft):

Screenshot

The correct line would be

7010 IF LS > (LE) THEN GOTO  7060

See this answer for an explanation of the parentheses.

Unfortunately, your emulator does not pick up on that error, and any code runs as expected, although contrary to Applesoft's implementation.

The point is that code developed on this emulator, that suffers this parsing issue, might not work on a real Apple II, as snake_expanded.a illustrates.

Note: This PR states that the change was developed on this emulator.


Vaguely related, this is the issue raised against the BASIC code, snake_expanded.a: Line 7010: LE THEN parsed as LET HEN #9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions