Skip to content

Commit 5ccdd88

Browse files
authored
Rename Js.Bigint -> Js.BigInt (#6696)
* rename Js.Bigint -> Js.BigInt * update change log
1 parent f0dda99 commit 5ccdd88

20 files changed

+43
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#### :rocket: New Feature
1616

17-
- Add the primitive bigint type https://github.com/rescript-lang/rescript-compiler/pull/6670
17+
- Add the primitive bigint type https://github.com/rescript-lang/rescript-compiler/pull/6670 https://github.com/rescript-lang/rescript-compiler/pull/6696
1818

1919
#### :bug: Bug Fix
2020

jscomp/core/js_analyzer.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ let rec eq_expression ({ expression_desc = x0 } : J.expression)
158158
| Undefined x -> y0 = Undefined x
159159
| Number (Int { i }) -> (
160160
match y0 with Number (Int { i = j }) -> i = j | _ -> false)
161-
| Number (Bigint {positive = p0; value = v0}) -> (
162-
match y0 with Number (Bigint {positive = p1; value = v1}) -> p0 = p1 && v0 = v1 | _ -> false)
161+
| Number (BigInt {positive = p0; value = v0}) -> (
162+
match y0 with Number (BigInt {positive = p1; value = v1}) -> p0 = p1 && v0 = v1 | _ -> false)
163163
| Number (Float _) -> false
164164
(* begin match y0 with
165165
| Number (Float j) ->

jscomp/core/js_dump.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ and expression_desc cxt ~(level : int) f x : cxt =
664664
Int32.to_string i
665665
(* check , js convention with ocaml lexical convention *)
666666
| Uint i -> Format.asprintf "%lu" i
667-
| Bigint {positive; value} -> Format.asprintf "%sn" (Bigint_utils.to_string positive value)
667+
| BigInt {positive; value} -> Format.asprintf "%sn" (Bigint_utils.to_string positive value)
668668
in
669669
let need_paren =
670670
if s.[0] = '-' then level > 13

jscomp/core/js_exp_make.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ let obj_int_tag_literal : t =
312312

313313
let int ?comment ?c i : t = { expression_desc = Number (Int { i; c }); comment }
314314

315-
let bigint ?comment sign i : t = { expression_desc = Number (Bigint {positive=sign; value=i}); comment}
315+
let bigint ?comment sign i : t = { expression_desc = Number (BigInt {positive=sign; value=i}); comment}
316316

317-
let zero_bigint_literal : t = {expression_desc = Number (Bigint {positive=true; value="0"}); comment = None}
317+
let zero_bigint_literal : t = {expression_desc = Number (BigInt {positive=true; value="0"}); comment = None}
318318

319319
let small_int i : t =
320320
match i with
@@ -807,7 +807,7 @@ let tag_type = function
807807
| Ast_untagged_variants.String s -> str s ~delim:DStarJ
808808
| Int i -> small_int i
809809
| Float f -> float f
810-
| Bigint i ->
810+
| BigInt i ->
811811
let sign, i = Bigint_utils.parse_bigint i in
812812
bigint sign i
813813
| Bool b -> bool b

jscomp/core/js_op.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ type number =
132132
| Float of float_lit
133133
| Int of { i : int32; c : int option }
134134
| Uint of int32
135-
| Bigint of bigint_lit
135+
| BigInt of bigint_lit
136136

137137
(* becareful when constant folding +/-,
138138
since we treat it as js nativeint, bitwise operators:

jscomp/core/js_stmt_make.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ let string_switch ?(comment : string option)
138138
match switch_case with
139139
| String s ->
140140
if s = txt then Some x.switch_body else None
141-
| Int _ | Float _ | Bigint _ | Bool _ | Null | Undefined | Untagged _ ->
141+
| Int _ | Float _ | BigInt _ | Bool _ | Null | Undefined | Untagged _ ->
142142
None)
143143
with
144144
| Some case -> case

jscomp/core/lam_primitive.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type t =
8080
| Psubfloat
8181
| Pmulfloat
8282
| Pdivfloat
83-
(* Bigint operations *)
83+
(* BigInt operations *)
8484
| Pnegbigint
8585
| Paddbigint
8686
| Psubbigint

jscomp/ml/ast_untagged_variants.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type tag_type =
8181
| String of string
8282
| Int of int
8383
| Float of string
84-
| Bigint of string
84+
| BigInt of string
8585
| Bool of bool
8686
| Null
8787
| Undefined (* literal or tagged block *)
@@ -126,7 +126,7 @@ let process_tag_type (attrs : Parsetree.attributes) =
126126
| Some f -> st := Some (Float f));
127127
(match Ast_payload.is_single_bigint payload with
128128
| None -> ()
129-
| Some i -> st := Some (Bigint i));
129+
| Some i -> st := Some (BigInt i));
130130
(match Ast_payload.is_single_bool payload with
131131
| None -> ()
132132
| Some b -> st := Some (Bool b));
@@ -291,7 +291,7 @@ let checkInvariant ~isUntaggedDef ~(consts : (Location.t * tag) list)
291291
| Some (String s) -> addStringLiteral ~loc s
292292
| Some (Int i) -> addNonstringLiteral ~loc (string_of_int i)
293293
| Some (Float f) -> addNonstringLiteral ~loc f
294-
| Some (Bigint i) -> addNonstringLiteral ~loc i
294+
| Some (BigInt i) -> addNonstringLiteral ~loc i
295295
| Some Null -> addNonstringLiteral ~loc "null"
296296
| Some Undefined -> addNonstringLiteral ~loc "undefined"
297297
| Some (Bool b) -> addNonstringLiteral ~loc (if b then "true" else "false")
@@ -398,7 +398,7 @@ module DynamicChecks = struct
398398
in
399399
let literals_overlaps_with_bigint () =
400400
Ext_list.exists literal_cases (function
401-
| Bigint _ -> true
401+
| BigInt _ -> true
402402
| _ -> false)
403403
in
404404
let literals_overlaps_with_boolean () =
@@ -488,5 +488,5 @@ module DynamicChecks = struct
488488
| Untagged UnknownType ->
489489
(* This should not happen because unknown must be the only non-literal case *)
490490
assert false
491-
| Bool _ | Float _ | Int _ | Bigint _ | String _ | Null | Undefined -> x
491+
| Bool _ | Float _ | Int _ | BigInt _ | String _ | Null | Undefined -> x
492492
end

jscomp/ml/lambda.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ type primitive =
229229
| Pnegfloat | Pabsfloat
230230
| Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
231231
| Pfloatcomp of comparison
232-
(* Bigint operations *)
232+
(* BigInt operations *)
233233
| Pnegbigint | Paddbigint | Psubbigint | Ppowbigint
234234
| Pmulbigint | Pdivbigint | Pmodbigint
235235
| Pandbigint | Porbigint | Pxorbigint

jscomp/ml/lambda.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ type primitive =
195195
| Pnegfloat | Pabsfloat
196196
| Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
197197
| Pfloatcomp of comparison
198-
(* Bigint operations *)
198+
(* BigInt operations *)
199199
| Pnegbigint | Paddbigint | Psubbigint | Ppowbigint
200200
| Pmulbigint | Pdivbigint | Pmodbigint
201201
| Pandbigint | Porbigint | Pxorbigint

0 commit comments

Comments
 (0)