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
17975b93
Commit
17975b93
authored
9 years ago
by
Thomas Wood
Browse files
Options
Downloads
Patches
Plain Diff
Begin functor implementation
parent
ef62a085
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generator/js_of_ast.ml
+3
-2
3 additions, 2 deletions
generator/js_of_ast.ml
with
3 additions
and
2 deletions
generator/js_of_ast.ml
+
3
−
2
View file @
17975b93
...
...
@@ -208,8 +208,8 @@ and js_of_submodule m =
let
loc
=
m
.
mod_loc
in
match
m
.
mod_desc
with
|
Tmod_structure
s
->
ppf_module
(
js_of_structure
s
)
|
Tmod_functor
(
id
,
_
,
mtyp
,
mexp
)
->
ppf_function
(
ppf_ident
id
)
(
js_of_submodule
mexp
)
|
Tmod_ident
_
->
out_of_scope
loc
"module ident"
|
Tmod_functor
_
->
out_of_scope
loc
"module functor"
|
Tmod_apply
_
->
out_of_scope
loc
"module apply"
|
Tmod_constraint
_
->
out_of_scope
loc
"module constraint"
|
Tmod_unpack
_
->
out_of_scope
loc
"module unpack"
...
...
@@ -225,7 +225,7 @@ and js_of_structure_item s =
|
Tstr_type
_
->
""
(* Types have no representation in JS, but the OCaml type checker uses them *)
|
Tstr_open
_
->
""
(* Handle modules by use of multiple compilation/linking *)
|
Tstr_modtype
_
->
""
|
Tstr_module
(
b
)
->
ppf_decl
(
ppf_ident
b
.
mb_id
)
(
js_of_submodule
b
.
mb_expr
)
|
Tstr_module
b
->
ppf_decl
(
ppf_ident
b
.
mb_id
)
(
js_of_submodule
b
.
mb_expr
)
|
Tstr_primitive
_
->
out_of_scope
loc
"primitive functions"
|
Tstr_typext
_
->
out_of_scope
loc
"type extensions"
|
Tstr_exception
_
->
out_of_scope
loc
"exceptions"
...
...
@@ -333,6 +333,7 @@ and js_of_longident loc =
and
ident_of_pat
pat
=
match
pat
.
pat_desc
with
|
Tpat_var
(
id
,
_
)
->
ppf_ident
id
|
Tpat_any
->
""
|
_
->
error
~
loc
:
pat
.
pat_loc
"functions can't deconstruct values"
and
js_of_let_pattern
pat
expr
=
...
...
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