Fixed missing stub in JS output

This commit is contained in:
Denis Merigoux 2021-04-02 17:57:44 +02:00
parent ceed5c06a2
commit c2eaf08daa
6 changed files with 1261 additions and 1229 deletions

View File

@ -45,7 +45,6 @@ Please look at the code of other examples to see how to format things properly.
While formatting the text, don't forget regularly to try and parse your example While formatting the text, don't forget regularly to try and parse your example
using for instance using for instance
``` ```
make -C examples/foo foo.tex make -C examples/foo foo.tex
``` ```
@ -92,13 +91,13 @@ You can look at the
[online OCaml documentation](https://catala-lang.org/ocaml_docs/) for the [online OCaml documentation](https://catala-lang.org/ocaml_docs/) for the
different modules' interfaces as well as high-level architecture documentation. different modules' interfaces as well as high-level architecture documentation.
Please note that the `ocamlformat` version the this project use is `0.17.0`. Please note that the `ocamlformat` version the this project use is `0.18.0`.
Using another version may cause spurious diffs to appear in your pull requests. Using another version may cause spurious diffs to appear in your pull requests.
## Internationalization ## Internationalization
The Catala language should be adapted to any legislative text that follows a The Catala language should be adapted to any legislative text that follows a
general-to-specifics statutes order. Therefore, there exists multiple versions general-to-specifics statutes order. Therefore, there exists multiple versions
of the Catala surface syntax, adapted to the language of the legislative text. of the Catala surface syntax, adapted to the language of the legislative text.
Currently, Catala supports English and French legislative text via the Currently, Catala supports English and French legislative text via the

View File

@ -10,12 +10,13 @@ K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(warning [WARNING] No "$(exec)" executable found. \ $(if $(shell which $(exec)),some string,$(warning [WARNING] No "$(exec)" executable found. \
Please install this executable for everything to work smoothly))) Please install this executable for everything to work smoothly)))
# The Zarith dependency is fixed because of https://github.com/janestreet/zarith_stubs_js/pull/8
dependencies-ocaml: dependencies-ocaml:
opam install \ opam install \
ocamlformat ANSITerminal sedlex menhir menhirLib dune cmdliner obelisk \ ocamlformat ANSITerminal sedlex menhir menhirLib dune cmdliner obelisk \
re obelisk unionfind bindlib zarith zarith_stubs_js ocamlgraph \ re obelisk unionfind bindlib zarith.1.11 zarith_stubs_js.v0.14.0 ocamlgraph \
js_of_ocaml-compiler js_of_ocaml js_of_ocaml-ppx calendar camomile \ js_of_ocaml-compiler js_of_ocaml js_of_ocaml-ppx calendar camomile \
visitors benchmark ocamlformat visitors benchmark
init-submodules: init-submodules:
git submodule update --init git submodule update --init

View File

@ -21,8 +21,8 @@ depends: [
"bindlib" {>= "5.0.1"} "bindlib" {>= "5.0.1"}
"cmdliner" {>= "1.0.4"} "cmdliner" {>= "1.0.4"}
"re" {>= "1.9.0"} "re" {>= "1.9.0"}
"zarith" {>= "1.10"} "zarith" {= "1.11"}
"zarith_stubs_js" {>= "0.14.0"} "zarith_stubs_js" {= "0.14.0"}
"dune" {>= "2.2"} "dune" {>= "2.2"}
"ocamlgraph" {>= "1.8.8"} "ocamlgraph" {>= "1.8.8"}
"calendar" {>= "2.04"} "calendar" {>= "2.04"}

View File

@ -29,8 +29,8 @@
(bindlib (>= 5.0.1)) (bindlib (>= 5.0.1))
(cmdliner (>= 1.0.4)) (cmdliner (>= 1.0.4))
(re (>= 1.9.0)) (re (>= 1.9.0))
(zarith (>= 1.10)) (zarith (= 1.11))
(zarith_stubs_js (>= 0.14.0)) (zarith_stubs_js (= 0.14.0))
(dune (>= 2.2)) (dune (>= 2.2))
(ocamlgraph (>= 1.8.8)) (ocamlgraph (>= 1.8.8))
(calendar (>= 2.04)) (calendar (>= 2.04))

File diff suppressed because one or more lines are too long

View File

@ -288,8 +288,8 @@ class virtual ['self] program_map :
method visit_Base : 'monomorphic. 'env -> base_typ -> typ method visit_Base : 'monomorphic. 'env -> base_typ -> typ
method visit_Binop : method visit_Binop :
'monomorphic. 'env -> binop Pos.marked -> expression Pos.marked -> expression Pos.marked -> 'monomorphic.
expression 'env -> binop Pos.marked -> expression Pos.marked -> expression Pos.marked -> expression
method visit_Boolean : 'monomorphic. 'env -> primitive_typ method visit_Boolean : 'monomorphic. 'env -> primitive_typ
@ -305,8 +305,13 @@ class virtual ['self] program_map :
method visit_Collection : 'monomorphic. 'env -> base_typ_data Pos.marked -> base_typ_data method visit_Collection : 'monomorphic. 'env -> base_typ_data Pos.marked -> base_typ_data
method visit_CollectionOp : method visit_CollectionOp :
'monomorphic. 'env -> collection_op Pos.marked -> ident Pos.marked -> expression Pos.marked -> 'monomorphic.
expression Pos.marked -> expression 'env ->
collection_op Pos.marked ->
ident Pos.marked ->
expression Pos.marked ->
expression Pos.marked ->
expression
method visit_Condition : 'monomorphic. 'env -> base_typ method visit_Condition : 'monomorphic. 'env -> base_typ
@ -333,16 +338,24 @@ class virtual ['self] program_map :
method visit_Div : 'monomorphic. 'env -> op_kind -> binop method visit_Div : 'monomorphic. 'env -> op_kind -> binop
method visit_Dotted : method visit_Dotted :
'monomorphic. 'env -> expression Pos.marked -> constructor Pos.marked option -> 'monomorphic.
ident Pos.marked -> expression 'env ->
expression Pos.marked ->
constructor Pos.marked option ->
ident Pos.marked ->
expression
method visit_Duration : 'monomorphic. 'env -> primitive_typ method visit_Duration : 'monomorphic. 'env -> primitive_typ
method visit_EnumDecl : 'monomorphic. 'env -> enum_decl -> code_item method visit_EnumDecl : 'monomorphic. 'env -> enum_decl -> code_item
method visit_EnumInject : method visit_EnumInject :
'monomorphic. 'env -> constructor Pos.marked option -> constructor Pos.marked -> 'monomorphic.
expression Pos.marked option -> expression 'env ->
constructor Pos.marked option ->
constructor Pos.marked ->
expression Pos.marked option ->
expression
method visit_Eq : 'monomorphic. 'env -> binop method visit_Eq : 'monomorphic. 'env -> binop
@ -375,8 +388,8 @@ class virtual ['self] program_map :
method visit_Ident : 'monomorphic. 'env -> ident -> expression method visit_Ident : 'monomorphic. 'env -> ident -> expression
method visit_IfThenElse : method visit_IfThenElse :
'monomorphic. 'env -> expression Pos.marked -> expression Pos.marked -> 'monomorphic.
expression Pos.marked -> expression 'env -> expression Pos.marked -> expression Pos.marked -> expression Pos.marked -> expression
method visit_Increasing : 'monomorphic. 'env -> variation_typ method visit_Increasing : 'monomorphic. 'env -> variation_typ
@ -475,8 +488,11 @@ class virtual ['self] program_map :
method visit_StructDecl : 'monomorphic. 'env -> struct_decl -> code_item method visit_StructDecl : 'monomorphic. 'env -> struct_decl -> code_item
method visit_StructLit : method visit_StructLit :
'monomorphic. 'env -> constructor Pos.marked -> 'monomorphic.
(ident Pos.marked * expression Pos.marked) list -> expression 'env ->
constructor Pos.marked ->
(ident Pos.marked * expression Pos.marked) list ->
expression
method visit_Sub : 'monomorphic. 'env -> op_kind -> binop method visit_Sub : 'monomorphic. 'env -> op_kind -> binop
@ -490,8 +506,12 @@ class virtual ['self] program_map :
method visit_Unop : 'monomorphic. 'env -> unop Pos.marked -> expression Pos.marked -> expression method visit_Unop : 'monomorphic. 'env -> unop Pos.marked -> expression Pos.marked -> expression
method visit_VariesWith : method visit_VariesWith :
'monomorphic. 'env -> qident Pos.marked -> expression Pos.marked -> 'monomorphic.
variation_typ Pos.marked option -> meta_assertion 'env ->
qident Pos.marked ->
expression Pos.marked ->
variation_typ Pos.marked option ->
meta_assertion
method visit_Year : 'monomorphic. 'env -> literal_unit method visit_Year : 'monomorphic. 'env -> literal_unit
@ -553,7 +573,8 @@ class virtual ['self] program_map :
method visit_match_case : 'monomorphic. 'env -> match_case -> match_case method visit_match_case : 'monomorphic. 'env -> match_case -> match_case
method visit_match_case_pattern : method visit_match_case_pattern :
'monomorphic. 'env -> 'monomorphic.
'env ->
(constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option -> (constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option ->
(constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option (constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option
@ -630,8 +651,8 @@ class virtual ['self] program_iter :
method visit_Base : 'monomorphic. 'env -> base_typ -> unit method visit_Base : 'monomorphic. 'env -> base_typ -> unit
method visit_Binop : method visit_Binop :
'monomorphic. 'env -> binop Pos.marked -> expression Pos.marked -> expression Pos.marked -> 'monomorphic.
unit 'env -> binop Pos.marked -> expression Pos.marked -> expression Pos.marked -> unit
method visit_Boolean : 'monomorphic. 'env -> unit method visit_Boolean : 'monomorphic. 'env -> unit
@ -646,8 +667,13 @@ class virtual ['self] program_iter :
method visit_Collection : 'monomorphic. 'env -> base_typ_data Pos.marked -> unit method visit_Collection : 'monomorphic. 'env -> base_typ_data Pos.marked -> unit
method visit_CollectionOp : method visit_CollectionOp :
'monomorphic. 'env -> collection_op Pos.marked -> ident Pos.marked -> expression Pos.marked -> 'monomorphic.
expression Pos.marked -> unit 'env ->
collection_op Pos.marked ->
ident Pos.marked ->
expression Pos.marked ->
expression Pos.marked ->
unit
method visit_Condition : 'monomorphic. 'env -> unit method visit_Condition : 'monomorphic. 'env -> unit
@ -672,16 +698,20 @@ class virtual ['self] program_iter :
method visit_Div : 'monomorphic. 'env -> op_kind -> unit method visit_Div : 'monomorphic. 'env -> op_kind -> unit
method visit_Dotted : method visit_Dotted :
'monomorphic. 'env -> expression Pos.marked -> constructor Pos.marked option -> 'monomorphic.
ident Pos.marked -> unit 'env -> expression Pos.marked -> constructor Pos.marked option -> ident Pos.marked -> unit
method visit_Duration : 'monomorphic. 'env -> unit method visit_Duration : 'monomorphic. 'env -> unit
method visit_EnumDecl : 'monomorphic. 'env -> enum_decl -> unit method visit_EnumDecl : 'monomorphic. 'env -> enum_decl -> unit
method visit_EnumInject : method visit_EnumInject :
'monomorphic. 'env -> constructor Pos.marked option -> constructor Pos.marked -> 'monomorphic.
expression Pos.marked option -> unit 'env ->
constructor Pos.marked option ->
constructor Pos.marked ->
expression Pos.marked option ->
unit
method visit_Eq : 'monomorphic. 'env -> unit method visit_Eq : 'monomorphic. 'env -> unit
@ -713,8 +743,8 @@ class virtual ['self] program_iter :
method visit_Ident : 'monomorphic. 'env -> ident -> unit method visit_Ident : 'monomorphic. 'env -> ident -> unit
method visit_IfThenElse : method visit_IfThenElse :
'monomorphic. 'env -> expression Pos.marked -> expression Pos.marked -> 'monomorphic.
expression Pos.marked -> unit 'env -> expression Pos.marked -> expression Pos.marked -> expression Pos.marked -> unit
method visit_Increasing : 'monomorphic. 'env -> unit method visit_Increasing : 'monomorphic. 'env -> unit
@ -810,8 +840,8 @@ class virtual ['self] program_iter :
method visit_StructDecl : 'monomorphic. 'env -> struct_decl -> unit method visit_StructDecl : 'monomorphic. 'env -> struct_decl -> unit
method visit_StructLit : method visit_StructLit :
'monomorphic. 'env -> constructor Pos.marked -> 'monomorphic.
(ident Pos.marked * expression Pos.marked) list -> unit 'env -> constructor Pos.marked -> (ident Pos.marked * expression Pos.marked) list -> unit
method visit_Sub : 'monomorphic. 'env -> op_kind -> unit method visit_Sub : 'monomorphic. 'env -> op_kind -> unit
@ -825,8 +855,8 @@ class virtual ['self] program_iter :
method visit_Unop : 'monomorphic. 'env -> unop Pos.marked -> expression Pos.marked -> unit method visit_Unop : 'monomorphic. 'env -> unop Pos.marked -> expression Pos.marked -> unit
method visit_VariesWith : method visit_VariesWith :
'monomorphic. 'env -> qident Pos.marked -> expression Pos.marked -> 'monomorphic.
variation_typ Pos.marked option -> unit 'env -> qident Pos.marked -> expression Pos.marked -> variation_typ Pos.marked option -> unit
method visit_Year : 'monomorphic. 'env -> unit method visit_Year : 'monomorphic. 'env -> unit
@ -887,7 +917,8 @@ class virtual ['self] program_iter :
method visit_match_case : 'monomorphic. 'env -> match_case -> unit method visit_match_case : 'monomorphic. 'env -> match_case -> unit
method visit_match_case_pattern : method visit_match_case_pattern :
'monomorphic. 'env -> 'monomorphic.
'env ->
(constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option -> (constructor Pos.marked option * constructor Pos.marked) list * ident Pos.marked option ->
unit unit