From 9c51073bca8a4c10d9819a8cd01d105298a248c7 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 31 Dec 2017 16:41:04 +0100 Subject: [PATCH] Introduced directory structure --- Basis.ml => Basis/Basis.ml | 0 Basis_lexer.mll => Basis/Basis_lexer.mll | 0 Basis_parser.mly => Basis/Basis_parser.mly | 0 Makefile | 11 +++++------ Angular_momentum.ml => Utils/Angular_momentum.ml | 5 +++-- Angular_momentum.mli => Utils/Angular_momentum.mli | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename Basis.ml => Basis/Basis.ml (100%) rename Basis_lexer.mll => Basis/Basis_lexer.mll (100%) rename Basis_parser.mly => Basis/Basis_parser.mly (100%) rename Angular_momentum.ml => Utils/Angular_momentum.ml (88%) rename Angular_momentum.mli => Utils/Angular_momentum.mli (73%) diff --git a/Basis.ml b/Basis/Basis.ml similarity index 100% rename from Basis.ml rename to Basis/Basis.ml diff --git a/Basis_lexer.mll b/Basis/Basis_lexer.mll similarity index 100% rename from Basis_lexer.mll rename to Basis/Basis_lexer.mll diff --git a/Basis_parser.mly b/Basis/Basis_parser.mly similarity index 100% rename from Basis_parser.mly rename to Basis/Basis_parser.mly diff --git a/Makefile b/Makefile index b55ad70..210eda4 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,11 @@ LIBS= PKGS= OCAMLCFLAGS="-g" -OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -MLLFILES=$(wildcard *.mll) -MLYFILES=$(wildcard *.mly) -MLFILES=$(wildcard *.ml) -MLIFILES=$(wildcard *.mli) -ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml)) +OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -I Utils -I Basis +MLLFILES=$(wildcard */*.mll) $(wildcard *.mll) +MLYFILES=$(wildcard */*.mly) $(wildcard *.mly) +MLFILES= $(wildcard */*.ml) $(wildcard *.ml) +MLIFILES=$(wildcard */*.mli) $(wildcard *.mli) ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml)) .PHONY: default diff --git a/Angular_momentum.ml b/Utils/Angular_momentum.ml similarity index 88% rename from Angular_momentum.ml rename to Utils/Angular_momentum.ml index 7ec8dd9..6538d98 100644 --- a/Angular_momentum.ml +++ b/Utils/Angular_momentum.ml @@ -1,4 +1,4 @@ -exception AngularMomentumError of char +exception AngularMomentumError of string type t = | S | P | D | F | G | H | I | J | K | L | M | N | O @@ -11,7 +11,7 @@ let of_char = function | 'k' | 'K' -> K | 'l' | 'L' -> L | 'm' | 'M' -> M | 'n' | 'N' -> N | 'o' | 'O' -> O - | c -> raise (AngularMomentumError c) + | c -> raise (AngularMomentumError (String.make 1 c)) let to_string = function | S -> "S" | P -> "P" @@ -48,6 +48,7 @@ let of_int = function | 8 -> K | 9 -> L | 10 -> M | 11 -> N | 12 -> O + | c -> raise (AngularMomentumError (string_of_int c)) diff --git a/Angular_momentum.mli b/Utils/Angular_momentum.mli similarity index 73% rename from Angular_momentum.mli rename to Utils/Angular_momentum.mli index 09512b8..c13b6bc 100644 --- a/Angular_momentum.mli +++ b/Utils/Angular_momentum.mli @@ -1,4 +1,4 @@ -exception AngularMomentumError of char +exception AngularMomentumError of string type t = S | P | D | F | G | H | I | J | K | L | M | N | O val of_char : char -> t val to_string : t -> string