-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
156 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Error if `DIM z(size)` isn't called before usage | ||
|
||
``` | ||
100 PROC x(a(),size,2) TO result:PRINT result:STOP | ||
110 DEFPROC x(inp(),size,y) | ||
120 LOCAL z(),tot | ||
130 DIM z(size) | ||
140 tot=0 | ||
150 FOR i=1 TO size:z(i)=inp(i)*y:NEXT i | ||
160 FOR i=1 TO size:tot=tot+z(i):NEXT i | ||
170 ENDPROC = tot | ||
``` | ||
|
||
|
||
|
||
--- | ||
|
||
|
||
Test defaults in defproc: | ||
|
||
``` | ||
100 PROC x(12,,"bob"):STOP | ||
110 DEFPROC x(a=1,b$="alice",c$,d=-5) | ||
120 LOCAL e=3 | ||
130 PRINT a,b$,c$,d,e | ||
140 ENDPROC | ||
``` | ||
|
||
--- | ||
|
||
## Validation | ||
|
||
- Validate missing `ENDIF` | ||
- `IF 0` alone should fail … right? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ export const opTable = Object.entries(codes).reduce( | |
GOSUB: 0xed, | ||
RAND: 0xf9, | ||
CONT: 0xe8, | ||
'ELSE IF': 0x83, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters