Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main with fixes #28

Merged
merged 4 commits into from
May 9, 2024
Merged
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protect:

.PHONY: README
README:
$(PY) readme.py
$(PY) readme.py || echo "==> Failed to create README.md: ./main does not exist"

.PHONY: test
test: build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
![CI Status](https://github.com/ethanuppal/cs3110_compiler/actions/workflows/ci.yaml/badge.svg)

> "x86 is simple trust me bro"
> Last updated: 2024-05-07 11:28:52.101596
> Last updated: 2024-05-08 22:10:33.402786

```
$ ./main -h
Expand Down
9 changes: 9 additions & 0 deletions lib/core/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ let merge_paths paths =
|> List.filter (( = ) "" >> not)
|> String.concat "/"

(** [basename path] is largest suffix of [path] not containing the character
['/']. *)
let basename =
let rec basename_aux = function
| [] | '/' :: _ -> ""
| head :: tail -> basename_aux tail ^ String.make 1 head
in
String.to_seq >> List.of_seq >> List.rev >> basename_aux

(** [pp_of string_of] is a pretty printer for a type with the string conversion
function [string_of] that simply prints the result of [string_of] inline. *)
let pp_of string_of fmt x = Format.fprintf fmt "%s" (string_of x)
Expand Down
Loading