-
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.
- Loading branch information
1 parent
30896fc
commit ab607e7
Showing
4 changed files
with
28 additions
and
4 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[@@@warning "-27"] | ||
[@@@warning "-27"] | ||
|
||
type ty = Syntax.Parsetree.type_expr | ||
|
||
|
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
(pps ppx_sexp_conv))) | ||
|
||
(env | ||
(dev | ||
(flags (:standard -w -32)))) | ||
(dev | ||
(flags | ||
(:standard -w -32)))) |
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 +1,22 @@ | ||
type t | ||
open Types | ||
|
||
type t = { | ||
values : (string * ty) list; | ||
types : ty_def list; | ||
modules : (string * mod_ty) list; | ||
} | ||
|
||
let add_value x ty env = { env with values = (x, ty) :: env.values } | ||
|
||
let add_module m ty env = { env with modules = (m, ty) :: env.modules } | ||
|
||
let add_type_def def env = { env with types = def :: env.types } | ||
|
||
let get_value_type x env = List.assoc x env.values | ||
|
||
let get_module_sig m env = List.assoc m env.modules | ||
|
||
let get_type_def tn env = | ||
List.find | ||
(function Syntax.Parsetree.TDAdt (x, _, _) | TDAlias (x, _) -> x = tn) | ||
env.types |
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,3 +1,5 @@ | ||
type ty = Syntax.Parsetree.type_expr | ||
|
||
type mod_ty = Syntax.Parsetree.mod_type | ||
|
||
type ty_def = Syntax.Parsetree.type_def |