Skip to content
Snippets Groups Projects
Commit 44eb6663 authored by Thomas Wood's avatar Thomas Wood
Browse files

Add list datatype into generator type table.

parent 4a8e3ef9
No related branches found
No related tags found
No related merge requests found
......@@ -14,13 +14,20 @@ open Types
open Typedtree
let hashtbl_size = 256
(* val type_tbl : (string, string list * string list) Hashtbl.t
* Mapping constructor names to a pair of module list and constructor names list *)
let type_tbl = Hashtbl.create hashtbl_size
(* Hard-code the special-syntax of the list datatype *)
let _ = Hashtbl.add type_tbl "[]" ([], [])
let _ = Hashtbl.add type_tbl "::" ([], ["head"; "tail"])
let record_tbl = Hashtbl.create hashtbl_size
let module_list = ref []
let module_code = ref []
let module_created = ref []
module L = Logged (Token_generator) (struct let size = 256 end)
(**
* Debug-purpose functions
*)
......
(* Following type definition for lists hardcoded into OCaml/generator:
type 'a list =
| []
| :: [@f head, tail] of 'a * 'a list
*)
val add : 'a -> 'b -> 'c
val ( + ) : 'a -> 'b -> 'c
val sub : 'a -> 'a -> 'a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment