-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add printString support to legacy C backend
- Loading branch information
1 parent
64f1265
commit fce2aae
Showing
12 changed files
with
74 additions
and
10 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
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
Binary file not shown.
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,8 @@ | ||
module LitStringIO; | ||
|
||
open import Stdlib.Prelude; | ||
|
||
main : IO; | ||
main := printStringLn "hello"; | ||
|
||
end; |
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 @@ | ||
hello |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Input; | ||
|
||
open import Stdlib.Prelude; | ||
open import Stdlib.Data.Nat.Ord; | ||
|
||
boolToNat : Bool → Nat; | ||
boolToNat false := zero; | ||
boolToNat true := suc zero; | ||
|
||
mult : Nat → Nat → Nat; | ||
mult zero _ := zero; | ||
mult (suc n) m := m + (mult n m); | ||
|
||
main : IO; | ||
main := printNatLn (boolToNat true) | ||
>> printNatLn (boolToNat false) | ||
>> printNatLn (mult 3 (2 + 2)) | ||
>> printNatLn 2 | ||
>> printNatLn (if (1 == 2) 100 200) | ||
>> printNatLn (if (1 == 1) 300 400) | ||
>> if (1 == 2) (printNatLn 500) (printNatLn 600) | ||
>> if (1 == 1) (printNatLn 700) (printNatLn 800); | ||
|
||
end; |
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,8 @@ | ||
1 | ||
0 | ||
12 | ||
2 | ||
200 | ||
300 | ||
600 | ||
700 |
Empty file.