Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsexplain
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verified Software
jsexplain
Commits
44eb6663
Commit
44eb6663
authored
9 years ago
by
Thomas Wood
Browse files
Options
Downloads
Patches
Plain Diff
Add list datatype into generator type table.
parent
4a8e3ef9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
generator/js_of_ast.ml
+8
-1
8 additions, 1 deletion
generator/js_of_ast.ml
generator/stdlib_ml/stdlib.mli
+6
-0
6 additions, 0 deletions
generator/stdlib_ml/stdlib.mli
with
14 additions
and
1 deletion
generator/js_of_ast.ml
+
8
−
1
View file @
44eb6663
...
...
@@ -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
*)
...
...
This diff is collapsed.
Click to expand it.
generator/stdlib_ml/stdlib.mli
+
6
−
0
View file @
44eb6663
(* 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment