-
Notifications
You must be signed in to change notification settings - Fork 5
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
9 changed files
with
77 additions
and
18 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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
*.o | ||
*.jsmod | ||
.stack-work | ||
*.cmi | ||
*.cmx | ||
a.out |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import System.Environment | ||
import System.IO | ||
|
||
import Parser (parse) | ||
import Transpiler (transpile) | ||
|
||
main :: IO () | ||
main = do | ||
cont <- getContents | ||
args <- getArgs | ||
cont <- case args of | ||
(h:_) -> readFile h | ||
[] -> getContents | ||
putStrLn $ case (parse cont) of | ||
Right ast -> transpile ast | ||
Left error -> show error |
Large diffs are not rendered by default.
Oops, something went wrong.
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,17 @@ | ||
定曰為print_string。 | ||
定名為string_of_int。 | ||
定加為(+)。 | ||
定減為(-)。 | ||
定等為(==)。 | ||
定零為0。 | ||
定一為1。 | ||
定改-行為print_newline。 | ||
定読為read_line。 | ||
定読-数為read_int。 | ||
|
||
曰「にーはお、世界」。呼改-行。 | ||
定再 階-加 数 為 | ||
若 等数零 | ||
寧 零 | ||
無 加数 所 減数一、階-加 也。 | ||
呼読-数、階-加、名、曰。呼改-行。 |
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