CodingTrain / CodingTrain/Nebula-AppleSoft-Basic
snake_expanded.a: Line 7010: LE THEN parsed as LET HEN
- Lingua principale
- BASIC
- Stelle
- 51
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Was the code written and/or tested on a real physical Apple II only, or was an emulator also used?
Using `LE` as a variable name causes issues with the parsing and becomes `LET HEN` when `LIST`ed. I have only tested this on a number of emulators and the result is the same - however, I can't test this on a physical machine (as I don't have access to one).
I *assume* that you didn't see this issue, because you tested it on a physical machine rather than an emulator (strange I know and they should both be the same) and on the physical machine the issue did not manifest itself?
Please see [Does AppleSoft BASIC really parse "LE THEN" as "LET HEN"?](https://retrocomputing.stackexchange.com/q/31413/202).
[![LET HEN][1]][1]
### Solution
As pointed out by [this comment](https://retrocomputing.stackexchange.com/questions/31413/does-applesoft-basic-really-parse-le-then-as-let-hen/31416?noredirect=1#comment114079_31416), the change was made here, [#1 Change buffer to be used like a ring buffer. #5](https://github.com/CodingTrain/Nebula-AppleSoft-Basic/pull/5/files) and this [Update snake.a #8](https://github.com/CodingTrain/Nebula-AppleSoft-Basic/pull/8) states that the calormen JS emulator was used, which seems to have [a parsing bug](https://retrocomputing.stackexchange.com/a/31416/202), see [LE THEN GOTO should be parsed as LET HEN GOTO #51](https://github.com/inexorabletash/jsbasic/issues/51).
The fix is to use parentheses around the `LE`, changing
```none
7010 IF LS > LE THEN GOTO 7060
```
to
```none
7010 IF LS > (LE) THEN GOTO 7060
```
##### Alternative fixes
```none
7010 IF LE < LS THEN GOTO 7060
```
or
```none
7010 IF LS > LE GOTO 7060
```
Now the code will work on a real Apple II!
:-)
[1]: https://i.sstatic.net/2nRW1cM6.png "LET HEN"
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia alla riga 7010 di snake_expanded.a e confronta la condizione elencata con il comportamento di parsing di AppleSoft BASIC descritto nell’issue. Verifica la riga corretta elencando o eseguendo il programma in un ambiente o emulatore AppleSoft BASIC; il lavoro è completato quando non appare più come “LET HEN” e funziona su un Apple II reale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100