Skip to content

Take over changes from 10.1 release into master #5771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 81 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
dfe4618
CI build on 10.1_release branch (#5693)
cknitt Sep 24, 2022
b142eb6
Copy syntax changelog so it's visible in version control.
cristianoc Sep 24, 2022
549c7a5
sync syntax
cristianoc Sep 24, 2022
145ec50
sync syntax: fix location of make in JSX V4
cristianoc Sep 28, 2022
81c7caf
Add extra variants for suffixes in bsconfig.json
nkrkv Sep 1, 2022
03a4f59
Step back and revoke `.res.*` suffix options
nkrkv Sep 28, 2022
5639270
Refactor: sort filename suffixes for better readability
nkrkv Sep 29, 2022
19760da
Update CHANGELOG.md
cristianoc Sep 29, 2022
60e2541
sync syntax
cristianoc Sep 29, 2022
7dbcc93
remove JsxDOM.props
mununki Oct 1, 2022
898db5b
Add some missing DOM props
cknitt Oct 1, 2022
0328c92
jsxDom: Fix typo in aria-level
fhammerschmidt Sep 26, 2022
ab3f687
Alllow .res files in stdlib (#5714)
cristianoc Oct 3, 2022
cddfc41
Install .res files too.
cristianoc Oct 3, 2022
ac72301
JsxDOMStyle.t: add backgroundFilter prop (#5716)
cknitt Oct 3, 2022
d768a7d
Fix build / prettier (#5717)
cknitt Oct 3, 2022
708ff62
shell matters
cristianoc Oct 3, 2022
0bc4815
Fix issue where uncurried async functions were emitted without `async`
cristianoc Oct 3, 2022
2324e1b
Safe promises
cristianoc Oct 1, 2022
a47332a
artifacts
cristianoc Oct 1, 2022
e470411
Update CHANGELOG.md
cristianoc Oct 1, 2022
fb26217
catch without underscore
cristianoc Oct 1, 2022
a6ad1b1
Use `then` in `a .res` file.
cristianoc Oct 3, 2022
6dd3232
Rename `then` in example.
cristianoc Oct 3, 2022
5ddce37
artifacts
cristianoc Oct 3, 2022
ab7985b
shell not needed?
cristianoc Oct 3, 2022
0cdc4b0
then_ deprecated
cristianoc Oct 3, 2022
5bb465a
Make Js.Promise2 self contained.
cristianoc Oct 3, 2022
6bc1e03
Remove then_
cristianoc Oct 3, 2022
cc00c23
rewrite jsxDOM.ml to res
mununki Oct 4, 2022
f437da8
remove jsxDOM.ml
mununki Oct 4, 2022
1adf595
snapshot
mununki Oct 4, 2022
d4c0694
Done `make artifacts`
cristianoc Oct 4, 2022
18b42a2
fix missing optional
mununki Oct 4, 2022
eac8dd2
change copyright
mununki Oct 4, 2022
6f956e4
change to enum and clean up
mununki Oct 4, 2022
6b914fa
snapshot
mununki Oct 4, 2022
05f80e8
revert enum to avoid breaking
mununki Oct 4, 2022
c739464
snapshot
mununki Oct 4, 2022
900b41b
add missing children field back
mununki Oct 4, 2022
2c45d1b
snapshot
mununki Oct 4, 2022
f8d1d3a
update changelog
mununki Oct 5, 2022
2d5aa72
sync latest syntax
cristianoc Oct 9, 2022
640f2f4
Fix issue where an empty record literal {} expected to have a non-rec…
cristianoc Oct 11, 2022
67a7b7d
Update CHANGELOG.md
cristianoc Oct 11, 2022
78011b7
Sync latest syntax.
cristianoc Oct 12, 2022
f0ba004
Set version to 10.1.0-rc.2 (#5732)
cknitt Oct 13, 2022
a554d33
CI: replace deprecated set-output command with GITHUB_ENV (#5734)
cknitt Oct 15, 2022
9e657d7
Fix emitting unary minus for floats in case of negative constants.
cristianoc Oct 16, 2022
125a27c
Update CHANGELOG.md
cristianoc Oct 16, 2022
8cbb4da
snap
cristianoc Oct 16, 2022
62f92f1
Sync latest syntax.
cristianoc Oct 16, 2022
dca052b
Fix .bs.js timestamp being reset to 1970-01-01 when there are warning…
cknitt Oct 16, 2022
9789cca
Set version to 10.1.0-rc.3 (#5740)
cknitt Oct 16, 2022
a8b0cfb
Fix issue where exhaustiveness check for pattern matching char was no…
cristianoc Oct 19, 2022
e5361b1
Revert "Fix issue where exhaustiveness check for pattern matching cha…
bobzhang Oct 24, 2022
8de6f38
Merge pull request #5746 from rescript-lang/revert-5744-char_exhausti…
bobzhang Oct 24, 2022
8278bf0
sync latest syntax (#5751)
cristianoc Oct 24, 2022
7fe359b
Async inline (#5755)
cristianoc Oct 26, 2022
229aa0e
Fix 'alloewed' typo in translmod.ml
d4h0 Oct 27, 2022
cb21728
rewrite jsx in res, add helper functions
mununki Oct 27, 2022
51dede5
add ReactPPX4Support module to relocate helper fn
mununki Oct 27, 2022
bce7c87
update artifacts
mununki Oct 27, 2022
64bd843
update changelog
mununki Oct 28, 2022
ac603f1
add React bindings to ReactPPX4Support
mununki Oct 28, 2022
981b507
try to fix build deps
mununki Oct 28, 2022
ec4f8f6
rename to jsxPPXReactSupport to fix ci
mununki Oct 28, 2022
66d57da
add artifacts
mununki Oct 28, 2022
0774d35
update changelog
mununki Oct 28, 2022
70cb393
Sync latest syntax. (#5762)
cristianoc Oct 29, 2022
32a133d
Update genType snapshot tests.
cristianoc Oct 30, 2022
2b510e0
Change char payload (#5759)
butterunderflow Oct 31, 2022
3b42447
update submodule
bobzhang Oct 31, 2022
1dac866
avoid regressions in generated JS code
bobzhang Oct 31, 2022
a76fb22
fix #5557
bobzhang Oct 31, 2022
03e01e1
add a test case
bobzhang Oct 31, 2022
5562d46
snapshot
bobzhang Oct 31, 2022
1f2505f
clean up changelog
bobzhang Oct 31, 2022
c2fde88
Sync latest syntax.
cristianoc Oct 31, 2022
344a3b7
Some changelog fixes (#5768)
cknitt Oct 31, 2022
6c85f75
10.1_release -> master
cknitt Nov 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ jobs:
run: opam exec -- node scripts/ciTest.js -mocha -theme -format

- name: Get artifact info
id: get_artifact_info
run: node .github/workflows/get_artifact_info.js

- name: "Upload artifacts: binaries"
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_artifact_info.outputs.artifact_name }}
path: ${{ steps.get_artifact_info.outputs.artifact_path }}
name: ${{ env.artifact_name }}
path: ${{ env.artifact_path }}

- name: "Upload artifacts: lib/ocaml"
if: runner.os == 'Linux'
Expand Down Expand Up @@ -140,7 +139,6 @@ jobs:
working-directory: packages/std

- name: Get package info
id: get_package_info
# For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
run: node .github/workflows/get_package_info.js ${{ github.event.pull_request.head.sha }}

Expand All @@ -149,8 +147,8 @@ jobs:
with:
name: npm-packages
path: |
${{ steps.get_package_info.outputs.rescript_package }}
${{ steps.get_package_info.outputs.stdlib_package }}
${{ env.rescript_package }}
${{ env.stdlib_package }}

installationTest:
needs: package
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/get_artifact_info.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const fs = require("fs");
const os = require("os");

const artifactPath =
process.platform === "darwin" && process.arch === "arm64"
? process.platform + process.arch
Expand All @@ -6,5 +9,7 @@ const artifactPath =
const artifactName = "binaries-" + artifactPath;

// Pass artifactPath and artifactName to subsequent GitHub actions
console.log(`::set-output name=artifact_path::${artifactPath}`);
console.log(`::set-output name=artifact_name::${artifactName}`);
fs.appendFileSync(
process.env.GITHUB_ENV,
`artifact_path=${artifactPath}${os.EOL}artifact_name=${artifactName}${os.EOL}`
);
7 changes: 5 additions & 2 deletions .github/workflows/get_package_info.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const fs = require("fs");
const os = require("os");

const packageSpec = JSON.parse(fs.readFileSync("./package.json", "utf8"));
const { name, version } = packageSpec;
Expand All @@ -16,5 +17,7 @@ fs.renameSync(rescriptPackagePath, rescriptArtifactName);
fs.renameSync(stdlibPackagePath, stdlibArtifactName);

// Pass information to subsequent GitHub actions
console.log(`::set-output name=rescript_package::${rescriptArtifactName}`);
console.log(`::set-output name=stdlib_package::${stdlibArtifactName}`);
fs.appendFileSync(
process.env.GITHUB_ENV,
`rescript_package=${rescriptArtifactName}${os.EOL}stdlib_package=${stdlibArtifactName}${os.EOL}`
);
56 changes: 55 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,72 @@
- Made pinned dependencies transitive: if *a* is a pinned dependency of *b* and *b* is a pinned dependency of *c*, then *a* is implicitly a pinned dependency of *c*.
- This change is only breaking if your build process assumes non-transitivity. Few if any builds do. In the typical case where you build your monorepo by running `rescript build` on each package in your repo, you don't need to make any changes. There is no way of building with the old, non-transitive behavior.

# 10.1.0-rc.3

#### :rocket: New Feature

- Support the use of spread anywhere in list creation (e.g. `list{...x, 1, ...y, ...z}`). https://github.com/rescript-lang/syntax/pull/692
- Add support for the argument of `@react.component` to set a props type from the outside. https://github.com/rescript-lang/syntax/pull/699

#### :bug: Bug Fix

- Fix issue where the JSX key type is not an optional string https://github.com/rescript-lang/syntax/pull/693
- Prevent inlining of async functions https://github.com/rescript-lang/rescript-compiler/issues/5754
- Fix build error for JSX fragment without children https://github.com/rescript-lang/syntax/pull/704
- Fix issue where async as an id cannot be used with application and labelled arguments https://github.com/rescript-lang/syntax/issues/707
- Fix 5557: the exhaustive checking for char is incorrect during the unicode migration https://github.com/rescript-lang/rescript-compiler/pull/5749
- Fix 5753: the comment for unicode char is inaccurate https://github.com/rescript-lang/syntax/pull/709
- Treat await as almost-unary operator weaker than pipe so `await foo->bar` means `await (foo->bar)` https://github.com/rescript-lang/syntax/pull/711

#### :nail_care: Polish

- Change payload of `Pconst_char` from `char` to `int` https://github.com/rescript-lang/syntax/pull/709

# 10.1.0-rc.2

#### :bug: Bug Fix

- Fix issue with changes not being applied with React Native's Metro bundler for files with warnings https://github.com/rescript-lang/rescript-compiler/pull/5738
- Fix emitting unary minus for floats in case of negative constants https://github.com/rescript-lang/rescript-compiler/pull/5737
- Fix issue where a spread `...x` in non-last position would not be reported as syntax error https://github.com/rescript-lang/syntax/pull/673/
- Fix issue where the formatter would delete `async` in a function with labelled arguments.
- Fix several printing issues with `async` including an infinite loop https://github.com/rescript-lang/syntax/pull/680
- Fix issue where certain JSX expressions would be formatted differenctly in compiler 10.1.0-rc.1 https://github.com/rescript-lang/syntax/issues/675
- Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687

# 10.1.0-rc.1

#### :boom: Breaking Change

- Deprecate DOM element attributes in `JsxDOM.domProps`: `begin_`, `end_`, `to_`
- Use `begin`, `end`, `to` instead.
- Emit an error when a `@string` or `@int` attribute is used in a V4 component https://github.com/rescript-lang/rescript-compiler/issues/5724

## :rocket: New Feature

- Add extra variants for output filename suffixes in `bsconfig.json`: `.bs.mjs` and `.bs.cjs` are allowed https://github.com/rescript-lang/rescript-compiler/pull/5631
- Safe promises: t-first Js.Promise2 bindings, and remove warning for nested promises https://github.com/rescript-lang/rescript-compiler/pull/5709

#### :bug: Bug Fix

- Fix printing of comments inside empty blocks https://github.com/rescript-lang/syntax/pull/647
- Fix issue where uncurried async functions were emitted without `async` https://github.com/rescript-lang/rescript-compiler/pull/5718
- Fix location issue in error messages with JSX V4 where the multiple props types are defined https://github.com/rescript-lang/syntax/pull/655
- Fix location issue in make function in JSX V4 that breaks dead code elimination https://github.com/rescript-lang/syntax/pull/660
- Fix parsing (hence pretty printing) of expressions with underscore `_` and comments.
- Fix printing of comments inside JSX tag https://github.com/rescript-lang/syntax/pull/664
- Fix issue where formatter erases tail comments inside JSX tag https://github.com/rescript-lang/syntax/issues/663
- Fix issue where the JSX prop has type annotation of the first class module https://github.com/rescript-lang/syntax/pull/666
- Fix issue where an empty record literal {} expected to have a non-record type would type check https://github.com/rescript-lang/rescript-compiler/pull/5729

#### :eyeglasses: Spec Compliance

- Functions with consecutive dots now print as multiple arrow functions like in JavaScript.

#### :nail_care: Polish

- Add `loading`, `aria-*` DOM element attributes in `JsxDOM.domProps`: `ariaCurrent`, `ariaInvalid`, `ariaAutocomplete`, etc.
- Change the internal representation of props for the lowercase components to record. https://github.com/rescript-lang/syntax/pull/665
- Add `JsxPPXReactSupport` module to relocate the helper functions for JSX v4 from `rescript-react`

# 10.1.0-alpha.2

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ test-all: test test-gentype
lib: build
node scripts/install -force-lib-rebuild

artifacts: lib
./scripts/makeArtifactList.js

clean-gentype:
make -C jscomp/gentype_tests/typescript-react-example clean

Expand Down
15 changes: 10 additions & 5 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
match v with
| Float { f } -> Js_number.caml_float_literal_to_js_string f
(* attach string here for float constant folding?*)
| Int { i; c = Some c } -> Format.asprintf "/* %C */%ld" c i
| Int { i; c = Some c } -> Format.asprintf "/* %s */%ld" (Ext_util.string_of_int_as_char c) i
| Int { i; c = None } ->
Int32.to_string i
(* check , js convention with ocaml lexical convention *)
Expand Down Expand Up @@ -666,7 +666,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
expression ~level:13 cxt f e
| Bin
( Minus,
{ expression_desc = Number (Int { i = 0l; _ } | Float { f = "0." }) },
{
expression_desc =
Number ((Int { i = 0l; _ } | Float { f = "0." }) as desc);
},
e )
(* TODO:
Handle multiple cases like
Expand All @@ -675,7 +678,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
{[ 0.000 - x ]}
*) ->
P.cond_paren_group f (level > 13) 1 (fun _ ->
P.string f "-";
P.string f (match desc with Float _ -> "- " | _ -> "-");
expression ~level:13 cxt f e)
| Bin (op, e1, e2) ->
let out, lft, rght = Js_op_util.op_prec op in
Expand Down Expand Up @@ -718,8 +721,10 @@ and expression_desc cxt ~(level : int) f x : cxt =
Js_op.Lit (Ext_ident.convert x))))
(*name convention of Record is slight different from modules*)
| Caml_block (el, mutable_flag, _, Blk_record { fields; record_repr }) -> (
if Array.length fields <> 0 && Ext_array.for_alli fields (fun i v -> string_of_int i = v) then
expression_desc cxt ~level f (Array (el, mutable_flag))
if
Array.length fields <> 0
&& Ext_array.for_alli fields (fun i v -> string_of_int i = v)
then expression_desc cxt ~level f (Array (el, mutable_flag))
else
match record_repr with
| Record_regular ->
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_exp_make.mli
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ val method_ :

val econd : ?comment:string -> t -> t -> t -> t

val int : ?comment:string -> ?c:char -> int32 -> t
val int : ?comment:string -> ?c:int -> int32 -> t

val uint32 : ?comment:string -> int32 -> t

Expand Down
149 changes: 76 additions & 73 deletions jscomp/core/js_implementation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,41 @@ let process_with_gentype cmt_file =
if !Clflags.bs_gentype then GenTypeMain.processCmtFile cmt_file

let after_parsing_sig ppf outputprefix ast =
Ast_config.iter_on_bs_config_sigi ast;
if !Js_config.modules then
output_deps_set !Location.input_name
(Ast_extract.read_parse_and_extract Mli ast);
(if !Js_config.binary_ast then
let sourcefile = !Location.input_name in
Binary_ast.write_ast Mli ~sourcefile
~output:(outputprefix ^ Literals.suffix_iast)
(* to support relocate to another directory *)
ast);
if !Js_config.as_pp then (
output_string stdout Config.ast_intf_magic_number;
output_value stdout (!Location.input_name : string);
output_value stdout ast);
if !Js_config.syntax_only then Warnings.check_fatal ()
else
let modulename = module_of_filename outputprefix in
Lam_compile_env.reset ();
let initial_env = Res_compmisc.initial_env () in
Env.set_unit_name modulename;
let tsg = Typemod.transl_signature initial_env ast in
if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
let sg = tsg.sig_type in
ignore (Includemod.signatures initial_env sg sg);
Delayed_checks.force_delayed_checks ();
Warnings.check_fatal ();
let deprecated = Builtin_attributes.deprecated_of_sig ast in
let sg =
Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
in
Typemod.save_signature modulename tsg outputprefix !Location.input_name
initial_env sg;
process_with_gentype (outputprefix ^ ".cmti")
if !Clflags.only_parse = false then (
Ast_config.iter_on_bs_config_sigi ast;
if !Js_config.modules then
output_deps_set !Location.input_name
(Ast_extract.read_parse_and_extract Mli ast);
(if !Js_config.binary_ast then
let sourcefile = !Location.input_name in
Binary_ast.write_ast Mli ~sourcefile
~output:(outputprefix ^ Literals.suffix_iast)
(* to support relocate to another directory *)
ast);
if !Js_config.as_pp then (
output_string stdout Config.ast_intf_magic_number;
output_value stdout (!Location.input_name : string);
output_value stdout ast);
if !Js_config.syntax_only then Warnings.check_fatal ()
else
let modulename = module_of_filename outputprefix in
Lam_compile_env.reset ();
let initial_env = Res_compmisc.initial_env () in
Env.set_unit_name modulename;
let tsg = Typemod.transl_signature initial_env ast in
if !Clflags.dump_typedtree then
fprintf ppf "%a@." Printtyped.interface tsg;
let sg = tsg.sig_type in
ignore (Includemod.signatures initial_env sg sg);
Delayed_checks.force_delayed_checks ();
Warnings.check_fatal ();
let deprecated = Builtin_attributes.deprecated_of_sig ast in
let sg =
Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
in
Typemod.save_signature modulename tsg outputprefix !Location.input_name
initial_env sg;
process_with_gentype (outputprefix ^ ".cmti"))

let interface ~parser ppf ?outputprefix fname =
let outputprefix =
Expand Down Expand Up @@ -126,48 +128,49 @@ let no_export (rest : Parsetree.structure) : Parsetree.structure =
| _ -> rest

let after_parsing_impl ppf outputprefix (ast : Parsetree.structure) =
Js_config.all_module_aliases :=
!Clflags.assume_no_mli = Mli_non_exists && all_module_alias ast;
Ast_config.iter_on_bs_config_stru ast;
let ast = if !Js_config.no_export then no_export ast else ast in
if !Js_config.modules then
output_deps_set !Location.input_name
(Ast_extract.read_parse_and_extract Ml ast);
(if !Js_config.binary_ast then
let sourcefile = !Location.input_name in
Binary_ast.write_ast ~sourcefile Ml
~output:(outputprefix ^ Literals.suffix_ast)
ast);
if !Js_config.as_pp then (
output_string stdout Config.ast_impl_magic_number;
output_value stdout (!Location.input_name : string);
output_value stdout ast);
if !Js_config.syntax_only then Warnings.check_fatal ()
else
let modulename = Ext_filename.module_name outputprefix in
Lam_compile_env.reset ();
let env = Res_compmisc.initial_env () in
Env.set_unit_name modulename;
let typedtree, coercion, _, _ =
Typemod.type_implementation_more
?check_exists:(if !Js_config.force_cmi then None else Some ())
!Location.input_name outputprefix modulename env ast
in
let typedtree_coercion = (typedtree, coercion) in
print_if ppf Clflags.dump_typedtree Printtyped.implementation_with_coercion
typedtree_coercion;
(if !Js_config.cmi_only then Warnings.check_fatal ()
if !Clflags.only_parse = false then (
Js_config.all_module_aliases :=
!Clflags.assume_no_mli = Mli_non_exists && all_module_alias ast;
Ast_config.iter_on_bs_config_stru ast;
let ast = if !Js_config.no_export then no_export ast else ast in
if !Js_config.modules then
output_deps_set !Location.input_name
(Ast_extract.read_parse_and_extract Ml ast);
(if !Js_config.binary_ast then
let sourcefile = !Location.input_name in
Binary_ast.write_ast ~sourcefile Ml
~output:(outputprefix ^ Literals.suffix_ast)
ast);
if !Js_config.as_pp then (
output_string stdout Config.ast_impl_magic_number;
output_value stdout (!Location.input_name : string);
output_value stdout ast);
if !Js_config.syntax_only then Warnings.check_fatal ()
else
let lambda, exports =
Translmod.transl_implementation modulename typedtree_coercion
in
let js_program =
print_if_pipe ppf Clflags.dump_rawlambda Printlambda.lambda lambda
|> Lam_compile_main.compile outputprefix exports
let modulename = Ext_filename.module_name outputprefix in
Lam_compile_env.reset ();
let env = Res_compmisc.initial_env () in
Env.set_unit_name modulename;
let typedtree, coercion, _, _ =
Typemod.type_implementation_more
?check_exists:(if !Js_config.force_cmi then None else Some ())
!Location.input_name outputprefix modulename env ast
in
if not !Js_config.cmj_only then
Lam_compile_main.lambda_as_module js_program outputprefix);
process_with_gentype (outputprefix ^ ".cmt")
let typedtree_coercion = (typedtree, coercion) in
print_if ppf Clflags.dump_typedtree
Printtyped.implementation_with_coercion typedtree_coercion;
(if !Js_config.cmi_only then Warnings.check_fatal ()
else
let lambda, exports =
Translmod.transl_implementation modulename typedtree_coercion
in
let js_program =
print_if_pipe ppf Clflags.dump_rawlambda Printlambda.lambda lambda
|> Lam_compile_main.compile outputprefix exports
in
if not !Js_config.cmj_only then
Lam_compile_main.lambda_as_module js_program outputprefix);
process_with_gentype (outputprefix ^ ".cmt"))

let implementation ~parser ppf ?outputprefix fname =
let outputprefix =
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_of_lam_string.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module E = Js_exp_make
currently, it follows the same patten of ocaml, [char] is [int]
*)

let const_char (i : char) = E.int ~c:i (Int32.of_int @@ Char.code i)
let const_char (i : int) = E.int ~c:i (Int32.of_int @@ i)

(* string [s[i]] expects to return a [ocaml_char] *)
let ref_string e e1 = E.string_index e e1
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_of_lam_string.mli
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ val ref_byte : J.expression -> J.expression -> J.expression

val set_byte : J.expression -> J.expression -> J.expression -> J.expression

val const_char : char -> J.expression
val const_char : int -> J.expression

val bytes_to_string : J.expression -> J.expression
2 changes: 1 addition & 1 deletion jscomp/core/js_op.ml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type float_lit = { f : string } [@@unboxed]

type number =
| Float of float_lit
| Int of { i : int32; c : char option }
| Int of { i : int32; c : int option }
| Uint of int32

(* becareful when constant folding +/-,
Expand Down
Loading