Commit cd964f02 authored by POTTIER Francois's avatar POTTIER Francois

Change [Infer.ntvar] to return a type, not a string. Do not export...

Change [Infer.ntvar] to return a type, not a string. Do not export [CodePieces.ntvar], which is unused.
parent 80efb6aa
......@@ -87,7 +87,7 @@ let semvtypent nt =
can't happen. However, running type inference is only an
option, so we still have to deal with that case. *)
TypVar (ntvar nt)
ntvar nt
| Some ocamltype ->
......
......@@ -22,10 +22,6 @@ open Grammar
(* Naming conventions. *)
(* The type variable associated with a nonterminal [nt]. *)
val ntvar : Nonterminal.t -> string
(* The variable that holds the environment. This is a parameter to all
functions. We do not make it a global variable because we wish to
preserve re-entrancy. *)
......
......@@ -26,7 +26,7 @@ open TokenType
cannot clash with OCaml keywords. *)
let ntvar symbol =
Printf.sprintf "tv_%s" (Misc.normalize symbol)
TypVar (Printf.sprintf "tv_%s" (Misc.normalize symbol))
(* The term variable associated with a nonterminal symbol. Its name begins
with a prefix which ensures that it begins with a lowercase letter and
......@@ -73,7 +73,7 @@ let nttype grammar nt =
try
TypTextual (StringMap.find nt grammar.types)
with Not_found ->
TypVar (ntvar nt)
ntvar nt
(* [is_standard] determines whether a branch derives from a standard
library definition. The method, based on a file name, is somewhat
......
......@@ -16,7 +16,7 @@ open BasicSyntax
(* [ntvar symbol] is the name of the type variable associated with a
nonterminal symbol. *)
val ntvar: string -> string
val ntvar: string -> IL.typ
(* [infer grammar] analyzes the grammar [grammar] and returns a new
grammar, augmented with a [%type] declaration for every nonterminal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment