-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: restructure AST and everything else :)
- Loading branch information
Showing
25 changed files
with
960 additions
and
592 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[@@@ocaml.text "/*"] | ||
|
||
(** Copyright 2024, Andrei, PavlushaSource *) | ||
|
||
(** SPDX-License-Identifier: MIT *) | ||
|
||
[@@@ocaml.text "/*"] | ||
|
||
open! Base | ||
|
||
(** Identifiers *) | ||
module Id = struct | ||
type t = I of string [@@deriving show {with_path= false}] | ||
end | ||
|
||
(** List containing at least 1 element *) | ||
module List1 = struct | ||
type 'a t = 'a * 'a list [@@deriving show {with_path= false}] | ||
|
||
let of_list_exn : 'a list -> 'a t = function | ||
| hd :: tl -> | ||
(hd, tl) | ||
| [] -> | ||
raise (Invalid_argument "empty list") | ||
end | ||
|
||
(** List containing at least 2 elements *) | ||
module List2 = struct | ||
type 'a t = 'a * 'a * 'a list [@@deriving show {with_path= false}] | ||
|
||
let of_list_exn : 'a list -> 'a t = function | ||
| fst :: snd :: tl -> | ||
(fst, snd, tl) | ||
| _ :: [] | [] -> | ||
raise (Invalid_argument "not enough elements") | ||
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 @@ | ||
(library | ||
(name LMisc) | ||
(public_name NeML.Misc) | ||
(libraries base) | ||
(preprocess | ||
(pps ppx_deriving.show)) | ||
(instrumentation | ||
(backend bisect_ppx))) |
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
Oops, something went wrong.