Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,5 @@
LDA goto
SUB somewhere
ADD somewhereElse
STA goto
goto: JMP somewhere

View file

@ -0,0 +1,19 @@
PROGRAM GOTO_ERR
LABEL 99,100
PROCEDURE P1
INPUT(I)
IF I=0 THEN GOTO 99 END IF
END PROCEDURE
PROCEDURE P2
99: PRINT("I'm in procdedure P2")
END PROCEDURE
BEGIN
100:
INPUT(J)
IF J=1 THEN GOTO 99 END IF
IF J<>0 THEN GOTO 100 END IF
END PROGRAM

View file

@ -0,0 +1,50 @@
' FB 1.05.0 Win64
' compiled with -lang fb (the default) and -e switches
Sub MySub()
Goto localLabel
Dim a As Integer = 10 '' compiler warning that this variable definition is being skipped
localLabel:
Print "localLabel reached"
Print "a = "; a '' prints garbage as 'a' is uninitialized
End Sub
Sub MySub2()
On Error Goto handler
Open "zzz.zz" For Input As #1 '' this file doesn't exist!
On Error Goto 0 '' turns off error handling
End
handler:
Dim e As Integer = Err '' cache error number before printing message
Print "Error number"; e; " occurred - file not found"
End Sub
Sub MySub3()
Dim b As Integer = 2
On b Goto label1, label2 '' jumps to label2
label1:
Print "Label1 reached"
Return '' premature return from Sub
label2:
Print "Label2 reached"
End Sub
Sub MySub4()
Dim c As Integer = 3
If c = 3 Goto localLabel2 '' better to use If ... Then Goto ... in new code
Print "This won't be seen"
localLabel2:
Print "localLabel2 reached"
End Sub
MySub
MySub2
MySub3
MySub4
Print
Print "Pres any key to quit"
Print

View file

@ -0,0 +1,20 @@
include "ConsoleWindow"
print "First line."
gosub "sub1"
print "Fifth line."
goto "Almost over"
"sub1"
print "Second line."
gosub "sub2"
print "Fourth line."
return
"Almost over"
print "We're just about done..."
goto "Outa here"
"sub2"
print "Third line."
return
"Outa here"
print "... with goto and gosub, thankfully."
end

View file

@ -0,0 +1,8 @@
on foo
abort()
end
on bar ()
foo()
put "This will never be printed"
end

View file

@ -0,0 +1,12 @@
on testPlayDone ()
-- Start some asynchronous process (like e.g. a HTTP request).
-- The result might be saved in some global variable, e.g. in _global.result
startAsyncProcess()
-- pauses execution of current function
play(_movie.frame)
-- The following will be executed only after 'play done' was called in the asynchronous process code
put "Done. The asynchronous process returned the result:" && _global.result
end

View file

@ -0,0 +1,5 @@
block outer:
for i in 0..1000:
for j in 0..1000:
if i + j == 3:
break outer

View file

@ -0,0 +1,3 @@
#ilASM{ jmp :%somelabel }
...
#ilASM{ :%somelabel }

View file

@ -0,0 +1,3 @@
#ilASM{ jmp :local
...
::local }

View file

@ -0,0 +1,5 @@
#ilASM{ jmp @f
...
@@:
...
jle @b }

View file

@ -0,0 +1,14 @@
#ilASM{ call :!optlbl
[32]
pop eax
[64]
pop rax
[]
...
:!optlbl
[32]
push dword[esp]
[64]
push qword[rsp]
[]
ret }

View file

@ -0,0 +1 @@
#ilASM{ :>init }

View file

@ -0,0 +1,2 @@
10000000000000000000000000000000 0. 1 to CI
11001000000000000000000000000000 1. 19

View file

@ -0,0 +1,2 @@
10000000000001000000000000000000 0. Add 1 to CI
00100000000000000000000000000000 1. 4

View file

@ -0,0 +1 @@
label $out | ... break $out ...

View file

@ -0,0 +1 @@
label $out | 1e7 | while(true; .+1) | if (1/.) | . == sin then (., break $out) else empty end

View file

@ -0,0 +1 @@
1e7 | until(1/. | . == sin; .+1)