Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ EXTENSION=native
all:
eval `opam config env`
ocamlbuild -use-ocamlfind \
-I src/ \
-pkgs '$(PACKAGES)' \
-use-menhir \
-cflags '$(CFLAGS)' $(NAME).$(EXTENSION)
Expand All @@ -17,9 +18,10 @@ deps:
opam install $(PACKAGES)

# For giving out to student prefer giving an url to the git project.
archiveLastest:
archiveLatest:
git archive -o cmicrojsML-${shell git rev-parse HEAD}.zip HEAD

clean:
ocamlbuild -clean

.PHONY: all deps archiveLatests clean
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# kitty-lang
An other toy compiler in Ocaml, made with Menhir and Ocamlex for 3I018 compilation course at university
An other toy compiler in OCaml, made with Menhir and Ocamlex for 3I018 compilation course at university

## Build
```shell
ocamlbuild -use-ocamlfind -use-menhir 'main.native'
make
```
File renamed without changes.
2 changes: 1 addition & 1 deletion ast.ml → src/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ let rec string_of_expr = function
(string_of_expr init)
(string_of_expr body))
| Seq (left, right) ->
(Printf.sprintf "%s ; %s"
(Printf.sprintf "%s;\n%s"
(string_of_expr left)
(string_of_expr right))
| Fun (id, args, body) ->
Expand Down
4 changes: 2 additions & 2 deletions kittylang.ml → src/kittylang.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let select_action parse compile expand =
|> result_string
|> Printf.sprintf "Parsed program:%s")
else if expand then
failwith "-expand Not implemented"
failwith "--expand Not implemented"
(*
(fun prog ->
Expander.expand_prog prog
Expand All @@ -79,7 +79,7 @@ let select_action parse compile expand =
|> P.sprintf "Kernal Abstract Syntax Tree:%s")
*)
else if compile then
failwith "-compile Not implemented"
failwith "--compile Not implemented"
(*
(fun prog ->
compile_prog prog
Expand Down
File renamed without changes.
File renamed without changes.