├── .nvmrc ├── CLAUDE.md ├── .python-version ├── scripts └── res │ ├── apiDocs │ └── .gitkeep │ └── .gitignore ├── analysis ├── reanalyze │ ├── dune │ └── src │ │ ├── StringSet.ml │ │ ├── FileSet.ml │ │ ├── LocSet.ml │ │ └── dune ├── vendor │ ├── .ocamlformat │ ├── dune │ └── json │ │ └── dune ├── examples │ ├── larger-project │ │ ├── src │ │ │ ├── DeadTest.res │ │ │ ├── ImmutableArray.res │ │ │ ├── ImmutableArray.resi │ │ │ ├── exception │ │ │ │ ├── Exn.res │ │ │ │ ├── ExnA.res │ │ │ │ ├── ExnB.res │ │ │ │ └── ExportWithRename.res │ │ │ ├── DeadTestWithInterface.resi │ │ │ ├── DeadTestBlacklist.res │ │ │ ├── ToSuppress.res │ │ │ ├── TestDeadExn.res │ │ │ ├── DeadExn.resi │ │ │ ├── IgnoreInterface.res │ │ │ ├── DeadCodeInterface.res │ │ │ ├── DeadValueTest.resi │ │ │ ├── loop.res │ │ │ ├── DeadRT.resi │ │ │ ├── EverythingLiveHere.res │ │ │ ├── NestedModulesInSignature.res │ │ │ ├── DeadCodeImplementation.res │ │ │ ├── DynamicallyLoadedComponent.res │ │ │ ├── DeadTestWithInterface.res │ │ │ ├── JSResource.res │ │ │ ├── LetPrivate.res │ │ │ ├── NestedModulesInSignature.resi │ │ │ ├── TypeParams1.res │ │ │ └── OptArg.resi │ │ └── .gitignore │ ├── example-project │ │ ├── .gitignore │ │ └── src │ │ │ ├── B.re │ │ │ └── More.resi │ └── workspace-project │ │ ├── app │ │ ├── package.json │ │ └── src │ │ │ └── App.res │ │ ├── common │ │ └── package.json │ │ ├── myplugin │ │ └── package.json │ │ └── README.md └── src │ ├── Log.ml │ └── dune ├── ninja └── misc │ ├── afl-fuzz-tokens │ ├── kw_pool │ ├── kw_rule │ ├── misc_a │ ├── misc_b │ ├── misc_colon │ ├── misc_eq │ ├── misc_pipe │ ├── misc_space │ ├── kw_build │ ├── misc_cont │ ├── misc_dollar │ ├── misc_indent │ ├── misc_pipepipe │ ├── kw_default │ ├── kw_include │ └── kw_subninja │ └── afl-fuzz │ └── build.ninja ├── packages ├── playground │ └── src │ │ └── App.res └── @rescript │ ├── darwin-x64 │ └── bin │ │ └── .gitkeep │ ├── linux-arm64 │ └── bin │ │ └── .gitkeep │ ├── linux-x64 │ └── bin │ │ └── .gitkeep │ ├── win32-x64 │ └── bin │ │ └── .gitkeep │ ├── darwin-arm64 │ └── bin │ │ └── .gitkeep │ └── runtime │ ├── lib │ ├── es6 │ │ ├── package.json │ │ ├── Jsx.js │ │ ├── Obj.js │ │ ├── Js_OO.js │ │ ├── Js_blob.js │ │ ├── Js_date.js │ │ ├── Js_file.js │ │ ├── Js_float.js │ │ ├── Js_map.js │ │ ├── Js_obj.js │ │ ├── Js_re.js │ │ ├── Js_set.js │ │ ├── JsxDOM.js │ │ ├── Dom_storage2.js │ │ ├── Js_array2.js │ │ ├── Js_console.js │ │ ├── Js_extern.js │ │ ├── Js_global.js │ │ ├── Js_result.js │ │ ├── Js_string2.js │ │ ├── Js_weakmap.js │ │ ├── Js_weakset.js │ │ ├── JsxDOMStyle.js │ │ ├── Stdlib_Object.js │ │ └── Stdlib_RegExp.js │ ├── .npmignore │ └── js │ │ ├── Jsx.js │ │ ├── Obj.js │ │ ├── Js_OO.js │ │ ├── Js_array2.js │ │ ├── Js_blob.js │ │ ├── Js_date.js │ │ ├── Js_extern.js │ │ ├── Js_file.js │ │ ├── Js_float.js │ │ ├── Js_global.js │ │ ├── Js_map.js │ │ ├── Js_obj.js │ │ ├── Js_re.js │ │ ├── Js_result.js │ │ ├── Js_set.js │ │ ├── JsxDOM.js │ │ └── Stdlib_RegExp.js │ ├── Js_blob.res │ ├── Js_file.res │ ├── .gitignore │ ├── Primitive_float_extern.res │ ├── Primitive_char_extern.res │ ├── Primitive_int_extern.res │ ├── Primitive_dict.res │ └── Primitive_promise.res ├── rewatch ├── tests │ └── lib │ │ └── rewatch.lock ├── rustfmt.toml ├── testrepo │ ├── src │ │ └── Test.res │ └── packages │ │ ├── main │ │ └── src │ │ │ ├── InternalDep.res │ │ │ ├── ModuleWithInterface.resi │ │ │ ├── output.txt │ │ │ └── ModuleWithInterface.res │ │ ├── pure-dev │ │ └── dev │ │ │ └── RealDev.res │ │ ├── file-casing │ │ └── src │ │ │ ├── Consume.res │ │ │ └── produce.res │ │ ├── new-namespace │ │ └── src │ │ │ ├── NS.res │ │ │ ├── Other_module.res │ │ │ └── NS_alias.res │ │ ├── namespace-casing │ │ └── src │ │ │ ├── Consume.res │ │ │ └── Produce.res │ │ ├── deprecated-config │ │ └── src │ │ │ └── Main.res │ │ ├── file-casing-no-namespace │ │ └── src │ │ │ ├── Consume.res │ │ │ └── produce.res │ │ ├── with-dev-deps │ │ └── src │ │ │ └── FileToTest.res │ │ ├── nohoist │ │ ├── src │ │ │ └── BunSample.res │ │ └── rescript.json │ │ ├── dep01 │ │ └── src │ │ │ └── Dep01.res │ │ ├── standalone │ │ └── src │ │ │ └── Standalone.res │ │ └── dep02 │ │ └── src │ │ └── Dep02.res ├── .gitignore ├── rust-toolchain.toml └── rewatch.cmd ├── tests ├── .gitignore ├── analysis_tests │ ├── tests │ │ ├── src │ │ │ ├── tst.js │ │ │ ├── test.json │ │ │ ├── Fastify.res │ │ │ ├── expected │ │ │ │ ├── Rxjs.res.txt │ │ │ │ ├── ArrayUtils.res.txt │ │ │ │ ├── Component.res.txt │ │ │ │ ├── Component.resi.txt │ │ │ │ ├── Fastify.res.txt │ │ │ │ ├── FastifyExt.res.txt │ │ │ │ ├── Objects.res.txt │ │ │ │ ├── QueryFile.res.txt │ │ │ │ ├── Support.res.txt │ │ │ │ ├── ModuleStuff.res.txt │ │ │ │ ├── SchemaAssets.res.txt │ │ │ │ ├── ShadowedBelt.res.txt │ │ │ │ ├── TableclothMap.res.txt │ │ │ │ ├── TableclothMap.resi.txt │ │ │ │ ├── typeConstraint.res.txt │ │ │ │ ├── CompletableComponent.res.txt │ │ │ │ ├── CompletionSupport.res.txt │ │ │ │ ├── CompletionSupport2.res.txt │ │ │ │ ├── EnvCompletionOtherFile.res.txt │ │ │ │ └── Dce.res.txt │ │ │ ├── dce │ │ │ │ └── DceTest.res │ │ │ ├── RenameWithInterface.res │ │ │ ├── ReferencesWithInterface.res │ │ │ ├── ReferencesWithInterface.resi │ │ │ ├── RenameWithInterface.resi │ │ │ ├── ArrayUtils.res │ │ │ ├── TableclothMap.resi │ │ │ ├── Component.res │ │ │ ├── FastifyExt.res │ │ │ ├── Component.resi │ │ │ ├── inner │ │ │ │ ├── ComponentInner.res │ │ │ │ ├── ComponentInner.resi │ │ │ │ ├── ReferencesInner.res │ │ │ │ └── ReferencesInner.resi │ │ │ ├── Auto.res │ │ │ ├── CompletionResolve.res │ │ │ ├── Dce.res │ │ │ ├── ShadowedBelt.res │ │ │ ├── Div.res │ │ │ └── PrepareRename.res │ │ └── not_compiled │ │ │ ├── SemanticTokensArrayMutation.res │ │ │ ├── SemanticTokensDict.res │ │ │ ├── expected │ │ │ ├── SemanticTokensArrayMutation.res.txt │ │ │ ├── SemanticTokensDict.res.txt │ │ │ ├── SemanticTokens.res.txt │ │ │ ├── SemanticTokensArray.res.txt │ │ │ └── SemanticTokensArrayAccess.res.txt │ │ │ ├── Diagnostics.res │ │ │ ├── SemanticTokensArray.res │ │ │ ├── SemanticTokensArrayAccess.res │ │ │ └── SemanticTokens.res │ ├── tests-reanalyze │ │ ├── .gitignore │ │ ├── deadcode │ │ │ ├── src │ │ │ │ ├── exception │ │ │ │ │ ├── BsJson.res │ │ │ │ │ ├── InnerModules.res │ │ │ │ │ ├── TestInnerModules.res │ │ │ │ │ ├── ExnA.res │ │ │ │ │ └── ExnB.res │ │ │ │ ├── DeadTestWithInterface.resi │ │ │ │ ├── ToSuppress.res │ │ │ │ ├── DeadTestBlacklist.res │ │ │ │ ├── TestDeadExn.res │ │ │ │ ├── DeadExn.resi │ │ │ │ ├── IgnoreInterface.res │ │ │ │ ├── InnerModuleTypes.res │ │ │ │ ├── InnerModuleTypes.resi │ │ │ │ ├── TestInnedModuleTypes.res │ │ │ │ ├── DeadCodeInterface.res │ │ │ │ ├── DeadValueTest.resi │ │ │ │ ├── DeadRT.resi │ │ │ │ ├── EverythingLiveHere.res │ │ │ │ ├── NestedModulesInSignature.res │ │ │ │ ├── DeadCodeImplementation.res │ │ │ │ ├── DynamicallyLoadedComponent.res │ │ │ │ ├── JSResource.res │ │ │ │ ├── NestedModulesInSignature.resi │ │ │ │ ├── DeadTestWithInterface.res │ │ │ │ ├── LetPrivate.res │ │ │ │ └── TypeParams1.res │ │ │ └── .gitignore │ │ └── termination │ │ │ └── .gitignore │ ├── tests-generic-jsx-transform │ │ └── src │ │ │ └── expected │ │ │ └── GenericJsx.res.txt │ └── tests-incremental-typechecking │ │ └── src │ │ └── ConstructorCompletion__Json.res ├── ounit_tests │ └── ounit_tests_main.mli ├── tests │ └── src │ │ ├── demo_int_map.resi │ │ ├── ari_regress_test.resi │ │ ├── glob_u.res │ │ ├── glob_x.res │ │ ├── poly_variant_test.resi │ │ ├── acyc │ │ ├── a0_a1.res │ │ ├── a1_a2.resi │ │ ├── a3_a4.res │ │ ├── a1_a2.res │ │ ├── a2_a3.res │ │ └── a4_a5.res │ │ ├── const_defs.res │ │ ├── es6_export.res │ │ ├── glob_test_u.res │ │ ├── gpr_3865_foo.res │ │ ├── inline_edge_cases.resi │ │ ├── side_effect_free.res │ │ ├── conditional │ │ ├── cond_b.res │ │ ├── cond_c.res │ │ ├── cond_a.res │ │ ├── cond_a_none.res │ │ ├── cond_a_B.res │ │ └── cond_a_C.res │ │ ├── debug_keep_test.res │ │ ├── hash_utils.resi │ │ ├── hello.foo.res │ │ ├── test_dup_param.res │ │ ├── test_eq.res │ │ ├── test_obj.res │ │ ├── glob_test_add.res │ │ ├── runtime_encoding_test.res │ │ ├── side_effect.res │ │ ├── test_small.res │ │ ├── es6_import.res │ │ ├── gpr_2352_test.res │ │ ├── gpr_2700_test.res │ │ ├── test_common.res │ │ ├── test_nullary.res │ │ ├── gpr_3852_alias_reify.res │ │ ├── side_effect2.res │ │ ├── config1_test.res │ │ ├── functor_inst.res │ │ ├── inline_map_test.resi │ │ ├── a_recursive_type.resi │ │ ├── gpr_3852_alias_reify.resi │ │ ├── gpr_3852_effect.res │ │ ├── gpr_4494_test.res │ │ ├── largest_int_flow.res │ │ ├── default_export_test.res │ │ ├── escape_esmodule.res │ │ ├── hello_res.resi │ │ ├── polymorphism_test.resi │ │ ├── test_array_append.res │ │ ├── gentTypeReTest.res │ │ ├── import_side_effect_free.res │ │ ├── test_export2.res │ │ ├── test_let.res │ │ ├── test_unsafe_obj_ffi.resi │ │ ├── Equality_over_optimization.res │ │ ├── cross_module_inline_test.res │ │ ├── export_keyword.res │ │ ├── noassert.res │ │ ├── test_cpp.res │ │ ├── gpr_1423_nav.res │ │ ├── gpr_5753.res │ │ ├── include_side_effect.res │ │ ├── minimal_test.res │ │ ├── test2.res │ │ ├── test_case_set.res │ │ ├── ModuleWithAlias.res │ │ ├── gpr_2474.res │ │ ├── gpr_2487.res │ │ ├── gpr_3895_test.res │ │ ├── import2.res │ │ ├── gpr_1717_test.res │ │ ├── test_order.res │ │ ├── esmodule_ref.res │ │ ├── gpr_3852_alias.res │ │ ├── import_side_effect.res │ │ ├── obj_type_test.res │ │ ├── test_const_propogate.res │ │ ├── test_nested_let.res │ │ ├── effect.res │ │ ├── test_nested_print.res │ │ ├── EnvUnifiedOps.res │ │ ├── function_directives.res │ │ ├── raw_arity.res │ │ ├── test_char.res │ │ ├── UncurriedPervasives.res │ │ ├── external_ppx2.res │ │ ├── gpr_3897_test.res │ │ ├── more_uncurry.res │ │ ├── test_match_exception.res │ │ ├── const_defs_test.res │ │ ├── directives.res │ │ ├── gpr_1240_missing_unbox.res │ │ ├── gpr_3865_bar.res │ │ ├── string_constant_compare.res │ │ ├── DynamicImportModuleWithAlias.res │ │ ├── abstract_type.resi │ │ ├── debug_keep_test.mjs │ │ ├── gpr_1692_test.mjs │ │ ├── gpr_4931_allow.res │ │ ├── incomplete_toplevel_test.res │ │ ├── rebind_module_test.res │ │ ├── test_incr_ref.res │ │ ├── test_pervasives3.res │ │ ├── b.res │ │ ├── complete_parmatch_test.res │ │ ├── esmodule_ref.mjs │ │ ├── hello.foo.mjs │ │ ├── module_as_function.res │ │ ├── gpr_5753.mjs │ │ ├── hash_utils.res │ │ └── test_regex.res ├── build_tests │ ├── case │ │ ├── src │ │ │ ├── Demo.resi │ │ │ └── demo.res │ │ └── rescript.json │ ├── case2 │ │ ├── src │ │ │ ├── x.resi │ │ │ └── X.res │ │ └── rescript.json │ ├── case3 │ │ └── src │ │ │ ├── B01.res │ │ │ ├── B01.resi │ │ │ ├── B02.res │ │ │ ├── B03.res │ │ │ ├── B04.res │ │ │ ├── B04.resi │ │ │ ├── B05.res │ │ │ ├── B05.resi │ │ │ ├── a01.res │ │ │ ├── a01.resi │ │ │ ├── a02.res │ │ │ ├── a03.res │ │ │ ├── a04.res │ │ │ ├── a04.resi │ │ │ ├── a05.res │ │ │ ├── a05.resi │ │ │ └── hello.res │ ├── nested │ │ ├── .gitignore │ │ └── src │ │ │ ├── demo.resi │ │ │ ├── a0 │ │ │ ├── a0_main.res │ │ │ └── a1 │ │ │ │ └── A00_a1_main.res │ │ │ ├── b0 │ │ │ ├── b0_main.res │ │ │ └── b1 │ │ │ │ └── B00_b1_main.res │ │ │ └── demo.res │ ├── nnest │ │ ├── .gitignore │ │ └── src │ │ │ ├── a0 │ │ │ ├── a0_main.res │ │ │ └── a1 │ │ │ │ └── A0_a1_main.res │ │ │ ├── b0 │ │ │ ├── b0_main.res │ │ │ └── b1 │ │ │ │ └── B0_b1_main.res │ │ │ └── demo.res │ ├── unicode │ │ ├── 📗block │ │ │ └── b.res │ │ ├── 📙inline │ │ │ └── c.res │ │ ├── 📕annotation │ │ │ └── a.res │ │ └── rescript.json │ ├── weird_deps │ │ ├── test │ │ │ └── test.res │ │ └── src │ │ │ └── demo.res │ ├── zerocycle │ │ ├── .gitignore │ │ └── src │ │ │ ├── demo.res │ │ │ ├── demo2.res │ │ │ ├── foo.res │ │ │ └── foo2.res │ ├── cycle │ │ └── src │ │ │ ├── a.res │ │ │ └── b.res │ ├── cycle1 │ │ └── src │ │ │ ├── A.resi │ │ │ └── A.res │ ├── weird_devdeps │ │ ├── test │ │ │ └── test.res │ │ └── src │ │ │ └── demo.res │ ├── devonly │ │ ├── src │ │ │ ├── depdemo.res │ │ │ └── demo.res │ │ └── src2 │ │ │ ├── hello.res │ │ │ └── hellodep.res │ ├── in_source │ │ └── input.sh │ ├── post-build │ │ └── src │ │ │ ├── hello.res │ │ │ └── demo.res │ ├── scoped_ppx │ │ ├── src │ │ │ └── hello.res │ │ ├── .gitignore │ │ └── node_modules │ │ │ └── @hongbo │ │ │ └── ppx1 │ │ │ └── package.json │ ├── weird_names │ │ └── src │ │ │ ├── demo.res │ │ │ ├── 404.res │ │ │ ├── _app.res │ │ │ ├── [...params].res │ │ │ ├── utils.test.res │ │ │ ├── [[...params]].res │ │ │ ├── [slug_or_ID].res │ │ │ └── [...params_max_3].res │ ├── custom_namespace │ │ └── src │ │ │ ├── demo.res │ │ │ └── demo.res.js │ ├── duplicated_symlinked_packages │ │ ├── a │ │ │ ├── src │ │ │ │ └── .git_keep │ │ │ ├── node_modules │ │ │ │ ├── c │ │ │ │ └── z │ │ │ │ │ ├── src │ │ │ │ │ └── .git_keep │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── b │ │ │ ├── src │ │ │ │ └── .git_keep │ │ │ ├── node_modules │ │ │ │ └── c │ │ │ └── package.json │ │ ├── c │ │ │ ├── src │ │ │ │ └── .git_keep │ │ │ └── package.json │ │ ├── src │ │ │ └── .git_keep │ │ ├── node_modules │ │ │ ├── a │ │ │ ├── b │ │ │ └── z │ │ │ │ ├── src │ │ │ │ └── .git_keep │ │ │ │ └── package.json │ │ └── .gitignore │ ├── super_errors │ │ ├── .gitignore │ │ ├── fixtures │ │ │ ├── type1.res │ │ │ ├── type3.res │ │ │ ├── modules1.res │ │ │ ├── primitives8.res │ │ │ ├── directive_attr.res │ │ │ ├── modules2.res │ │ │ ├── syntaxErrors5.res │ │ │ ├── top_level_value_not_unit.res │ │ │ ├── assert_condition.res │ │ │ ├── primitives9.res │ │ │ ├── syntaxErrors1.res │ │ │ ├── syntaxErrors3.res │ │ │ ├── highlighting1.res │ │ │ ├── jinterp.res │ │ │ ├── math_operator_string.res │ │ │ ├── primitives10.res │ │ │ ├── private_without_body.res │ │ │ ├── regex_literal.res │ │ │ ├── repeated_def_types.res │ │ │ ├── suggest_existing_arity_fn_1.res │ │ │ ├── suggest_existing_arity_fn_2.res │ │ │ ├── arity_mismatch3.res │ │ │ ├── array_item_type_mismatch.res │ │ │ ├── bitnot_type_mismatch.res │ │ │ ├── highlighting6.res │ │ │ ├── primitives1.res │ │ │ ├── suggest_existing_arity_fn_3.res │ │ │ ├── ternary_branch_mismatch.res │ │ │ ├── warnings2.res │ │ │ ├── awaiting_non_promise.res │ │ │ ├── polyvariant_int_too_large.res │ │ │ ├── UntaggedNonUnary1.res │ │ │ ├── if_condition_mismatch.res │ │ │ ├── math_operator_float.res │ │ │ ├── math_operator_int.res │ │ │ ├── missing_label.res │ │ │ ├── moreArguments2.res │ │ │ ├── primitives2.res │ │ │ ├── primitives4.res │ │ │ ├── repeated_def_extension_constr.res │ │ │ ├── repeated_def_modules.res │ │ │ ├── suggest_module_for_missing_identifier.res │ │ │ ├── unused_variable.res │ │ │ ├── comparison_operator.res │ │ │ ├── highlighting3.res │ │ │ ├── math_operator_constant.res │ │ │ ├── moreArguments1.res │ │ │ ├── moreArguments3.res │ │ │ ├── non_function_uncurried_apply.res │ │ │ ├── variant_spread_abstract_type.res │ │ │ ├── while_condition.res │ │ │ ├── UntaggedUnknown.res │ │ │ ├── collections.res │ │ │ ├── curry_in_uncurry.res │ │ │ ├── for_loop_condition.res │ │ │ ├── highlighting2.res │ │ │ ├── missing_labels.res │ │ │ ├── moreArguments4.res │ │ │ ├── opt_args_arity.res │ │ │ ├── syntaxErrors2.res │ │ │ ├── try_catch_same_type.res │ │ │ ├── uncurried_expected.res │ │ │ ├── unknown_tagged_template_function.res │ │ │ ├── unused_warnings.res │ │ │ ├── UntaggedNonUnary2.res │ │ │ ├── deprecated_with_automigration.res │ │ │ ├── let_unwrap_on_top_level_not_enabled.res │ │ │ ├── partial_app.res │ │ │ ├── primitives3.res │ │ │ ├── repeated_def_module_types.res │ │ │ ├── variant_spread_extensible_variant.res │ │ │ ├── DerivingAccessorsRecordParam.res │ │ │ ├── duplicate_labels_error.res │ │ │ ├── if_branch_mismatch.res │ │ │ ├── multiple_tag_1.res │ │ │ ├── multiple_tag_2.res │ │ │ ├── warnings1.res │ │ │ ├── arity_mismatch2.res │ │ │ ├── method_arity_mismatch.res │ │ │ ├── polyvariants_no_overlap.res │ │ │ ├── primitives5.res │ │ │ ├── variant_constructor_expects_inline_record.res │ │ │ ├── wrong_name_record_field.res │ │ │ ├── arity_mismatch.res │ │ │ ├── arity_mismatch4.res │ │ │ ├── top_level_fn_call_not_unit.res │ │ │ ├── variant_spread_type_parameters.res │ │ │ ├── OptionalImplIntf.res │ │ │ ├── UntaggedTupleAndArray.res │ │ │ ├── duplicate_as_tag_inline_record.res │ │ │ ├── pattern_matching_on_value_but_is_option.res │ │ │ ├── primitives6.res │ │ │ ├── suggest_module_for_missing_identifier_with_spellcheck.res │ │ │ ├── await.res │ │ │ ├── curried_expected.res │ │ │ ├── dict_helper.res │ │ │ ├── function_argument_mismatch.res │ │ │ ├── unbound_record_field.res │ │ │ ├── variant_coercion_int_as.res │ │ │ ├── variant_spread_recursive.res │ │ │ ├── OptionalInlineImplIntf.res │ │ │ ├── UncurriedArgsNotApplied.res │ │ │ ├── feature_letunwrap_not_enabled.res │ │ │ ├── fun_return_poly1.res │ │ │ ├── pattern_matching_on_option_but_value_not_option.res │ │ │ ├── variant_coercion_string_as.res │ │ │ ├── variant_spread_tag_missing.res │ │ │ ├── bigint_match_literal.res │ │ │ ├── mix_object_record_spread_constructor.res │ │ │ ├── mix_record_object_spread.res │ │ │ ├── react_component_with_props_external.res │ │ │ ├── stdlib_removed_in_error.res │ │ │ ├── variant_coercion_bigint_as.res │ │ │ ├── variant_coercion_float_as.res │ │ │ ├── variant_coercion_non_unboxed_with_payload.res │ │ │ ├── variant_coercion_string.res │ │ │ └── variant_spread_unboxed_mismatch.res │ │ └── expected │ │ │ ├── c_for_u_in_c_mode.res.expected │ │ │ ├── c_for_u_in_u_mode.res.expected │ │ │ ├── curry_in_uncurry.res.expected │ │ │ ├── math_operator_int.res.expected │ │ │ ├── math_operator_string.res.expected │ │ │ ├── u_for_c_in_c_mode.res.expected │ │ │ ├── u_for_c_in_u_mode.res.expected │ │ │ └── uncurried_expected.res.expected │ ├── rerror │ │ ├── src │ │ │ └── demo.res │ │ └── rescript.json │ ├── ns │ │ └── src │ │ │ ├── demo.res │ │ │ └── hello.res │ ├── transitive_dependency │ │ ├── .gitignore │ │ ├── a │ │ │ ├── src │ │ │ │ └── src.res │ │ │ ├── tests │ │ │ │ └── test.res │ │ │ └── package.json │ │ └── node_modules │ │ │ ├── b │ │ │ ├── src │ │ │ │ └── src.res │ │ │ ├── tests │ │ │ │ └── test.res │ │ │ └── package.json │ │ │ └── c │ │ │ ├── src │ │ │ └── src.res │ │ │ ├── tests │ │ │ └── test.res │ │ │ └── package.json │ ├── weird_names_not_found_bug │ │ └── src │ │ │ ├── demo.res │ │ │ └── demo.test.res │ ├── build_warn_as_error │ │ ├── src │ │ │ └── Demo.res │ │ └── rescript.json │ ├── install │ │ └── src │ │ │ └── Foo.res │ ├── x-y │ │ ├── x-src │ │ │ └── demo.res │ │ └── rescript.json │ ├── hyphen2 │ │ ├── y-src │ │ │ └── demo.res │ │ └── rescript.json │ ├── not_undefined_attribute │ │ ├── input.res │ │ └── rescript.json │ ├── warn_legacy_config │ │ └── src │ │ │ └── demo.res │ ├── xpkg │ │ └── rescript.json │ ├── deprecated-package-specs │ │ └── src │ │ │ └── Index.res │ ├── jsx_settings_inheritance │ │ ├── .gitignore │ │ ├── node_modules │ │ │ ├── a │ │ │ │ └── package.json │ │ │ └── b │ │ │ │ └── package.json │ │ └── src │ │ │ └── C.res │ ├── gpr_978 │ │ ├── src │ │ │ └── gpr_978_module.res │ │ └── rescript.json │ ├── exports │ │ └── rescript.json │ ├── cli_compile_status │ │ └── rescript.json │ └── unboxed_bool_with_const │ │ └── src │ │ └── Main.res ├── dependencies │ ├── .gitignore │ ├── .gitattributes │ └── rescript-react │ │ └── package.json ├── docstring_tests │ ├── DocTest.resi │ └── .gitignore ├── syntax_tests │ └── data │ │ ├── parsing │ │ ├── other │ │ │ ├── emptyFile.res │ │ │ ├── emptyInterface.resi │ │ │ ├── expected │ │ │ │ ├── emptyFile.res.txt │ │ │ │ ├── comments.res.txt │ │ │ │ ├── emptyInterface.resi.txt │ │ │ │ ├── onlyMultilineComment.res.txt │ │ │ │ ├── onlyMultilineComment.resi.txt │ │ │ │ ├── onlySinglelineComment.res.txt │ │ │ │ ├── onlySinglinelineComment.resi.txt │ │ │ │ ├── singleLineCommentWithoutNewline.res.txt │ │ │ │ └── semi.res.txt │ │ │ ├── semi.res │ │ │ ├── onlySinglelineComment.res │ │ │ ├── onlySinglinelineComment.resi │ │ │ ├── singleLineCommentWithoutNewline.res │ │ │ ├── onlyMultilineComment.res │ │ │ ├── onlyMultilineComment.resi │ │ │ └── comments.res │ │ ├── errors │ │ │ ├── expressions │ │ │ │ ├── id.res │ │ │ │ ├── emptyeof.res │ │ │ │ ├── misc.res │ │ │ │ ├── taggedTemplateLiterals.res │ │ │ │ ├── regexCharacterClasses.res │ │ │ │ ├── emptyBlock.res │ │ │ │ ├── expected │ │ │ │ │ ├── emptyBlock.res.txt │ │ │ │ │ └── stringLiteral.res.txt │ │ │ │ ├── letUnwrapRec.res │ │ │ │ ├── stringLiteral.res │ │ │ │ ├── if.res │ │ │ │ ├── object.res │ │ │ │ ├── oldArraySyntax.res │ │ │ │ ├── typeDefInFunction.res │ │ │ │ ├── array.res │ │ │ │ ├── labelledArgumentMissingEqual.res │ │ │ │ └── oldDataLastPipe.res │ │ │ ├── other │ │ │ │ ├── for.res │ │ │ │ ├── patternMatching.res │ │ │ │ ├── dict_spread.res │ │ │ │ └── hashIdent.res │ │ │ ├── typeDef │ │ │ │ ├── keywordOnly.res │ │ │ │ ├── emptyRecord.res │ │ │ │ ├── recordFieldWrongAssignment.res │ │ │ │ ├── expected │ │ │ │ │ ├── emptyRecord.res.txt │ │ │ │ │ └── emptyInlineRecord.res.txt │ │ │ │ ├── namedParameters.res │ │ │ │ ├── recordMutable.res │ │ │ │ ├── emptyInlineRecord.res │ │ │ │ ├── recordDocComment.res │ │ │ │ ├── record.res │ │ │ │ └── polyvariant.res │ │ │ ├── scanner │ │ │ │ ├── badCharacter.res │ │ │ │ ├── bigint.res │ │ │ │ ├── unclosedString.res │ │ │ │ ├── expected │ │ │ │ │ ├── bigint.res.txt │ │ │ │ │ └── escapeSequence.res.txt │ │ │ │ ├── unclosedComment.res │ │ │ │ └── escapeSequence.res │ │ │ ├── signature │ │ │ │ ├── letUnwrap.resi │ │ │ │ ├── closingBraces.resi │ │ │ │ └── attributes.resi │ │ │ ├── structure │ │ │ │ ├── consecutive.res │ │ │ │ ├── recordFieldKeywordInExpr.res │ │ │ │ ├── recordFieldWrongAssignment.res │ │ │ │ ├── recordFieldKeywordInExpr2.res │ │ │ │ ├── recordFieldKeywordInPattern.res │ │ │ │ ├── closingBraces.res │ │ │ │ ├── letBindingPatternKeyword.res │ │ │ │ ├── recordFieldKeywordInPattern2.res │ │ │ │ ├── recordFieldKeywordInType.res │ │ │ │ ├── attributes.res │ │ │ │ ├── external.res │ │ │ │ └── recordFieldKeywordInType2.res │ │ │ ├── typexpr │ │ │ │ ├── typeVar.res │ │ │ │ └── garbage.res │ │ │ └── pattern │ │ │ │ └── recordFieldWrongAssignment.res │ │ ├── recovery │ │ │ ├── string │ │ │ │ ├── emptyeof.res │ │ │ │ ├── eof.res │ │ │ │ ├── unclosed.res │ │ │ │ ├── expected │ │ │ │ │ └── unclosed.res.txt │ │ │ │ └── es6template.res │ │ │ ├── comments │ │ │ │ └── eof.res │ │ │ ├── structure │ │ │ │ └── letBinding.res │ │ │ ├── expression │ │ │ │ ├── emptyBlock.res │ │ │ │ ├── infinite.res │ │ │ │ ├── expected │ │ │ │ │ ├── emptyBlock.res.txt │ │ │ │ │ └── infinite.res.txt │ │ │ │ └── if.res │ │ │ ├── pattern │ │ │ │ ├── array.res │ │ │ │ ├── tuple.res │ │ │ │ └── record.res │ │ │ ├── typeDef │ │ │ │ └── typeParams.res │ │ │ └── typexpr │ │ │ │ └── typeConstructorArgs.res │ │ ├── grammar │ │ │ ├── pattern │ │ │ │ ├── var.res │ │ │ │ └── expected │ │ │ │ │ └── var.res.txt │ │ │ ├── typexpr │ │ │ │ ├── any.res │ │ │ │ ├── expected │ │ │ │ │ ├── any.res.txt │ │ │ │ │ └── parenthesized.res.txt │ │ │ │ └── parenthesized.res │ │ │ ├── interface │ │ │ │ ├── interface.resi │ │ │ │ └── expected │ │ │ │ │ └── interface.resi.txt │ │ │ ├── typedefinition │ │ │ │ ├── expected │ │ │ │ │ ├── diamond.res.txt │ │ │ │ │ ├── typeNonrec.res.txt │ │ │ │ │ └── missingPipeBeforeConstructorAttribute.res.txt │ │ │ │ ├── missingPipeBeforeConstructorAttribute.res │ │ │ │ ├── diamond.res │ │ │ │ ├── typeNonrec.res │ │ │ │ └── bsObject.res │ │ │ ├── modexpr │ │ │ │ ├── constrained.res │ │ │ │ ├── expected │ │ │ │ │ ├── constrained.res.txt │ │ │ │ │ └── structure.res.txt │ │ │ │ └── structure.res │ │ │ ├── structure │ │ │ │ ├── module.res │ │ │ │ ├── expected │ │ │ │ │ ├── modType.res.txt │ │ │ │ │ ├── includeStatement.res.txt │ │ │ │ │ └── module.res.txt │ │ │ │ ├── modType.res │ │ │ │ └── includeStatement.res │ │ │ ├── signature │ │ │ │ ├── expected │ │ │ │ │ └── let.res.txt │ │ │ │ └── let.res │ │ │ └── expressions │ │ │ │ └── expected │ │ │ │ └── float.res.txt │ │ └── infiniteLoops │ │ │ ├── polymorphicVariantType.res │ │ │ └── templateEof.res │ │ ├── printer │ │ ├── pattern │ │ │ ├── any.res │ │ │ ├── expected │ │ │ │ ├── any.res.txt │ │ │ │ ├── extension.res.txt │ │ │ │ ├── alias.res.txt │ │ │ │ └── lazy.res.txt │ │ │ ├── extension.res │ │ │ └── alias.res │ │ ├── other │ │ │ ├── lor.res │ │ │ ├── expected │ │ │ │ ├── lor.res.txt │ │ │ │ ├── reasonInterfaceFile.resi.txt │ │ │ │ ├── comments.res.txt │ │ │ │ └── reasonFile.res.txt │ │ │ ├── reasonInterfaceFile.resi │ │ │ ├── comments.res │ │ │ ├── reasonFile.res │ │ │ └── reasonString.res │ │ ├── modExpr │ │ │ ├── extension.res │ │ │ ├── expected │ │ │ │ ├── extension.res.txt │ │ │ │ └── await.res.txt │ │ │ └── await.res │ │ ├── structure │ │ │ ├── moduleTypeDeclaration.res │ │ │ ├── expected │ │ │ │ ├── moduleTypeDeclaration.res.txt │ │ │ │ └── open.res.txt │ │ │ └── open.res │ │ ├── comments │ │ │ ├── fileWithOneSingleLineComment.res │ │ │ ├── interfaceWithOneSingleComment.resi │ │ │ ├── whitespaceCase2.res │ │ │ ├── expected │ │ │ │ ├── whitespaceCase2.res.txt │ │ │ │ ├── fileWithOneSingleLineComment.res.txt │ │ │ │ ├── interfaceWithOneSingleComment.resi.txt │ │ │ │ ├── interfaceWithOnlyComments.resi.txt │ │ │ │ └── whitespaceCase1.res.txt │ │ │ ├── interfaceWithOnlyComments.resi │ │ │ ├── whitespaceCase1.res │ │ │ └── fileWithOnlyComments.res │ │ ├── expr │ │ │ ├── letexception.res │ │ │ └── expected │ │ │ │ └── letexception.res.txt │ │ ├── modType │ │ │ ├── extension.res │ │ │ └── expected │ │ │ │ └── extension.res.txt │ │ ├── signature │ │ │ ├── extension.resi │ │ │ ├── open.resi │ │ │ ├── typext.resi │ │ │ └── expected │ │ │ │ ├── open.resi.txt │ │ │ │ ├── typext.resi.txt │ │ │ │ └── extension.resi.txt │ │ └── typeDef │ │ │ ├── missingPipeBeforeConstructorAttribute.res │ │ │ ├── expected │ │ │ ├── missingPipeBeforeConstructorAttribute.res.txt │ │ │ ├── constraint.res.txt │ │ │ └── private.res.txt │ │ │ ├── constraint.res │ │ │ └── private.res │ │ ├── conversion │ │ └── reason │ │ │ ├── ternary.res │ │ │ ├── variant.res │ │ │ ├── gentype.resi │ │ │ ├── letprivate.res │ │ │ ├── expected │ │ │ ├── ternary.res.txt │ │ │ ├── variant.res.txt │ │ │ ├── gentype.resi.txt │ │ │ ├── letprivate.res.txt │ │ │ ├── refSugarReason.res.txt │ │ │ ├── underscoreSugar.res.txt │ │ │ └── unicode.res.txt │ │ │ ├── refSugarReason.res │ │ │ ├── underscoreSugar.res │ │ │ ├── unicode.res │ │ │ └── moduleLanguage.res │ │ ├── api │ │ ├── reiSyntax.resi │ │ ├── resiSyntax.resi │ │ └── resSyntax.res │ │ ├── idempotency │ │ ├── pupilfirst │ │ │ ├── shared │ │ │ │ ├── Icon.res │ │ │ │ ├── Date.res │ │ │ │ └── Loading.res │ │ │ ├── layouts │ │ │ │ ├── StudentTopNav__Types.res │ │ │ │ └── SchoolAdminNavbar__Types.res │ │ │ ├── schools │ │ │ │ ├── CourseAuthors__Types.res │ │ │ │ ├── CourseEditor__Types.res │ │ │ │ ├── CoachesSchoolIndex__Types.res │ │ │ │ └── SchoolCustomize__Types.res │ │ │ ├── packs │ │ │ │ └── SchoolsCoursesIndexPack.res │ │ │ └── users │ │ │ │ └── UsersHome__Types.res │ │ ├── bs-webapi │ │ │ └── src │ │ │ │ └── Webapi │ │ │ │ └── Webapi__Performance.res │ │ ├── ludum-dare-46 │ │ │ └── IndexHot.res │ │ ├── reasongl │ │ │ └── ReasonglInterface.res │ │ ├── covid-19charts.com │ │ │ └── src │ │ │ │ └── CopyToClipboard.res │ │ └── nook-exchange │ │ │ └── TemporaryState.res │ │ ├── ast-mapping │ │ ├── FunWithAttribute.res │ │ └── expected │ │ │ └── FunWithAttribute.res.txt │ │ └── ppx │ │ └── react │ │ └── interfaceWithRef.resi ├── dune ├── gentype_tests │ └── typescript-react-example │ │ └── src │ │ ├── Set_.res │ │ ├── Map_.res │ │ ├── WeakSet.res │ │ ├── Date.res │ │ ├── Dict.res │ │ ├── RegExp.res │ │ ├── WeakMap.res │ │ ├── Null.res │ │ ├── Promise.res │ │ ├── IgnoreInterface.res │ │ ├── Nullable.res │ │ ├── Undefined.res │ │ ├── Warnings.res │ │ ├── counter.res │ │ ├── strange_file_names │ │ ├── 404.res │ │ ├── _under.res │ │ ├── AppModal.web.res │ │ └── with_underscore.res │ │ ├── NumericPolyVar.res │ │ ├── Wrapper.res │ │ ├── react-app-env.d.ts │ │ ├── Machine.res │ │ ├── LetPrivate.res │ │ ├── ModuleResolution2.res │ │ ├── NestedModulesInSignature.res │ │ ├── Usage.res │ │ ├── OnClick2.res │ │ ├── DynamicallyLoadedComponent.res │ │ ├── ModuleResolution1.res │ │ ├── NestedModulesInSignature.resi │ │ ├── index.css │ │ ├── JSResource.res │ │ ├── LabeledFun.res │ │ ├── MyModule.res │ │ ├── TypeParams1.res │ │ ├── ExportWithRename.res │ │ └── shims │ │ └── Jsx.shim.ts ├── package_tests │ └── installation_test │ │ └── src │ │ └── Test.res └── tools_tests │ └── src │ ├── migrate │ ├── StdlibMigration_Pervasives.res │ ├── StdlibMigration_Set.res │ ├── StdlibMigration_Map.res │ ├── StdlibMigration_Result.res │ ├── StdlibMigration_WeakSet.res │ └── StdlibMigration_WeakMap.res │ ├── expected │ ├── StdlibMigration_Pervasives.res.expected │ ├── StdlibMigration_Set.res.expected │ ├── StdlibMigration_Result.res.expected │ ├── StdlibMigration_ArrayAppend.res.expected │ ├── StdlibMigration_Map.res.expected │ └── StdlibMigration_WeakSet.res.expected │ ├── ModC.res │ └── ModC.resi ├── dune ├── tools ├── bin │ └── version.ml └── src │ ├── dune │ └── migrate.mli ├── compiler ├── ml │ ├── ccomp.mli │ ├── rec_check.mli │ └── used_attributes.mli ├── ext │ ├── set_int.mli │ ├── hash_ident.mli │ ├── ext_module_system.ml │ ├── runtime_package.mli │ ├── README.md │ ├── hash.mli │ └── ext_spec.mli ├── syntax │ └── src │ │ ├── res_driver_binary.mli │ │ ├── res_driver_ml_printer.mli │ │ ├── res_token_debugger.mli │ │ └── dune ├── bsb │ ├── bsb_config_load.mli │ └── dune ├── bsb_helper │ └── dune ├── depends │ └── dune ├── gentype │ └── dune └── frontend │ └── dune ├── lib_dev └── utils.js └── .yarnrc.yml /.nvmrc: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /CLAUDE.md: -------------------------------------------------------------------------------- 1 | AGENTS.md -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.11 2 | -------------------------------------------------------------------------------- /scripts/res/apiDocs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /analysis/reanalyze/dune: -------------------------------------------------------------------------------- 1 | (dirs src) 2 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_pool: -------------------------------------------------------------------------------- 1 | pool -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_rule: -------------------------------------------------------------------------------- 1 | rule -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_a: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_b: -------------------------------------------------------------------------------- 1 | b -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_colon: -------------------------------------------------------------------------------- 1 | : -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_eq: -------------------------------------------------------------------------------- 1 | = -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_pipe: -------------------------------------------------------------------------------- 1 | | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_space: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/playground/src/App.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rewatch/tests/lib/rewatch.lock: -------------------------------------------------------------------------------- 1 | 36062 -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | temp/ 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/tst.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/ounit_tests/ounit_tests_main.mli: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests/src/demo_int_map.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /analysis/vendor/.ocamlformat: -------------------------------------------------------------------------------- 1 | disable 2 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_build: -------------------------------------------------------------------------------- 1 | build -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_cont: -------------------------------------------------------------------------------- 1 | $ 2 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_dollar: -------------------------------------------------------------------------------- 1 | $ -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_indent: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/misc_pipepipe: -------------------------------------------------------------------------------- 1 | || -------------------------------------------------------------------------------- /packages/@rescript/darwin-x64/bin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/@rescript/linux-arm64/bin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/@rescript/linux-x64/bin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/@rescript/win32-x64/bin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rewatch/rustfmt.toml: -------------------------------------------------------------------------------- 1 | 2 | max_width = 110 -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/test.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/case/src/Demo.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case2/src/x.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B01.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B01.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B02.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B03.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B04.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B04.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B05.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/B05.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a01.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a01.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a02.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a03.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a04.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a04.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a05.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/a05.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | *.res.js 2 | -------------------------------------------------------------------------------- /tests/docstring_tests/DocTest.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/tests/src/ari_regress_test.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/tests/src/glob_u.res: -------------------------------------------------------------------------------- 1 | let v = 3 2 | -------------------------------------------------------------------------------- /tests/tests/src/glob_x.res: -------------------------------------------------------------------------------- 1 | let v = 32 2 | -------------------------------------------------------------------------------- /tests/tests/src/poly_variant_test.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dune: -------------------------------------------------------------------------------- 1 | (dirs compiler tests analysis tools) 2 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_default: -------------------------------------------------------------------------------- 1 | default -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_include: -------------------------------------------------------------------------------- 1 | include -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz-tokens/kw_subninja: -------------------------------------------------------------------------------- 1 | subninja -------------------------------------------------------------------------------- /packages/@rescript/darwin-arm64/bin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/nested/.gitignore: -------------------------------------------------------------------------------- 1 | src/**/*.js -------------------------------------------------------------------------------- /tests/build_tests/nnest/.gitignore: -------------------------------------------------------------------------------- 1 | src/**/*.js -------------------------------------------------------------------------------- /tests/build_tests/unicode/📗block/b.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/unicode/📙inline/c.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_deps/test/test.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/zerocycle/.gitignore: -------------------------------------------------------------------------------- 1 | *.bs.js -------------------------------------------------------------------------------- /tests/tests/src/acyc/a0_a1.res: -------------------------------------------------------------------------------- 1 | let v = 3 2 | -------------------------------------------------------------------------------- /tests/tests/src/acyc/a1_a2.resi: -------------------------------------------------------------------------------- 1 | let v: int 2 | -------------------------------------------------------------------------------- /tests/tests/src/acyc/a3_a4.res: -------------------------------------------------------------------------------- 1 | include A2_a3 2 | -------------------------------------------------------------------------------- /tests/tests/src/const_defs.res: -------------------------------------------------------------------------------- 1 | let v = true 2 | -------------------------------------------------------------------------------- /tools/bin/version.ml: -------------------------------------------------------------------------------- 1 | let version = "0.6.4" 2 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadTest.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compiler/ml/ccomp.mli: -------------------------------------------------------------------------------- 1 | val command : string -> int 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/src/Test.res: -------------------------------------------------------------------------------- 1 | let hello = "world" 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Fastify.res: -------------------------------------------------------------------------------- 1 | type t 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Rxjs.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/cycle/src/a.res: -------------------------------------------------------------------------------- 1 | let v = B.v 2 | -------------------------------------------------------------------------------- /tests/build_tests/cycle/src/b.res: -------------------------------------------------------------------------------- 1 | let v = A.v 2 | -------------------------------------------------------------------------------- /tests/build_tests/cycle1/src/A.resi: -------------------------------------------------------------------------------- 1 | let x: int 2 | -------------------------------------------------------------------------------- /tests/build_tests/nested/src/demo.resi: -------------------------------------------------------------------------------- 1 | let v: int 2 | -------------------------------------------------------------------------------- /tests/build_tests/unicode/📕annotation/a.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_devdeps/test/test.res: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/emptyFile.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests/src/acyc/a1_a2.res: -------------------------------------------------------------------------------- 1 | let v = A0_a1.v 2 | -------------------------------------------------------------------------------- /tests/tests/src/acyc/a2_a3.res: -------------------------------------------------------------------------------- 1 | let v = A1_a2.v 2 | -------------------------------------------------------------------------------- /tests/tests/src/es6_export.res: -------------------------------------------------------------------------------- 1 | let default = 3 2 | -------------------------------------------------------------------------------- /tests/tests/src/glob_test_u.res: -------------------------------------------------------------------------------- 1 | let v = Glob_u.v 2 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3865_foo.res: -------------------------------------------------------------------------------- 1 | let return = 5 2 | -------------------------------------------------------------------------------- /tests/tests/src/inline_edge_cases.resi: -------------------------------------------------------------------------------- 1 | let v: int 2 | -------------------------------------------------------------------------------- /tests/tests/src/side_effect_free.res: -------------------------------------------------------------------------------- 1 | let a = 3 2 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/ImmutableArray.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/ImmutableArray.resi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/exception/Exn.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/exception/ExnA.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rewatch/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store 3 | /docs 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/ArrayUtils.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Component.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Component.resi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Fastify.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/FastifyExt.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Objects.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/QueryFile.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Support.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/devonly/src/depdemo.res: -------------------------------------------------------------------------------- 1 | let a = 3 2 | -------------------------------------------------------------------------------- /tests/build_tests/devonly/src2/hello.res: -------------------------------------------------------------------------------- 1 | let v = 3 2 | -------------------------------------------------------------------------------- /tests/build_tests/in_source/input.sh: -------------------------------------------------------------------------------- 1 | rescript build -regen -------------------------------------------------------------------------------- /tests/build_tests/nested/src/a0/a0_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/nested/src/b0/b0_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/nnest/src/a0/a0_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/nnest/src/b0/b0_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/post-build/src/hello.res: -------------------------------------------------------------------------------- 1 | let a = 3 2 | -------------------------------------------------------------------------------- /tests/build_tests/scoped_ppx/src/hello.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/demo.res: -------------------------------------------------------------------------------- 1 | let a = 1 2 | -------------------------------------------------------------------------------- /tests/dependencies/.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/emptyInterface.resi: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_b.res: -------------------------------------------------------------------------------- 1 | let value = 3 2 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_c.res: -------------------------------------------------------------------------------- 1 | let value = 3 2 | -------------------------------------------------------------------------------- /tests/tests/src/debug_keep_test.res: -------------------------------------------------------------------------------- 1 | let () = %debugger 2 | -------------------------------------------------------------------------------- /tests/tests/src/hash_utils.resi: -------------------------------------------------------------------------------- 1 | let hash: 'a => int 2 | -------------------------------------------------------------------------------- /tests/tests/src/hello.foo.res: -------------------------------------------------------------------------------- 1 | Console.log(__MODULE__) 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_dup_param.res: -------------------------------------------------------------------------------- 1 | let f = (x, x) => x 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_eq.res: -------------------------------------------------------------------------------- 1 | let f = (x, y) => x + y 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_obj.res: -------------------------------------------------------------------------------- 1 | let f = x => x["say_hi"] 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/.gitignore: -------------------------------------------------------------------------------- 1 | .merlin 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/dce/DceTest.res: -------------------------------------------------------------------------------- 1 | let x = 12 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/ModuleStuff.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/SchemaAssets.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/ShadowedBelt.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/TableclothMap.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/TableclothMap.resi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/typeConstraint.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/custom_namespace/src/demo.res: -------------------------------------------------------------------------------- 1 | let v = 42 2 | -------------------------------------------------------------------------------- /tests/build_tests/devonly/src2/hellodep.res: -------------------------------------------------------------------------------- 1 | Js.log(Hello.v) 2 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/a/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/b/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/c/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/nnest/src/a0/a1/A0_a1_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/nnest/src/b0/b1/B0_b1_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/.gitignore: -------------------------------------------------------------------------------- 1 | fixtures/*.js 2 | -------------------------------------------------------------------------------- /tests/build_tests/zerocycle/src/demo.res: -------------------------------------------------------------------------------- 1 | module Foo = {} 2 | -------------------------------------------------------------------------------- /tests/build_tests/zerocycle/src/demo2.res: -------------------------------------------------------------------------------- 1 | module Foo2 = {} 2 | -------------------------------------------------------------------------------- /tests/docstring_tests/.gitignore: -------------------------------------------------------------------------------- 1 | generated_mocha_test.res* 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/id.res: -------------------------------------------------------------------------------- 1 | n.R. -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/other/for.res: -------------------------------------------------------------------------------- 1 | for x 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/any.res: -------------------------------------------------------------------------------- 1 | let _ = 1 2 | -------------------------------------------------------------------------------- /tests/tests/src/glob_test_add.res: -------------------------------------------------------------------------------- 1 | let add = (x, y) => x + y 2 | -------------------------------------------------------------------------------- /tests/tests/src/runtime_encoding_test.res: -------------------------------------------------------------------------------- 1 | let v = [0, 1] 2 | -------------------------------------------------------------------------------- /tests/tests/src/side_effect.res: -------------------------------------------------------------------------------- 1 | Console.log(__MODULE__) 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_small.res: -------------------------------------------------------------------------------- 1 | let fib = 3 2 | let u = fib 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadTestWithInterface.resi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /analysis/vendor/dune: -------------------------------------------------------------------------------- 1 | (dirs ext ml res_syntax json flow_parser) 2 | -------------------------------------------------------------------------------- /compiler/ext/set_int.mli: -------------------------------------------------------------------------------- 1 | include Set_gen.S with type elt = int 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/package.json: -------------------------------------------------------------------------------- 1 | {"type" : "module"} -------------------------------------------------------------------------------- /rewatch/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "stable" 3 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/main/src/InternalDep.res: -------------------------------------------------------------------------------- 1 | let value = 1 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/pure-dev/dev/RealDev.res: -------------------------------------------------------------------------------- 1 | let dev = true -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/CompletableComponent.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/CompletionSupport.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/CompletionSupport2.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/cycle1/src/A.res: -------------------------------------------------------------------------------- 1 | include A 2 | 3 | let x = 42 4 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/node_modules/a: -------------------------------------------------------------------------------- 1 | ../a -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/node_modules/b: -------------------------------------------------------------------------------- 1 | ../b -------------------------------------------------------------------------------- /tests/build_tests/nested/src/a0/a1/A00_a1_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/nested/src/b0/b1/B00_b1_main.res: -------------------------------------------------------------------------------- 1 | let v = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/rerror/src/demo.res: -------------------------------------------------------------------------------- 1 | let x: int => int = "x" 2 | -------------------------------------------------------------------------------- /tests/build_tests/scoped_ppx/.gitignore: -------------------------------------------------------------------------------- 1 | .merlin 2 | !node_modules -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/type1.res: -------------------------------------------------------------------------------- 1 | let x = 2. + 2 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/type3.res: -------------------------------------------------------------------------------- 1 | let u = [] 2 | -------------------------------------------------------------------------------- /tests/dune: -------------------------------------------------------------------------------- 1 | (dirs ounit_tests syntax_benchmarks syntax_tests) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/keywordOnly.res: -------------------------------------------------------------------------------- 1 | type -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/emptyFile.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_a.res: -------------------------------------------------------------------------------- 1 | let u = assert(false) 2 | -------------------------------------------------------------------------------- /tests/tests/src/es6_import.res: -------------------------------------------------------------------------------- 1 | Console.log(Es6_export.default) 2 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_2352_test.res: -------------------------------------------------------------------------------- 1 | let f = x => x["hey"] = 22 2 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_2700_test.res: -------------------------------------------------------------------------------- 1 | let f = x => x == 3 || x == 4 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_common.res: -------------------------------------------------------------------------------- 1 | exception U(int) 2 | exception H 3 | -------------------------------------------------------------------------------- /tests/tests/src/test_nullary.res: -------------------------------------------------------------------------------- 1 | let f = _ => Console.log("hey") 2 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadTestBlacklist.res: -------------------------------------------------------------------------------- 1 | let x = 34 2 | -------------------------------------------------------------------------------- /scripts/res/.gitignore: -------------------------------------------------------------------------------- 1 | *.res.js 2 | lib 3 | apiDocs/**/* 4 | !.gitkeep -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/exception/BsJson.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/EnvCompletionOtherFile.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/case2/src/X.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/devonly/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log(Depdemo.a) 2 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/a/node_modules/c: -------------------------------------------------------------------------------- 1 | ../../c -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/b/node_modules/c: -------------------------------------------------------------------------------- 1 | ../../c -------------------------------------------------------------------------------- /tests/build_tests/ns/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log(Hello.a + Hello.b) 2 | -------------------------------------------------------------------------------- /tests/build_tests/ns/src/hello.res: -------------------------------------------------------------------------------- 1 | let a = 3 + 1 2 | 3 | let b = 2 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/c_for_u_in_c_mode.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/c_for_u_in_u_mode.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/curry_in_uncurry.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/math_operator_int.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/math_operator_string.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/u_for_c_in_c_mode.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/u_for_c_in_u_mode.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/expected/uncurried_expected.res.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/modules1.res: -------------------------------------------------------------------------------- 1 | let b = Foo.b 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives8.res: -------------------------------------------------------------------------------- 1 | let asd = aaa 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | !node_modules -------------------------------------------------------------------------------- /tests/build_tests/weird_names_not_found_bug/src/demo.res: -------------------------------------------------------------------------------- 1 | let a = 1 2 | -------------------------------------------------------------------------------- /tests/build_tests/zerocycle/src/foo.res: -------------------------------------------------------------------------------- 1 | open! Demo 2 | include Foo 3 | -------------------------------------------------------------------------------- /tests/build_tests/zerocycle/src/foo2.res: -------------------------------------------------------------------------------- 1 | open Demo2 2 | include Foo2 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Set_.res: -------------------------------------------------------------------------------- 1 | type t<'a> 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/badCharacter.res: -------------------------------------------------------------------------------- 1 | let $ = 1 -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/comments.res.txt: -------------------------------------------------------------------------------- 1 | let x = 1 -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/emptyInterface.resi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests/src/acyc/a4_a5.res: -------------------------------------------------------------------------------- 1 | include A3_a4 2 | 3 | Console.log(v) 4 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3852_alias_reify.res: -------------------------------------------------------------------------------- 1 | module A = Gpr_3852_effect 2 | -------------------------------------------------------------------------------- /tests/tests/src/side_effect2.res: -------------------------------------------------------------------------------- 1 | let a = Belt.Array.map([1], x => x) 2 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/ToSuppress.res: -------------------------------------------------------------------------------- 1 | let toSuppress = 0 2 | -------------------------------------------------------------------------------- /compiler/ext/hash_ident.mli: -------------------------------------------------------------------------------- 1 | include Hash_gen.S with type key = Ident.t 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/file-casing/src/Consume.res: -------------------------------------------------------------------------------- 1 | let x = Produce.meh(1) -------------------------------------------------------------------------------- /rewatch/testrepo/packages/new-namespace/src/NS.res: -------------------------------------------------------------------------------- 1 | module Alias = NS_alias 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/exception/InnerModules.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/build_warn_as_error/src/Demo.res: -------------------------------------------------------------------------------- 1 | let todo = _ => %todo 2 | -------------------------------------------------------------------------------- /tests/build_tests/case/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/a/node_modules/z/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/node_modules/z/src/.git_keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/build_tests/install/src/Foo.res: -------------------------------------------------------------------------------- 1 | let main = () => Js.log("hello") 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/directive_attr.res: -------------------------------------------------------------------------------- 1 | @@directive 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/modules2.res: -------------------------------------------------------------------------------- 1 | let b = Belt.List.b 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/syntaxErrors5.res: -------------------------------------------------------------------------------- 1 | let a = (1, 2 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/top_level_value_not_unit.res: -------------------------------------------------------------------------------- 1 | 1234 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/a/src/src.res: -------------------------------------------------------------------------------- 1 | Console.log("src") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/404.res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/_app.res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/build_tests/x-y/x-src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Map_.res: -------------------------------------------------------------------------------- 1 | type t<'k, 'v> 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/WeakSet.res: -------------------------------------------------------------------------------- 1 | type t<'a> 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/ternary.res: -------------------------------------------------------------------------------- 1 | let a = x ? 1 : 2 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/variant.res: -------------------------------------------------------------------------------- 1 | type t = | @foo X 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/emptyeof.res: -------------------------------------------------------------------------------- 1 | let x = " 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/misc.res: -------------------------------------------------------------------------------- 1 | let x = _ + 1 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/bigint.res: -------------------------------------------------------------------------------- 1 | let bigint = 3n 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/onlyMultilineComment.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/onlyMultilineComment.resi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/onlySinglelineComment.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/string/emptyeof.res: -------------------------------------------------------------------------------- 1 | let x = " 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/string/eof.res: -------------------------------------------------------------------------------- 1 | let x = "eof here 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/expected/any.res.txt: -------------------------------------------------------------------------------- 1 | let _ = 1 2 | -------------------------------------------------------------------------------- /tests/tests/src/config1_test.res: -------------------------------------------------------------------------------- 1 | @@config(no_export) 2 | 3 | let a = 3 4 | -------------------------------------------------------------------------------- /tests/tests/src/functor_inst.res: -------------------------------------------------------------------------------- 1 | type t 2 | 3 | let say = (x, y) => x + y 4 | -------------------------------------------------------------------------------- /tests/tests/src/inline_map_test.resi: -------------------------------------------------------------------------------- 1 | /* val assertions : unit -> unit */ 2 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/TestDeadExn.res: -------------------------------------------------------------------------------- 1 | Js.log(DeadExn.Etoplevel) 2 | -------------------------------------------------------------------------------- /compiler/ext/ext_module_system.ml: -------------------------------------------------------------------------------- 1 | type t = Commonjs | Esmodule | Es6_global 2 | -------------------------------------------------------------------------------- /compiler/ext/runtime_package.mli: -------------------------------------------------------------------------------- 1 | val name : string 2 | val path : string ref 3 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/namespace-casing/src/Consume.res: -------------------------------------------------------------------------------- 1 | let x = Produce.meh(1) -------------------------------------------------------------------------------- /tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsx.res.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/exception/TestInnerModules.res: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/termination/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/RenameWithInterface.res: -------------------------------------------------------------------------------- 1 | let x = 2 2 | // ^ren y 3 | -------------------------------------------------------------------------------- /tests/build_tests/hyphen2/y-src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/post-build/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/assert_condition.res: -------------------------------------------------------------------------------- 1 | assert("horse") 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives9.res: -------------------------------------------------------------------------------- 1 | let a: int = "hello" 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/a/tests/test.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("test") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_deps/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_devdeps/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/[...params].res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/utils.test.res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Date.res: -------------------------------------------------------------------------------- 1 | type t = Js.Date.t 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Dict.res: -------------------------------------------------------------------------------- 1 | type t<'a> = dict<'a> 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/RegExp.res: -------------------------------------------------------------------------------- 1 | type t = Js.Re.t 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/WeakMap.res: -------------------------------------------------------------------------------- 1 | type t<'k, 'v> 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/api/reiSyntax.resi: -------------------------------------------------------------------------------- 1 | // test .rei file 2 | let x: int 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/gentype.resi: -------------------------------------------------------------------------------- 1 | @genType 2 | let x: int 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/letprivate.res: -------------------------------------------------------------------------------- 1 | %%private(let x = 34) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/shared/Icon.res: -------------------------------------------------------------------------------- 1 | include PfIcon 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/unclosedString.res: -------------------------------------------------------------------------------- 1 | let z = "eof 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/signature/letUnwrap.resi: -------------------------------------------------------------------------------- 1 | let? foo: string -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/emptyRecord.res: -------------------------------------------------------------------------------- 1 | type record = {} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/onlySinglinelineComment.resi.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/comments/eof.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | /* eof 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/lor.res: -------------------------------------------------------------------------------- 1 | let lower = ch => lor(32, ch) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/extension.res: -------------------------------------------------------------------------------- 1 | let %extensionPoint = 1 2 | -------------------------------------------------------------------------------- /tests/tests/src/a_recursive_type.resi: -------------------------------------------------------------------------------- 1 | let loop: int 2 | let non_terminate: int 3 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3852_alias_reify.resi: -------------------------------------------------------------------------------- 1 | module A: { 2 | let v: int 3 | } 4 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3852_effect.res: -------------------------------------------------------------------------------- 1 | let v = 0 2 | let () = Console.log("hello") 3 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_4494_test.res: -------------------------------------------------------------------------------- 1 | /* disable it temporarily since it's TNTE */ 2 | -------------------------------------------------------------------------------- /tests/tests/src/largest_int_flow.res: -------------------------------------------------------------------------------- 1 | @@warning("-107") 2 | let x = 949460645006 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadExn.resi: -------------------------------------------------------------------------------- 1 | // empty 2 | exception Etoplevel 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/IgnoreInterface.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type t = int 3 | -------------------------------------------------------------------------------- /compiler/syntax/src/res_driver_binary.mli: -------------------------------------------------------------------------------- 1 | val print_engine : Res_driver.print_engine 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Js_blob.res: -------------------------------------------------------------------------------- 1 | /*** JavaScript Blob API */ 2 | 3 | type t 4 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Js_file.res: -------------------------------------------------------------------------------- 1 | /*** JavaScript File API */ 2 | 3 | type t 4 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/deprecated-config/src/Main.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | let y = 1 3 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/file-casing-no-namespace/src/Consume.res: -------------------------------------------------------------------------------- 1 | let x = Produce.meh(1) -------------------------------------------------------------------------------- /rewatch/testrepo/packages/with-dev-deps/src/FileToTest.res: -------------------------------------------------------------------------------- 1 | let add = (a, b) => a + b 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTestWithInterface.resi: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/ToSuppress.res: -------------------------------------------------------------------------------- 1 | let toSuppress = 0 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/ReferencesWithInterface.res: -------------------------------------------------------------------------------- 1 | let x = 2 2 | // ^ref 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/ReferencesWithInterface.resi: -------------------------------------------------------------------------------- 1 | let x: int 2 | // ^ref 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/RenameWithInterface.resi: -------------------------------------------------------------------------------- 1 | let x: int 2 | // ^ren y 3 | -------------------------------------------------------------------------------- /tests/build_tests/not_undefined_attribute/input.res: -------------------------------------------------------------------------------- 1 | @notUndefined 2 | type t = int 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/syntaxErrors1.res: -------------------------------------------------------------------------------- 1 | let b = fo;;;;;;;;;;;;;;;; 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/syntaxErrors3.res: -------------------------------------------------------------------------------- 1 | let a = print_char('a) 2 | -------------------------------------------------------------------------------- /tests/build_tests/warn_legacy_config/src/demo.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/[[...params]].res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/[slug_or_ID].res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/build_tests/xpkg/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "_", 3 | "sources": "." 4 | } 5 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Null.res: -------------------------------------------------------------------------------- 1 | type t<'a> = Js.null<'a> 2 | -------------------------------------------------------------------------------- /tests/package_tests/installation_test/src/Test.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("Hello, world!") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/ternary.res.txt: -------------------------------------------------------------------------------- 1 | let a = x ? 1 : 2 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/variant.res.txt: -------------------------------------------------------------------------------- 1 | type t = | @foo X 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/refSugarReason.res: -------------------------------------------------------------------------------- 1 | let x = foo.contents 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/other/patternMatching.res: -------------------------------------------------------------------------------- 1 | switch expr { 2 | } 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/expected/bigint.res.txt: -------------------------------------------------------------------------------- 1 | let bigint = 3n -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/pattern/var.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | let list = 2 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/infiniteLoops/polymorphicVariantType.res: -------------------------------------------------------------------------------- 1 | type x = [ -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/semi.res: -------------------------------------------------------------------------------- 1 | type t = Red 2 | Red 3 | (foo) := 1 4 | -------------------------------------------------------------------------------- /tests/tests/src/default_export_test.res: -------------------------------------------------------------------------------- 1 | let default = 3 2 | 3 | let default = "xx" 4 | -------------------------------------------------------------------------------- /tests/tests/src/escape_esmodule.res: -------------------------------------------------------------------------------- 1 | let __esModule = false 2 | 3 | let default = 4 4 | -------------------------------------------------------------------------------- /tests/tests/src/hello_res.resi: -------------------------------------------------------------------------------- 1 | let a: int 2 | 3 | let to: int 4 | let downto: int 5 | -------------------------------------------------------------------------------- /tests/tests/src/polymorphism_test.resi: -------------------------------------------------------------------------------- 1 | let map: ('a => 'b, list<'a>) => list<'b> 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_array_append.res: -------------------------------------------------------------------------------- 1 | let const_v = Belt.Array.concat([1, 2], [3]) 2 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_Pervasives.res: -------------------------------------------------------------------------------- 1 | raise(Failure("test")) 2 | -------------------------------------------------------------------------------- /analysis/reanalyze/src/StringSet.ml: -------------------------------------------------------------------------------- 1 | (** String set. *) 2 | 3 | include Set.Make (String) 4 | -------------------------------------------------------------------------------- /compiler/syntax/src/res_driver_ml_printer.mli: -------------------------------------------------------------------------------- 1 | val print_engine : Res_driver.print_engine 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | lib/bs 2 | lib/ocaml 3 | *.lock 4 | .buildstamp 5 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/file-casing/src/produce.res: -------------------------------------------------------------------------------- 1 | let meh = (_: int) => { 2 | true 3 | } -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTestBlacklist.res: -------------------------------------------------------------------------------- 1 | let x = 34 2 | 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/ArrayUtils.res: -------------------------------------------------------------------------------- 1 | let empty = arr => Array.length(arr) === 0 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/TableclothMap.resi: -------------------------------------------------------------------------------- 1 | let add: int 2 | 3 | module Int: {} 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/expected/Dce.res.txt: -------------------------------------------------------------------------------- 1 | DCE src/Dce.res 2 | issues:1 3 | 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/highlighting1.res: -------------------------------------------------------------------------------- 1 | let a: int = "hel 2 | 3 | lo" 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/jinterp.res: -------------------------------------------------------------------------------- 1 | let a = 11 2 | let b = j`number $(a)` 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/math_operator_string.res: -------------------------------------------------------------------------------- 1 | let x = "hello" + "what" 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives10.res: -------------------------------------------------------------------------------- 1 | let aaaaa = 10 2 | let b = aaaab 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/private_without_body.res: -------------------------------------------------------------------------------- 1 | %%private 2 | let a = 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/regex_literal.res: -------------------------------------------------------------------------------- 1 | while /foo/ { 2 | () 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/repeated_def_types.res: -------------------------------------------------------------------------------- 1 | type a 2 | 3 | type a 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/suggest_existing_arity_fn_1.res: -------------------------------------------------------------------------------- 1 | Console.log(1, 2) 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/suggest_existing_arity_fn_2.res: -------------------------------------------------------------------------------- 1 | Console.log2(1) 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/b/src/src.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("src") 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/c/src/src.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("src") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names/src/[...params_max_3].res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Promise.res: -------------------------------------------------------------------------------- 1 | type t<'a> = promise<'a> 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/api/resiSyntax.resi: -------------------------------------------------------------------------------- 1 | // test interface file 2 | 3 | let x: int 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/taggedTemplateLiterals.res: -------------------------------------------------------------------------------- 1 | foo()`null` 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/unclosedComment.res: -------------------------------------------------------------------------------- 1 | /* eof 2 | * reached 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/consecutive.res: -------------------------------------------------------------------------------- 1 | open Foo exception Bar 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typexpr/any.res: -------------------------------------------------------------------------------- 1 | type t = _ 2 | 3 | let t: _ = x 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/structure/letBinding.res: -------------------------------------------------------------------------------- 1 | let x = = doStuff(y) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modExpr/extension.res: -------------------------------------------------------------------------------- 1 | module React = %import("react") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/expected/lor.res.txt: -------------------------------------------------------------------------------- 1 | let lower = ch => lor(32, ch) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/structure/moduleTypeDeclaration.res: -------------------------------------------------------------------------------- 1 | module type S = X 2 | -------------------------------------------------------------------------------- /tests/tests/src/gentTypeReTest.res: -------------------------------------------------------------------------------- 1 | @genType.import("hh") 2 | external f: int => int = "f" 3 | -------------------------------------------------------------------------------- /tests/tests/src/import_side_effect_free.res: -------------------------------------------------------------------------------- 1 | let a = await Js.import(Side_effect_free.a) 2 | -------------------------------------------------------------------------------- /tests/tests/src/test_export2.res: -------------------------------------------------------------------------------- 1 | let f = (x, y) => x + y 2 | 3 | let f = (x, y) => x * y 4 | -------------------------------------------------------------------------------- /tests/tests/src/test_let.res: -------------------------------------------------------------------------------- 1 | { 2 | let a = 3 3 | Console.log(a) 4 | } 5 | let b = 3 6 | -------------------------------------------------------------------------------- /tests/tests/src/test_unsafe_obj_ffi.resi: -------------------------------------------------------------------------------- 1 | let f: {.."height": int, "width": int} => int 2 | -------------------------------------------------------------------------------- /analysis/reanalyze/src/FileSet.ml: -------------------------------------------------------------------------------- 1 | (** File name set. *) 2 | 3 | include Set.Make (String) 4 | -------------------------------------------------------------------------------- /compiler/ext/README.md: -------------------------------------------------------------------------------- 1 | This folder hosts some of the utils we use in ReScript, internally. 2 | -------------------------------------------------------------------------------- /compiler/ml/rec_check.mli: -------------------------------------------------------------------------------- 1 | val check_recursive_bindings : Typedtree.value_binding list -> unit 2 | -------------------------------------------------------------------------------- /compiler/syntax/src/res_token_debugger.mli: -------------------------------------------------------------------------------- 1 | val token_print_engine : Res_driver.print_engine 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/main/src/ModuleWithInterface.resi: -------------------------------------------------------------------------------- 1 | type hello 2 | let hello: hello 3 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/namespace-casing/src/Produce.res: -------------------------------------------------------------------------------- 1 | let meh = (_: int) => { 2 | true 3 | } -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/SemanticTokensArrayMutation.res: -------------------------------------------------------------------------------- 1 | xs[0] = 42 2 | //^sem 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Component.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = () => React.null 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/FastifyExt.res: -------------------------------------------------------------------------------- 1 | let doStuff = (t: Fastify.t) => Console.log(t) 2 | -------------------------------------------------------------------------------- /tests/build_tests/case3/src/hello.res: -------------------------------------------------------------------------------- 1 | @genType.import("hh") 2 | external f: int => int = "f" 3 | -------------------------------------------------------------------------------- /tests/build_tests/deprecated-package-specs/src/Index.res: -------------------------------------------------------------------------------- 1 | let () = Js.log("Hello, ReScript") 2 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/.gitignore: -------------------------------------------------------------------------------- 1 | .merlin 2 | **/lib 3 | !node_modules -------------------------------------------------------------------------------- /tests/build_tests/jsx_settings_inheritance/.gitignore: -------------------------------------------------------------------------------- 1 | !node_modules 2 | node_modules/**/lib 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/arity_mismatch3.res: -------------------------------------------------------------------------------- 1 | Belt.Array.map([], (a, b) => 1) 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/array_item_type_mismatch.res: -------------------------------------------------------------------------------- 1 | let x = [1, 2, "hello"] 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/bitnot_type_mismatch.res: -------------------------------------------------------------------------------- 1 | let x = [] 2 | let _ = ~~~x 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/highlighting6.res: -------------------------------------------------------------------------------- 1 | let aaaaa = 10 2 | let b = aaaab 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives1.res: -------------------------------------------------------------------------------- 1 | /* got float, wanted int */ 2 | 2. + 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/suggest_existing_arity_fn_3.res: -------------------------------------------------------------------------------- 1 | Console.log4(1, 2) 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/ternary_branch_mismatch.res: -------------------------------------------------------------------------------- 1 | let x = true ? "123" : 123 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/warnings2.res: -------------------------------------------------------------------------------- 1 | let z = () => { 2 | 10 3 | 10 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/b/tests/test.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("test") 2 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/c/tests/test.res: -------------------------------------------------------------------------------- 1 | Js.Console.log("test") 2 | -------------------------------------------------------------------------------- /tests/build_tests/weird_names_not_found_bug/src/demo.test.res: -------------------------------------------------------------------------------- 1 | module A = Demo 2 | let a = 1 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/IgnoreInterface.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type t = int 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Nullable.res: -------------------------------------------------------------------------------- 1 | type t<'a> = Js.nullable<'a> 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Undefined.res: -------------------------------------------------------------------------------- 1 | type t<'a> = Js.undefined<'a> 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Warnings.res: -------------------------------------------------------------------------------- 1 | @genType("ddd") 2 | let x = 42 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/gentype.resi.txt: -------------------------------------------------------------------------------- 1 | @genType 2 | let x: int 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/letprivate.res.txt: -------------------------------------------------------------------------------- 1 | %%private(let x = 34) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/refSugarReason.res.txt: -------------------------------------------------------------------------------- 1 | let x = foo.contents 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/regexCharacterClasses.res: -------------------------------------------------------------------------------- 1 | let re = /[]/]/ 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/pattern/expected/var.res.txt: -------------------------------------------------------------------------------- 1 | let x = 1 2 | let list = 2 -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/onlySinglelineComment.res: -------------------------------------------------------------------------------- 1 | // one single-line comment 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/onlySinglinelineComment.resi: -------------------------------------------------------------------------------- 1 | // one single-line comment 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/expected/extension.res.txt: -------------------------------------------------------------------------------- 1 | let %extensionPoint = 1 2 | -------------------------------------------------------------------------------- /tests/tests/src/Equality_over_optimization.res: -------------------------------------------------------------------------------- 1 | let z = None == Some([Console.log("hello")]) 2 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_a_none.res: -------------------------------------------------------------------------------- 1 | module A = { 2 | let u = assert(false) 3 | } 4 | -------------------------------------------------------------------------------- /tests/tests/src/cross_module_inline_test.res: -------------------------------------------------------------------------------- 1 | open Test_char 2 | let v = caml_is_printable('a') 3 | -------------------------------------------------------------------------------- /tests/tests/src/export_keyword.res: -------------------------------------------------------------------------------- 1 | let case = 3 2 | let window = 2 3 | 4 | let \"switch" = 3 5 | -------------------------------------------------------------------------------- /tests/tests/src/noassert.res: -------------------------------------------------------------------------------- 1 | let f = () => assert(false) 2 | 3 | let h = () => assert(3 > 2) 4 | -------------------------------------------------------------------------------- /tests/tests/src/test_cpp.res: -------------------------------------------------------------------------------- 1 | type t = int 2 | let f = (x: t, y) => Pervasives.compare(x, y) 3 | -------------------------------------------------------------------------------- /analysis/examples/example-project/.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | .merlin 3 | package-lock.json 4 | yarn.lock 5 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadCodeInterface.res: -------------------------------------------------------------------------------- 1 | module type T = { 2 | let x: int 3 | } 4 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadValueTest.resi: -------------------------------------------------------------------------------- 1 | let valueAlive: int 2 | let valueDead: int 3 | -------------------------------------------------------------------------------- /analysis/examples/workspace-project/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "version": "0.1.0" 4 | } -------------------------------------------------------------------------------- /analysis/src/Log.ml: -------------------------------------------------------------------------------- 1 | let verbose = ref false 2 | let log msg = if !verbose then print_endline msg 3 | -------------------------------------------------------------------------------- /compiler/ext/hash.mli: -------------------------------------------------------------------------------- 1 | module Make (Key : Hashtbl.HashedType) : Hash_gen.S with type key = Key.t 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Primitive_float_extern.res: -------------------------------------------------------------------------------- 1 | external toInt: float => int = "%intoffloat" 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/main/src/output.txt: -------------------------------------------------------------------------------- 1 | bla 2 | Hello world 3 | 01 4 | 02 5 | a 6 | b 7 | 1 8 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/new-namespace/src/Other_module.res: -------------------------------------------------------------------------------- 1 | let bla = () => Console.log("bla") 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/TestDeadExn.res: -------------------------------------------------------------------------------- 1 | Js.log(DeadExn.Etoplevel) 2 | 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/exception/ExnA.res: -------------------------------------------------------------------------------- 1 | let bar = () => ExnB.foo() 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/SemanticTokensDict.res: -------------------------------------------------------------------------------- 1 | let d = dict{"foo": bar} 2 | //^sem 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Component.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: unit => React.element 3 | -------------------------------------------------------------------------------- /tests/build_tests/nested/src/demo.res: -------------------------------------------------------------------------------- 1 | let v = A00_a1_main.v + A0_main.v + B0_main.v + B00_b1_main.v 2 | -------------------------------------------------------------------------------- /tests/build_tests/nnest/src/demo.res: -------------------------------------------------------------------------------- 1 | let v = A0_a1_main.v + A0_main.v + B0_main.v + B0_b1_main.v 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/awaiting_non_promise.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | let f = await x 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/polyvariant_int_too_large.res: -------------------------------------------------------------------------------- 1 | let x = #12345678901234567890 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/counter.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let b = Machine.A(12) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/other/dict_spread.res: -------------------------------------------------------------------------------- 1 | let x = dict{...foo, "bar": 3} 2 | 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInExpr.res: -------------------------------------------------------------------------------- 1 | let r = {type: 1} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldWrongAssignment.res: -------------------------------------------------------------------------------- 1 | let r = {foo=1} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/recordFieldWrongAssignment.res: -------------------------------------------------------------------------------- 1 | type t = {foo=string} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typexpr/typeVar.res: -------------------------------------------------------------------------------- 1 | type x<'A> = '_ 2 | type x<'A> = 'let 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/interface/interface.resi: -------------------------------------------------------------------------------- 1 | let x: int 2 | 3 | let s: string 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/infiniteLoops/templateEof.res: -------------------------------------------------------------------------------- 1 | et foo = x => 2 | switch x { 3 | | `${ -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/singleLineCommentWithoutNewline.res: -------------------------------------------------------------------------------- 1 | RootView.init() 2 | 3 | //int -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/string/unclosed.res: -------------------------------------------------------------------------------- 1 | let x = "unclosed" 2 | 3 | let y = 1 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/fileWithOneSingleLineComment.res: -------------------------------------------------------------------------------- 1 | // retain this comment 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/interfaceWithOneSingleComment.resi: -------------------------------------------------------------------------------- 1 | // retain this comment 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modExpr/expected/extension.res.txt: -------------------------------------------------------------------------------- 1 | module React = %import("react") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/structure/expected/moduleTypeDeclaration.res.txt: -------------------------------------------------------------------------------- 1 | module type S = X 2 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_1423_nav.res: -------------------------------------------------------------------------------- 1 | let busted = (~a1, ~a2, ()) => 2 | /* "hello" */ 3 | a1 ++ a2 4 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_5753.res: -------------------------------------------------------------------------------- 1 | @@config({ 2 | flags: ["-w", "-8"], 3 | }) 4 | 5 | '文'->Console.log 6 | -------------------------------------------------------------------------------- /tests/tests/src/include_side_effect.res: -------------------------------------------------------------------------------- 1 | @@config({no_export: no_export}) 2 | include Side_effect 3 | -------------------------------------------------------------------------------- /tests/tests/src/minimal_test.res: -------------------------------------------------------------------------------- 1 | let rec fake_y = list{2, 3} 2 | and fake_z = list{1, ...fake_y} 3 | -------------------------------------------------------------------------------- /tests/tests/src/test2.res: -------------------------------------------------------------------------------- 1 | module U = { 2 | module H = { 3 | type t = string 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/tests/src/test_case_set.res: -------------------------------------------------------------------------------- 1 | let f = x => x["case"] = 3 2 | 3 | let g = x => x["item"](3) 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_Pervasives.res.expected: -------------------------------------------------------------------------------- 1 | throw(Failure("test")) 2 | 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib 3 | package-lock.json 4 | yarn.lock 5 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/loop.res: -------------------------------------------------------------------------------- 1 | // let foo = x => 2 | // switch x { 3 | // | `${ 4 | 5 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/.npmignore: -------------------------------------------------------------------------------- 1 | bs/ 2 | *.ast 3 | *.iast 4 | rescript.lock 5 | .compiler.log 6 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/file-casing-no-namespace/src/produce.res: -------------------------------------------------------------------------------- 1 | let meh = (_: int) => { 2 | true 3 | } -------------------------------------------------------------------------------- /rewatch/testrepo/packages/main/src/ModuleWithInterface.res: -------------------------------------------------------------------------------- 1 | type hello = string 2 | let hello = "world" 3 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/nohoist/src/BunSample.res: -------------------------------------------------------------------------------- 1 | Console.log(RescriptBun.Globals.import.meta.dir) 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadExn.resi: -------------------------------------------------------------------------------- 1 | // empty 2 | exception Etoplevel 3 | 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/IgnoreInterface.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type t = int 3 | 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/inner/ComponentInner.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = () => React.null 3 | -------------------------------------------------------------------------------- /tests/build_tests/gpr_978/src/gpr_978_module.res: -------------------------------------------------------------------------------- 1 | exception M(int) 2 | module M = { 3 | let x = 3 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/scoped_ppx/node_modules/@hongbo/ppx1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "commonjs" 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/UntaggedNonUnary1.res: -------------------------------------------------------------------------------- 1 | @unboxed 2 | type t = Tuple(int, string) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/if_condition_mismatch.res: -------------------------------------------------------------------------------- 1 | let x = if "horse" { 2 | () 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/math_operator_float.res: -------------------------------------------------------------------------------- 1 | let num = 0 2 | 3 | let x = num +. 12. 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/math_operator_int.res: -------------------------------------------------------------------------------- 1 | let num = 0. 2 | 3 | let x = num + 12. 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/missing_label.res: -------------------------------------------------------------------------------- 1 | let f = (~a) => a ++ "" 2 | 3 | let _ = f("") 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/moreArguments2.res: -------------------------------------------------------------------------------- 1 | let x = (a, b) => a + b 2 | let y = x(2) + 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives2.res: -------------------------------------------------------------------------------- 1 | /* got int, wanted string */ 2 | 2 ++ " things" 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives4.res: -------------------------------------------------------------------------------- 1 | /* Not a function */ 2 | let x = 10 3 | x(10) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/repeated_def_extension_constr.res: -------------------------------------------------------------------------------- 1 | type a = .. 2 | 3 | type a 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/repeated_def_modules.res: -------------------------------------------------------------------------------- 1 | module M = {} 2 | 3 | module M = {} 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/suggest_module_for_missing_identifier.res: -------------------------------------------------------------------------------- 1 | console.log("Hello") 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/unused_variable.res: -------------------------------------------------------------------------------- 1 | let x = { 2 | let f = 12 3 | 13 4 | } 5 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/strange_file_names/404.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let x = 123 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/strange_file_names/_under.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let x = 123 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/ast-mapping/FunWithAttribute.res: -------------------------------------------------------------------------------- 1 | type fn = (@as("something") ~foo: string) => int -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/pattern/recordFieldWrongAssignment.res: -------------------------------------------------------------------------------- 1 | let {foo=bar} = record 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/escapeSequence.res: -------------------------------------------------------------------------------- 1 | let x = "\055" 2 | 3 | let x = "\123" 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInExpr2.res: -------------------------------------------------------------------------------- 1 | let r = {a: 1, type: 2} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInPattern.res: -------------------------------------------------------------------------------- 1 | let {type} = r 2 | 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/expected/emptyRecord.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec record = { 2 | } -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/namedParameters.res: -------------------------------------------------------------------------------- 1 | type draw = (stroke: pencil) => unit 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/interface/expected/interface.resi.txt: -------------------------------------------------------------------------------- 1 | val x : int 2 | val s : string -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/expected/diamond.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec ('a, 'b) t = .. -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typexpr/expected/any.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec t = _ 2 | let (t : _) = x -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typexpr/parenthesized.res: -------------------------------------------------------------------------------- 1 | type t = @attr ((~a: int) => unit) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/singleLineCommentWithoutNewline.res.txt: -------------------------------------------------------------------------------- 1 | ;;RootView.init () -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/onlyMultilineComment.res: -------------------------------------------------------------------------------- 1 | /* 2 | * one comment 3 | * here 4 | */ 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/whitespaceCase2.res: -------------------------------------------------------------------------------- 1 | let a = 2 | 2 // c2 3 | 4 | let b = 1 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modExpr/await.res: -------------------------------------------------------------------------------- 1 | module M = await ME 2 | 3 | module M = await (ME: MT) 4 | -------------------------------------------------------------------------------- /tests/tests/src/ModuleWithAlias.res: -------------------------------------------------------------------------------- 1 | let x = 12 2 | 3 | module VS = VariantSpreads 4 | 5 | let y = 13 6 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_2474.res: -------------------------------------------------------------------------------- 1 | @@warning("-a") 2 | let coordinates = 1 3 | 4 | /* let 2 = coordinates */ 5 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_2487.res: -------------------------------------------------------------------------------- 1 | module A = Belt.Array 2 | 3 | let b = A.eq([1, 2, 3], [1, 2, 3], \"==") 4 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3895_test.res: -------------------------------------------------------------------------------- 1 | let f = re => { 2 | let _ = re->Js.Re.exec_("banana") 3 | 3 4 | } 5 | -------------------------------------------------------------------------------- /tests/tests/src/import2.res: -------------------------------------------------------------------------------- 1 | let a = Js.import(Import_external.makeA) 2 | let b = Import_external.makeA 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadRT.resi: -------------------------------------------------------------------------------- 1 | type moduleAccessPath = 2 | | Root(string) 3 | | Kaboom 4 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/EverythingLiveHere.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | let y = 3 4 | 5 | let z = 4 6 | -------------------------------------------------------------------------------- /analysis/examples/workspace-project/common/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "common", 3 | "version": "0.1.0" 4 | } -------------------------------------------------------------------------------- /analysis/examples/workspace-project/myplugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myplugin", 3 | "version": "0.1.0" 4 | } -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/InnerModuleTypes.res: -------------------------------------------------------------------------------- 1 | module I = { 2 | type t = Foo 3 | } 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/InnerModuleTypes.resi: -------------------------------------------------------------------------------- 1 | module I: { 2 | type t = Foo 3 | } 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/TestInnedModuleTypes.res: -------------------------------------------------------------------------------- 1 | let _ = InnerModuleTypes.I.Foo 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt: -------------------------------------------------------------------------------- 1 | {"data":[0,0,2,1,0]} 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt: -------------------------------------------------------------------------------- 1 | {"data":[0,4,1,1,0,0,16,3,1,0]} 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Auto.res: -------------------------------------------------------------------------------- 1 | open! ShadowedBelt 2 | 3 | let m = List.map 4 | // ^hov 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/CompletionResolve.res: -------------------------------------------------------------------------------- 1 | // ^cre Belt_Array 2 | 3 | // ^cre ModuleStuff 4 | 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/inner/ComponentInner.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: unit => React.element 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/inner/ReferencesInner.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = () => -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/comparison_operator.res: -------------------------------------------------------------------------------- 1 | let f = Some(0) 2 | 3 | let x = 100 === f 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/highlighting3.res: -------------------------------------------------------------------------------- 1 | let a: int = "helllllll 2 | 3 | loooooooooooooo" 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/math_operator_constant.res: -------------------------------------------------------------------------------- 1 | let num = 0 2 | 3 | let x = num + 12. 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/moreArguments1.res: -------------------------------------------------------------------------------- 1 | let x = (~a, ~b) => a + b 2 | let y = x(~a=2) + 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/moreArguments3.res: -------------------------------------------------------------------------------- 1 | let x = (a, b, c, d) => a + b 2 | let y = x(2) + 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/non_function_uncurried_apply.res: -------------------------------------------------------------------------------- 1 | let nonfun = 2 2 | let _ = nonfun(3) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_abstract_type.res: -------------------------------------------------------------------------------- 1 | type a 2 | type b = | ...a | Other 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/while_condition.res: -------------------------------------------------------------------------------- 1 | while "horse" { 2 | Console.log("What") 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/NumericPolyVar.res: -------------------------------------------------------------------------------- 1 | @genType 2 | type t = [#12 | #0 | #b] 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Wrapper.res: -------------------------------------------------------------------------------- 1 | @genType 2 | module MyModuleAlias = MyModule 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/strange_file_names/AppModal.web.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let x = 123 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/emptyBlock.res: -------------------------------------------------------------------------------- 1 | let x = {} 2 | 3 | let f = (a, b) => {} 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/closingBraces.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | }}} 4 | 5 | let y = 2 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/letBindingPatternKeyword.res: -------------------------------------------------------------------------------- 1 | let open = 1 2 | let for = 3 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInPattern2.res: -------------------------------------------------------------------------------- 1 | let {a: _, type: x} = r 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/recordMutable.res: -------------------------------------------------------------------------------- 1 | type d = { 2 | foo: string, mutable 3 | } 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/expected/typeNonrec.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec t = 2 | | Water -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/expected/semi.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec t = 2 | | Red 3 | ;;Red 4 | ;;foo := 1 -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/expression/emptyBlock.res: -------------------------------------------------------------------------------- 1 | let x = {} 2 | 3 | let f = (a, b) => {} 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/string/expected/unclosed.res.txt: -------------------------------------------------------------------------------- 1 | let x = {js|unclosed|js} 2 | let y = 1 -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/expected/whitespaceCase2.res.txt: -------------------------------------------------------------------------------- 1 | let a = 2 // c2 2 | 3 | let b = 1 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/expr/letexception.res: -------------------------------------------------------------------------------- 1 | let x = { 2 | exception Foo 3 | sideEffect 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modType/extension.res: -------------------------------------------------------------------------------- 1 | module type ReactInterface = %import("react-bindings") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/structure/open.res: -------------------------------------------------------------------------------- 1 | open Belt 2 | 3 | @attr 4 | open Belt 5 | 6 | open! Belt 7 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_1717_test.res: -------------------------------------------------------------------------------- 1 | module rec A: {} = {} 2 | 3 | module rec A0: {} = {} 4 | and A1: {} = {} 5 | -------------------------------------------------------------------------------- /tests/tests/src/test_order.res: -------------------------------------------------------------------------------- 1 | type t = int 2 | let compare = (x: int, y: int) => Pervasives.compare(x, y) 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/exception/ExnB.res: -------------------------------------------------------------------------------- 1 | @raises(Not_found) 2 | let foo = () => throw(Not_found) 3 | -------------------------------------------------------------------------------- /analysis/examples/workspace-project/app/src/App.res: -------------------------------------------------------------------------------- 1 | let _ = Myplugin.Promise.resolve(Utils.printError("Oh no!")) 2 | -------------------------------------------------------------------------------- /analysis/vendor/json/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name jsonlib) 3 | (wrapped false) 4 | (flags -w "-9") 5 | (libraries)) 6 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/Diagnostics.res: -------------------------------------------------------------------------------- 1 | let = 1 + 1.0 2 | let add = =2 3 | lett a = 2 4 | 5 | //^dia -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/SemanticTokensArray.res: -------------------------------------------------------------------------------- 1 | let xs = [1, 2] 2 | let ys = [...xs, 3] 3 | //^sem 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt: -------------------------------------------------------------------------------- 1 | {"data":[0,4,4,1,0,1,2,1,3,0,0,1,4,7,0]} 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Dce.res: -------------------------------------------------------------------------------- 1 | // Note: in test mode this only reports on src/dce 2 | 3 | // ^dce 4 | 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/ShadowedBelt.res: -------------------------------------------------------------------------------- 1 | module List = { 2 | let map = (l, fn) => List.map(fn, l) 3 | } 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/inner/ReferencesInner.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: unit => React.element 3 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "0.1.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "0.1.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/duplicated_symlinked_packages/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "0.1.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/UntaggedUnknown.res: -------------------------------------------------------------------------------- 1 | @unboxed 2 | type t = List(list) | Float(float) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/collections.res: -------------------------------------------------------------------------------- 1 | /* wrong type in a list */ 2 | list{1, 2, "Hello"}->ignore 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/curry_in_uncurry.res: -------------------------------------------------------------------------------- 1 | let f = (a, b) => a + b 2 | 3 | f(2, 2)->Console.log 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/for_loop_condition.res: -------------------------------------------------------------------------------- 1 | for x in 0 to "10" { 2 | Console.log(x) 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/highlighting2.res: -------------------------------------------------------------------------------- 1 | let a: int = "hel 2 | 3 | lo" 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/missing_labels.res: -------------------------------------------------------------------------------- 1 | let f = (~a, ~b) => a ++ b 2 | 3 | let _ = f("", "") 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/moreArguments4.res: -------------------------------------------------------------------------------- 1 | let x = (a, ~b, ~c, ~d) => a + b 2 | let y = x(2) + 2 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/opt_args_arity.res: -------------------------------------------------------------------------------- 1 | let f = (~a=0, b, c) => a + b + c 2 | let x = f(42) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/syntaxErrors2.res: -------------------------------------------------------------------------------- 1 | let () = 2 | I'm glad you're looking at this file =) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/try_catch_same_type.res: -------------------------------------------------------------------------------- 1 | let x = try {1} catch { 2 | | _ => "hello" 3 | } 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/uncurried_expected.res: -------------------------------------------------------------------------------- 1 | let apply = f => f(1) 2 | let z = apply(x => x + 1) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/unknown_tagged_template_function.res: -------------------------------------------------------------------------------- 1 | let res = tagg`| 5 × 10 = ${5} |` 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/unused_warnings.res: -------------------------------------------------------------------------------- 1 | let a = 3 2 | let a = 33 + 3 3 | let a = 33 + 3 + 3 4 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Machine.res: -------------------------------------------------------------------------------- 1 | type aa = A(int) 2 | 3 | @genType 4 | let a = A(3) 5 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/strange_file_names/with_underscore.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let x = 123 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/shared/Date.res: -------------------------------------------------------------------------------- 1 | let iso8601 = t => t->DateFns.format("YYYY-MM-DD") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/signature/closingBraces.resi: -------------------------------------------------------------------------------- 1 | let x: int 2 | 3 | }}} 4 | 5 | let y: int 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/emptyInlineRecord.res: -------------------------------------------------------------------------------- 1 | type node<'a> = 2 | | Nil 3 | | Node({}) 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/modexpr/constrained.res: -------------------------------------------------------------------------------- 1 | module X = (A: MyMod) 2 | 3 | include (X : MyMod) 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/onlyMultilineComment.resi: -------------------------------------------------------------------------------- 1 | /* 2 | * multi 3 | * line 4 | * comment 5 | */ 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/expression/infinite.res: -------------------------------------------------------------------------------- 1 | let smallest = 2 | heap.compare(.) < a->f(b) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/string/es6template.res: -------------------------------------------------------------------------------- 1 | let x = `this contains ${foo}, missing closing 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/expected/fileWithOneSingleLineComment.res.txt: -------------------------------------------------------------------------------- 1 | // retain this comment 2 | 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/interfaceWithOnlyComments.resi: -------------------------------------------------------------------------------- 1 | // test 2 | 3 | /* test */ 4 | 5 | // ok 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/reasonInterfaceFile.resi: -------------------------------------------------------------------------------- 1 | /* parse reason interface file */ 2 | let x: int 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/extension.resi: -------------------------------------------------------------------------------- 1 | %%raw("eval(js)") 2 | 3 | @attr 4 | %%extension(payload) 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/open.resi: -------------------------------------------------------------------------------- 1 | open Belt 2 | 3 | open! Belt 4 | 5 | @attr 6 | open Belt 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/typext.resi: -------------------------------------------------------------------------------- 1 | type Rgb.color += 2 | | Red 3 | | Blue 4 | | Green 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/missingPipeBeforeConstructorAttribute.res: -------------------------------------------------------------------------------- 1 | type t = @as("one") One 2 | 3 | -------------------------------------------------------------------------------- /tests/tests/src/esmodule_ref.res: -------------------------------------------------------------------------------- 1 | assert(!Escape_esmodule.__esModule) 2 | Console.log(Escape_esmodule.__esModule) 3 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3852_alias.res: -------------------------------------------------------------------------------- 1 | module A = Gpr_3852_effect 2 | 3 | /* It should generate a dummy JS file */ 4 | -------------------------------------------------------------------------------- /tests/tests/src/import_side_effect.res: -------------------------------------------------------------------------------- 1 | let a = Js.import(Side_effect2.a) 2 | 3 | module M = await Side_effect 4 | -------------------------------------------------------------------------------- /tests/tests/src/obj_type_test.res: -------------------------------------------------------------------------------- 1 | type x = {"x": int, "y": 'self => int} as 'self 2 | 3 | let f = (u: x): x => u 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/ModC.res: -------------------------------------------------------------------------------- 1 | /** 2 | User Module 3 | */ 4 | module User = { 5 | let name = "ReScript" 6 | } 7 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/NestedModulesInSignature.res: -------------------------------------------------------------------------------- 1 | module Universe = { 2 | let theAnswer = 42 3 | } 4 | -------------------------------------------------------------------------------- /compiler/ext/ext_spec.mli: -------------------------------------------------------------------------------- 1 | type 'a t = (string * 'a * string) array 2 | 3 | val assoc3 : 'a t -> string -> 'a option 4 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/new-namespace/src/NS_alias.res: -------------------------------------------------------------------------------- 1 | let hello_world = () => "Hello world" 2 | Other_module.bla() 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadCodeInterface.res: -------------------------------------------------------------------------------- 1 | module type T = { 2 | let x: int 3 | } 4 | 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadValueTest.resi: -------------------------------------------------------------------------------- 1 | let valueAlive: int 2 | let valueDead: int 3 | 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/SemanticTokensArrayAccess.res: -------------------------------------------------------------------------------- 1 | let x = xs[0] 2 | let x = xs[index] 3 | //^sem 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt: -------------------------------------------------------------------------------- 1 | {"data":[0,4,2,1,0,1,4,2,1,0,0,9,2,1,0]} 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/UntaggedNonUnary2.res: -------------------------------------------------------------------------------- 1 | @unboxed 2 | type t = Tuple(int, string) | Float(float) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/deprecated_with_automigration.res: -------------------------------------------------------------------------------- 1 | let _ = Js.Array2.map([1, 2], v => v + 1) 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/let_unwrap_on_top_level_not_enabled.res: -------------------------------------------------------------------------------- 1 | let x = Ok(1) 2 | 3 | let? Ok(_) = x 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/partial_app.res: -------------------------------------------------------------------------------- 1 | let f = (a, b, c) => { 2 | a + b + c 3 | } 4 | 5 | f(1, 2) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives3.res: -------------------------------------------------------------------------------- 1 | /* Too many arguments */ 2 | let x = a => a + 2 3 | x(2, 4) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/repeated_def_module_types.res: -------------------------------------------------------------------------------- 1 | module type M = {} 2 | 3 | module type M = {} 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_extensible_variant.res: -------------------------------------------------------------------------------- 1 | type a = .. 2 | type b = | ...a | Other 3 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/transitive_dependency/node_modules/c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "c", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/x-y/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "x-y", 3 | "version": "0.1.0", 4 | "sources": ["x-src"] 5 | } 6 | -------------------------------------------------------------------------------- /tests/dependencies/rescript-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tests/rescript-react", 3 | "private": true 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/ast-mapping/expected/FunWithAttribute.res.txt: -------------------------------------------------------------------------------- 1 | type fn = (@as("something") ~foo: string) => int 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/layouts/StudentTopNav__Types.res: -------------------------------------------------------------------------------- 1 | module NavLink = StudentTopNav__NavLink 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/schools/CourseAuthors__Types.res: -------------------------------------------------------------------------------- 1 | module Author = CourseAuthors__Author 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/schools/CourseEditor__Types.res: -------------------------------------------------------------------------------- 1 | module Course = CourseEditor__Course 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/expected/emptyBlock.res.txt: -------------------------------------------------------------------------------- 1 | let x = { } 2 | let f [arity:2]a b = { } -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/letUnwrapRec.res: -------------------------------------------------------------------------------- 1 | let? rec Some(baz) = someOption 2 | and Some(bar) = baz -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/scanner/expected/escapeSequence.res.txt: -------------------------------------------------------------------------------- 1 | let x = {js|\x37|js} 2 | let x = {js|\x7b|js} -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/recordDocComment.res: -------------------------------------------------------------------------------- 1 | type a = { 2 | foo: string, /** here */ 3 | } 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/modexpr/expected/constrained.res.txt: -------------------------------------------------------------------------------- 1 | module X : MyMod = A 2 | include (X : MyMod) -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/module.res: -------------------------------------------------------------------------------- 1 | module A: Map = {let m = 2} 2 | module A = {let m = 2} 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/expression/expected/emptyBlock.res.txt: -------------------------------------------------------------------------------- 1 | let x = { } 2 | let f [arity:2]a b = { } -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/pattern/array.res: -------------------------------------------------------------------------------- 1 | switch x { 2 | | [a, b => () 3 | | [a, [c, d => () 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/expected/interfaceWithOneSingleComment.resi.txt: -------------------------------------------------------------------------------- 1 | // retain this comment 2 | 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/expr/expected/letexception.res.txt: -------------------------------------------------------------------------------- 1 | let x = { 2 | exception Foo 3 | sideEffect 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modExpr/expected/await.res.txt: -------------------------------------------------------------------------------- 1 | module M = await ME 2 | 3 | module M = await (ME: MT) 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/alias.res: -------------------------------------------------------------------------------- 1 | let x as y = 1 2 | let (x as y) as z = 1 3 | let (Foo | Bar) as x = 1 4 | -------------------------------------------------------------------------------- /tests/tests/src/test_const_propogate.res: -------------------------------------------------------------------------------- 1 | let f = x => 2 | if 5 > 3 { 3 | x 4 | } else { 5 | x + 1 6 | } 7 | -------------------------------------------------------------------------------- /tests/tests/src/test_nested_let.res: -------------------------------------------------------------------------------- 1 | let v = { 2 | let a = 3 3 | let b = 32 4 | let c = 33 5 | a + b + c 6 | } 7 | -------------------------------------------------------------------------------- /analysis/examples/example-project/src/B.re: -------------------------------------------------------------------------------- 1 | 2 | 3 | let x = 12 4 | 5 | 6 | let y = 44 7 | 8 | 9 | let z = 123 10 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadCodeImplementation.res: -------------------------------------------------------------------------------- 1 | module M: DeadCodeInterface.T = { 2 | let x = 42 3 | } 4 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DynamicallyLoadedComponent.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~s) => React.string(s) 3 | -------------------------------------------------------------------------------- /analysis/reanalyze/src/LocSet.ml: -------------------------------------------------------------------------------- 1 | include Set.Make (struct 2 | include Location 3 | 4 | let compare = compare 5 | end) 6 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/dep01/src/Dep01.res: -------------------------------------------------------------------------------- 1 | let log = () => { 2 | Console.log("02") 3 | Dep02.log() 4 | } 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/exception/ExnB.res: -------------------------------------------------------------------------------- 1 | @throws(Not_found) 2 | let foo = () => throw(Not_found) 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/SemanticTokens.res: -------------------------------------------------------------------------------- 1 | let make = () => { 2 | 3 | } 4 | //^sem 5 | -------------------------------------------------------------------------------- /tests/build_tests/exports/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "exports", 3 | "version": "0.1.0", 4 | "sources": ["src"] 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/gpr_978/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gpr_978", 3 | "version": "0.0.0", 4 | "sources": ["src"] 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/jsx_settings_inheritance/node_modules/a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "a", 3 | "version": "0.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/jsx_settings_inheritance/node_modules/b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "b", 3 | "version": "0.0.0" 4 | } -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/DerivingAccessorsRecordParam.res: -------------------------------------------------------------------------------- 1 | @deriving(accessors) 2 | type t = Struct({a: int}) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/duplicate_labels_error.res: -------------------------------------------------------------------------------- 1 | type rcrd = { 2 | name: string, 3 | name: int, 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/if_branch_mismatch.res: -------------------------------------------------------------------------------- 1 | let x = if true { 2 | "123" 3 | } else { 4 | 123 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/multiple_tag_1.res: -------------------------------------------------------------------------------- 1 | type ambiguous1 = 2 | | @as("x") A(int) 3 | | @as("x") B(int) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/multiple_tag_2.res: -------------------------------------------------------------------------------- 1 | type ambiguous2 = 2 | | @as(3) A(int) 3 | | @as(3) B(int) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/warnings1.res: -------------------------------------------------------------------------------- 1 | let x = (a, b) => a + b 2 | let z = () => { 3 | x(10) 4 | 10 5 | } 6 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/LetPrivate.res: -------------------------------------------------------------------------------- 1 | %%private(@genType let x = 34) 2 | 3 | @genType let y = x 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/stringLiteral.res: -------------------------------------------------------------------------------- 1 | switch x { 2 | | "\055" => () 3 | | "\123" => () 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/record.res: -------------------------------------------------------------------------------- 1 | type observation = { 2 | observed: int, 3 | observer: 4 | } 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/expected/modType.res.txt: -------------------------------------------------------------------------------- 1 | module type X = Foo 2 | module type X = Foo[@@attr ] -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/modType.res: -------------------------------------------------------------------------------- 1 | module type X = Foo 2 | 3 | @attr 4 | module type X = Foo 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typexpr/expected/parenthesized.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec t = ((a:int -> unit (a:1))[@attr ]) -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/expression/expected/infinite.res.txt: -------------------------------------------------------------------------------- 1 | let smallest = (heap.compare ()) < (a -> (f b)) -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/expression/if.res: -------------------------------------------------------------------------------- 1 | if (foo == bar) Js.log("if-branch") else Js.log("else-branch") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/typeDef/typeParams.res: -------------------------------------------------------------------------------- 1 | type node('a) = { 2 | _value: Js.Nullable.value<'a> 3 | } 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/modType/expected/extension.res.txt: -------------------------------------------------------------------------------- 1 | module type ReactInterface = %import("react-bindings") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/expected/reasonInterfaceFile.resi.txt: -------------------------------------------------------------------------------- 1 | /* parse reason interface file */ 2 | let x: int 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/expected/open.resi.txt: -------------------------------------------------------------------------------- 1 | open Belt 2 | 3 | open! Belt 4 | 5 | @attr 6 | open Belt 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/expected/typext.resi.txt: -------------------------------------------------------------------------------- 1 | type Rgb.color += 2 | | Red 3 | | Blue 4 | | Green 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/structure/expected/open.res.txt: -------------------------------------------------------------------------------- 1 | open Belt 2 | 3 | @attr 4 | open Belt 5 | 6 | open! Belt 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/expected/missingPipeBeforeConstructorAttribute.res.txt: -------------------------------------------------------------------------------- 1 | type t = | @as("one") One 2 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_a_B.res: -------------------------------------------------------------------------------- 1 | module B = { 2 | let value = 3 3 | } 4 | module A = { 5 | let u = B.value 6 | } 7 | -------------------------------------------------------------------------------- /tests/tests/src/conditional/cond_a_C.res: -------------------------------------------------------------------------------- 1 | module C = { 2 | let value = 3 3 | } 4 | module A = { 5 | let u = C.value 6 | } 7 | -------------------------------------------------------------------------------- /tests/tests/src/effect.res: -------------------------------------------------------------------------------- 1 | let a = 3 2 | let b = 4 3 | let () = Console.log("hello") 4 | Console.log("hey") 5 | let c = 3 6 | -------------------------------------------------------------------------------- /tests/tests/src/test_nested_print.res: -------------------------------------------------------------------------------- 1 | let u = (x, x) => x + x 2 | let f = (g, x) => { 3 | let u = g(x) 4 | u + u 5 | } 6 | -------------------------------------------------------------------------------- /tools/src/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name tools) 3 | (flags 4 | (-w "+6+26+27+32+33+39")) 5 | (libraries analysis cmarkit)) 6 | -------------------------------------------------------------------------------- /analysis/examples/example-project/src/More.resi: -------------------------------------------------------------------------------- 1 | let contnets: string 2 | let inner: int 3 | let n: int 4 | let party: int 5 | 6 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadRT.resi: -------------------------------------------------------------------------------- 1 | type moduleAccessPath = 2 | | Root(string) 3 | | Kaboom 4 | 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/EverythingLiveHere.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | let y = 3 4 | 5 | let z = 4 6 | 7 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/Div.res: -------------------------------------------------------------------------------- 1 | let q =
2 | // ^hov 3 | 4 | //
34 2 | let makeVariables = makeVar(1, 2, 3) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/method_arity_mismatch.res: -------------------------------------------------------------------------------- 1 | let f = obj => { 2 | obj["hi"](1, 2) 3 | obj["hi"](1) 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/polyvariants_no_overlap.res: -------------------------------------------------------------------------------- 1 | let a: [#Resize | #KeyDown] = #Resize 2 | let b: [#Click] = a 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives5.res: -------------------------------------------------------------------------------- 1 | /* Not enough arguments */ 2 | type x = X(int, float) 3 | X(10)->ignore 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_constructor_expects_inline_record.res: -------------------------------------------------------------------------------- 1 | type x = One({test: bool}) 2 | let f = One 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/wrong_name_record_field.res: -------------------------------------------------------------------------------- 1 | type d = {z: int} 2 | 3 | let ff: d = { 4 | zz: 123, 5 | } 6 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/ModuleResolution2.res: -------------------------------------------------------------------------------- 1 | @genType 2 | type t2 = {dependency: ModuleResolution1.t1} 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/NestedModulesInSignature.res: -------------------------------------------------------------------------------- 1 | module Universe = { 2 | let theAnswer = 42 3 | } 4 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/Usage.res: -------------------------------------------------------------------------------- 1 | let a = 5 2 | @genType 3 | let b = Wrapper.MyModuleAlias.add(a, 3) 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/layouts/SchoolAdminNavbar__Types.res: -------------------------------------------------------------------------------- 1 | module Course = SchoolAdminNavbar__Course 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/schools/CoachesSchoolIndex__Types.res: -------------------------------------------------------------------------------- 1 | module Coach = CoachesSchoolIndex__Coach 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/if.res: -------------------------------------------------------------------------------- 1 | // missing brace below 2 | if (match) 3 | let a = 1 4 | a + 1 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/object.res: -------------------------------------------------------------------------------- 1 | let obj = {"\055": "octal escape", "\123": "another octal escape"} 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/oldArraySyntax.res: -------------------------------------------------------------------------------- 1 | // Old Reason array literal 2 | let s = [|1, 2, 3|] 3 | 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/typeDefInFunction.res: -------------------------------------------------------------------------------- 1 | let f = () => { 2 | type t = int 3 | 1 4 | } 5 | 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/signature/expected/let.res.txt: -------------------------------------------------------------------------------- 1 | module type Sig = sig val x : int val y : string[@@attr ] end -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/includeStatement.res: -------------------------------------------------------------------------------- 1 | include Belt.Array 2 | 3 | @onInclude include Belt.Array 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/missingPipeBeforeConstructorAttribute.res: -------------------------------------------------------------------------------- 1 | type t = @as("one") One 2 | 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/signature/expected/extension.resi.txt: -------------------------------------------------------------------------------- 1 | %%raw("eval(js)") 2 | 3 | @attr 4 | %%extension(payload) 5 | -------------------------------------------------------------------------------- /tests/tests/src/EnvUnifiedOps.res: -------------------------------------------------------------------------------- 1 | module X = { 2 | type t = int 3 | let n: t => t = x => x + 1 4 | } 5 | 6 | let z: X.t = 3 7 | -------------------------------------------------------------------------------- /tests/tests/src/function_directives.res: -------------------------------------------------------------------------------- 1 | let testFnWithDirective = @directive("'use memo'") (name: string) => "Hello " ++ name 2 | -------------------------------------------------------------------------------- /tests/tests/src/raw_arity.res: -------------------------------------------------------------------------------- 1 | let foo: int => int = %raw(`function add(x, y=5){ return x + y }`) 2 | 3 | Console.log(foo(2)) 4 | -------------------------------------------------------------------------------- /tests/tests/src/test_char.res: -------------------------------------------------------------------------------- 1 | let caml_is_printable = c => { 2 | let code = Char.code(c) 3 | code > 31 && code < 127 4 | } 5 | -------------------------------------------------------------------------------- /tests/tools_tests/src/ModC.resi: -------------------------------------------------------------------------------- 1 | /** 2 | User Module from interface file 3 | */ 4 | module User: { 5 | let name: string 6 | } 7 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_Set.res: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.Set.t 2 | external s: Js.Set.t = "s" 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/DeadTestWithInterface.res: -------------------------------------------------------------------------------- 1 | module Ext_buffer: { 2 | let x: int 3 | } = { 4 | let x = 42 5 | } 6 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/JSResource.res: -------------------------------------------------------------------------------- 1 | type t<'a> 2 | 3 | @module external jSResource: string => t<'a> = "JSResource" 4 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/LetPrivate.res: -------------------------------------------------------------------------------- 1 | %%private( 2 | @genType 3 | let x = 34 4 | ) 5 | 6 | @genType 7 | let y = x 8 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/NestedModulesInSignature.resi: -------------------------------------------------------------------------------- 1 | module Universe: { 2 | @genType 3 | let theAnswer: int 4 | } 5 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/TypeParams1.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type ocaml_array<'a> = array<'a> 3 | 4 | let exportSomething = 10 5 | -------------------------------------------------------------------------------- /compiler/bsb/bsb_config_load.mli: -------------------------------------------------------------------------------- 1 | val load_json : 2 | per_proj_dir:string -> warn_legacy_config:bool -> string * Ext_json_types.t 3 | -------------------------------------------------------------------------------- /rewatch/rewatch.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM no need to branch on OS here, it will only be used on windows 3 | %~dp0\rewatch-windows.exe %* 4 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/standalone/src/Standalone.res: -------------------------------------------------------------------------------- 1 | let standalone = () => { 2 | Dep01.log() 3 | Js.log("standalone") 4 | } -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/NestedModulesInSignature.res: -------------------------------------------------------------------------------- 1 | module Universe = { 2 | let theAnswer = 42 3 | } 4 | 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/arity_mismatch.res: -------------------------------------------------------------------------------- 1 | let makeVar = (~f, ()) => 34 2 | let makeVariables = makeVar(~f=f => f) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/arity_mismatch4.res: -------------------------------------------------------------------------------- 1 | let makeVar = (~f) => 34 2 | let makeVariables = makeVar(1, ~f=f => f) 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/top_level_fn_call_not_unit.res: -------------------------------------------------------------------------------- 1 | let returnsSomething = () => 123 2 | 3 | returnsSomething() 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_type_parameters.res: -------------------------------------------------------------------------------- 1 | type a<'a> = One | Two('a) 2 | type b = | ...a | Three 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/OnClick2.res: -------------------------------------------------------------------------------- 1 | @genType @react.component 2 | let make = (~onClick) =>
3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/underscoreSugar.res: -------------------------------------------------------------------------------- 1 | let photo = pricedRoom["room"]["photos"]->filterNone->Array.get(_, 0) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/bs-webapi/src/Webapi/Webapi__Performance.res: -------------------------------------------------------------------------------- 1 | type t 2 | 3 | @send external now: t => float = "" 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/ludum-dare-46/IndexHot.res: -------------------------------------------------------------------------------- 1 | let a = Json.parse("{}") 2 | Reprocessing.hotreload("src/index.re") 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/shared/Loading.res: -------------------------------------------------------------------------------- 1 | type t = 2 | | NotLoading 3 | | Reloading 4 | | LoadingMore 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/reasongl/ReasonglInterface.res: -------------------------------------------------------------------------------- 1 | module Gl = RGLInterface 2 | 3 | module Constants = RGLConstants 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/array.res: -------------------------------------------------------------------------------- 1 | // missing ] before ) 2 | let xs = x.map(key => [key, predicates[key]) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/expected/stringLiteral.res.txt: -------------------------------------------------------------------------------- 1 | ;;match x with | {js|\x37|js} -> () | {js|\x7b|js} -> () -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/labelledArgumentMissingEqual.res: -------------------------------------------------------------------------------- 1 | let _ = fn(~foo:1) 2 | let _ = fn(~bar:?value) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/expressions/oldDataLastPipe.res: -------------------------------------------------------------------------------- 1 | // Old data-last pipe 2 | let x = f => f |> String.length 3 | 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInType.res: -------------------------------------------------------------------------------- 1 | type r = { 2 | id: string, 3 | type: int, 4 | } 5 | 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/modexpr/expected/structure.res.txt: -------------------------------------------------------------------------------- 1 | module X = struct let a = 1 end 2 | include struct let b = 2 end -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/expected/includeStatement.res.txt: -------------------------------------------------------------------------------- 1 | include Belt.Array 2 | include Belt.Array[@@onInclude ] -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/diamond.res: -------------------------------------------------------------------------------- 1 | // >= shouldn't be picked up as infix op 2 | type t<'a, 'b>= .. 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/typexpr/typeConstructorArgs.res: -------------------------------------------------------------------------------- 1 | type node<'a> = { 2 | _value: Js.Nullable.value('a) 3 | } 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/expected/interfaceWithOnlyComments.resi.txt: -------------------------------------------------------------------------------- 1 | // test 2 | 3 | /* test */ 4 | 5 | // ok 6 | 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/expected/alias.res.txt: -------------------------------------------------------------------------------- 1 | let x as y = 1 2 | let (x as y) as z = 1 3 | let (Foo | Bar) as x = 1 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/pattern/expected/lazy.res.txt: -------------------------------------------------------------------------------- 1 | let lazy x = 1 2 | let lazy (Foo | Bar) = 1 3 | let lazy (x as y) = 1 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/constraint.res: -------------------------------------------------------------------------------- 1 | type t = Reducer 2 | constraint 't = @attr ('state, 'action) => 'nextSubtree 3 | -------------------------------------------------------------------------------- /tests/tests/src/UncurriedPervasives.res: -------------------------------------------------------------------------------- 1 | @@uncurried 2 | let n: _ => unit = ignore // Check that we're pulling in uncurried pervasives 3 | -------------------------------------------------------------------------------- /tests/tests/src/external_ppx2.res: -------------------------------------------------------------------------------- 1 | external f: (@as("\h\e\l\lo") _, int) => unit = "f" 2 | 3 | let x = "\h\e\l\lo" 4 | let y = f(42) 5 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3897_test.res: -------------------------------------------------------------------------------- 1 | module type S = { 2 | let x: int 3 | } 4 | 5 | module Make = (U: S) => { 6 | include U 7 | } 8 | -------------------------------------------------------------------------------- /tests/tests/src/more_uncurry.res: -------------------------------------------------------------------------------- 1 | let f = (x, y, x_) => 2 | switch x_ { 3 | | None => x + y 4 | | Some(z) => x + y + z 5 | } 6 | -------------------------------------------------------------------------------- /tests/tests/src/test_match_exception.res: -------------------------------------------------------------------------------- 1 | let f = (g, x) => 2 | switch g(x) { 3 | | y => y 4 | | exception Not_found => 3 5 | } 6 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_Map.res: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.Map.t 2 | external m: Js.Map.t = "m" 3 | -------------------------------------------------------------------------------- /tools/src/migrate.mli: -------------------------------------------------------------------------------- 1 | val migrate : 2 | entryPointFile:string -> 3 | outputMode:[`File | `Stdout] -> 4 | (string, string) result 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadCodeImplementation.res: -------------------------------------------------------------------------------- 1 | module M: DeadCodeInterface.T = { 2 | let x = 42 3 | } 4 | 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/OptionalImplIntf.res: -------------------------------------------------------------------------------- 1 | module M: { 2 | type t = {x?: int} 3 | } = { 4 | type t = {x: int} 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/UntaggedTupleAndArray.res: -------------------------------------------------------------------------------- 1 | @unboxed 2 | type t = 3 | | Array(array) 4 | | Tuple((int, int)) 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/duplicate_as_tag_inline_record.res: -------------------------------------------------------------------------------- 1 | type animal = Cat({@as("catName") @as("catName2") name: string}) 2 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/pattern_matching_on_value_but_is_option.res: -------------------------------------------------------------------------------- 1 | let x = Some(1) 2 | 3 | switch x { 4 | | 1 => () 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/primitives6.res: -------------------------------------------------------------------------------- 1 | /* Wrong constructor argument */ 2 | type x = X(int, float) 3 | X(10, 10)->ignore 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/suggest_module_for_missing_identifier_with_spellcheck.res: -------------------------------------------------------------------------------- 1 | let consol = 1 2 | console.log("Hello") 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/DynamicallyLoadedComponent.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~s) => React.string(s) 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/ModuleResolution1.res: -------------------------------------------------------------------------------- 1 | @genType 2 | type t1 = { 3 | foo: string, 4 | bar: int, 5 | } 6 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/NestedModulesInSignature.resi: -------------------------------------------------------------------------------- 1 | module Universe: { 2 | @genType let theAnswer: int 3 | } 4 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/api/resSyntax.res: -------------------------------------------------------------------------------- 1 | // test file 2 | 3 | if true { 4 | Js.log("true") 5 | } else { 6 | Js.log("false") 7 | } 8 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/unicode.res: -------------------------------------------------------------------------------- 1 | let x = "✅ foo bar" 2 | 3 | let x = "\n okokok" 4 | 5 | let z = "\t \b \n okok 🙈" 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/covid-19charts.com/src/CopyToClipboard.res: -------------------------------------------------------------------------------- 1 | @module external copy: string => unit = "copy-to-clipboard" 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/nook-exchange/TemporaryState.res: -------------------------------------------------------------------------------- 1 | type t = FromProfileBrowser 2 | let state: ref> = ref(None) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/schools/SchoolCustomize__Types.res: -------------------------------------------------------------------------------- 1 | module Customizations = SchoolCustomize__Customizations 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/signature/attributes.resi: -------------------------------------------------------------------------------- 1 | module type MissingItem = { 2 | @attr 3 | } 4 | 5 | @attrWithoutItem 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/expected/emptyInlineRecord.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec 'a node = 2 | | Nil 3 | | Node of { 4 | } -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/modexpr/structure.res: -------------------------------------------------------------------------------- 1 | module X = { 2 | let a = 1 3 | } 4 | 5 | include { 6 | let b = 2 7 | } 8 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/signature/let.res: -------------------------------------------------------------------------------- 1 | module type Sig = { 2 | let x: int 3 | 4 | @attr 5 | let y: string 6 | } 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/typeNonrec.res: -------------------------------------------------------------------------------- 1 | // just support nonrec for fault tolerance 2 | type nonrec t = Water 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/other/comments.res: -------------------------------------------------------------------------------- 1 | /* nested /* comments */ */ 2 | 3 | /* lvl 0 /* lvl 1 /* lvl 2 */ */ */ 4 | let x = 1 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/pattern/tuple.res: -------------------------------------------------------------------------------- 1 | switch x { 2 | | (a => () 3 | | (a, (b, c) => () 4 | | (a, (b, c => () 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/whitespaceCase1.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | // comment 3 | 4 | let 123 = 123 5 | // comment2 6 | let f = () 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/comments.res: -------------------------------------------------------------------------------- 1 | /* nested /* comments */ */ 2 | 3 | /* lvl 0 /* lvl 1 /* lvl 2 */ */ */ 4 | let x = 1 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/reasonFile.res: -------------------------------------------------------------------------------- 1 | /* parses reason file */ 2 | let () = { 3 | let msg = "test" 4 | msg->Js.log 5 | } 6 | -------------------------------------------------------------------------------- /tests/tests/src/const_defs_test.res: -------------------------------------------------------------------------------- 1 | let u = if Const_defs.v { 2 | 3 3 | } else { 4 | 4 5 | } 6 | 7 | let f = () => invalid_arg("hi") 8 | -------------------------------------------------------------------------------- /tests/tests/src/directives.res: -------------------------------------------------------------------------------- 1 | @@directive("first directive;") 2 | @@directive("second directive;") 3 | 4 | let a = Belt.Array.forEach 5 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_1240_missing_unbox.res: -------------------------------------------------------------------------------- 1 | let f = (x, y) => { 2 | let (x, y) = (ref(x), ref(y)) 3 | (x.contents, y.contents) 4 | } 5 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_3865_bar.res: -------------------------------------------------------------------------------- 1 | module type S = { 2 | let return: int 3 | } 4 | 5 | module Make = (M: S) => { 6 | include M 7 | } 8 | -------------------------------------------------------------------------------- /tests/tests/src/string_constant_compare.res: -------------------------------------------------------------------------------- 1 | let a1 = "'" == "'" 2 | let a2 = "'" != "'" 3 | let a3 = "'" == "\'" 4 | let a4 = "'" != "\'" 5 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_Set.res.expected: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.Set.t 2 | external s: Set.t = "s" 3 | 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_Result.res: -------------------------------------------------------------------------------- 1 | type r = Js.Result.t 2 | let res: Js.Result.t = Ok(1) 3 | -------------------------------------------------------------------------------- /analysis/reanalyze/src/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name reanalyze) 3 | (flags 4 | (-w "+6+26+27+32+33+39")) 5 | (libraries jsonlib ext ml str unix)) 6 | -------------------------------------------------------------------------------- /compiler/bsb_helper/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name bsb_helper) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-9-40-42)) 6 | (libraries ext)) 7 | -------------------------------------------------------------------------------- /compiler/depends/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name depends) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-4-40-42)) 6 | (libraries common)) 7 | -------------------------------------------------------------------------------- /lib_dev/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {string} s 3 | */ 4 | export function normalizeNewlines(s) { 5 | return s.replace(/\r\n/g, "\n"); 6 | } 7 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Primitive_char_extern.res: -------------------------------------------------------------------------------- 1 | external code: char => int = "%identity" 2 | external unsafe_chr: int => char = "%identity" 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-incremental-typechecking/src/ConstructorCompletion__Json.res: -------------------------------------------------------------------------------- 1 | let x = Js.Json.Array() 2 | // ^com 3 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DynamicallyLoadedComponent.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = (~s) => React.string(s) 3 | 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt: -------------------------------------------------------------------------------- 1 | {"data":[0,4,1,1,0,0,4,2,1,0,1,4,1,1,0,0,4,2,1,0,0,3,5,1,0]} 2 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests/src/PrepareRename.res: -------------------------------------------------------------------------------- 1 | let x = 12 2 | // ^pre 3 | 4 | let foo = (~xx) => xx + 1 5 | // ^pre 6 | 7 | -------------------------------------------------------------------------------- /tests/build_tests/case/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "case", 3 | "version": "0.1.0", 4 | "sources": ["src"], 5 | "dependencies": [] 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/await.res: -------------------------------------------------------------------------------- 1 | let a = async () => 3 2 | let foo = async () => { 3 | let _ = () 4 | () => await a() 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/curried_expected.res: -------------------------------------------------------------------------------- 1 | let expectCurried = f => f(1) + 2 2 | 3 | let z1 = expectCurried((x, y) => x + y) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/dict_helper.res: -------------------------------------------------------------------------------- 1 | external takesDict: dict => unit = "takesDict" 2 | 3 | takesDict({"test": "1"}) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/function_argument_mismatch.res: -------------------------------------------------------------------------------- 1 | let makeName = (s, i) => s ++ i 2 | 3 | let name = makeName("123", 123) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/unbound_record_field.res: -------------------------------------------------------------------------------- 1 | let foo = x => 2 | switch x { 3 | | {someUnknownField: 123} => () 4 | } 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_int_as.res: -------------------------------------------------------------------------------- 1 | type x = | @as(1) One | Two 2 | 3 | let x = One 4 | 5 | let y = (x :> int) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_recursive.res: -------------------------------------------------------------------------------- 1 | type rec a = One | Two | Three and b = Four | Five and c = | ...a | ...b 2 | -------------------------------------------------------------------------------- /tests/build_tests/unicode/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unicode", 3 | "sources": { 4 | "dir": ".", 5 | "subdirs": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/JSResource.res: -------------------------------------------------------------------------------- 1 | type t<'a> 2 | 3 | @module external jSResource: string => t<'a> = "JSResource" 4 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/LabeledFun.res: -------------------------------------------------------------------------------- 1 | @genType 2 | let labelled = (a, ~b=3, ~c, d, ~e, ~f) => a + b + c + d + e + f 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/MyModule.res: -------------------------------------------------------------------------------- 1 | @genType 2 | type t = int 3 | 4 | @genType 5 | let add = (a: t, b: t): t => a + b 6 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/TypeParams1.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type ocaml_array<'a> = array<'a> 3 | 4 | let exportSomething = 10 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/underscoreSugar.res.txt: -------------------------------------------------------------------------------- 1 | let photo = pricedRoom["room"]["photos"]->filterNone->Array.get(_, 0) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/attributes.res: -------------------------------------------------------------------------------- 1 | module MissingExpression = { 2 | @attr 3 | } 4 | 5 | @attrWithNoExpression 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/external.res: -------------------------------------------------------------------------------- 1 | // missing JS value name 2 | external setTimeout: (unit => unit, int) => float = 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typeDef/polyvariant.res: -------------------------------------------------------------------------------- 1 | type t = [< ] 2 | 3 | type z = [< | #A | #B > ] 4 | 5 | type rec t = [] 6 | 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/typexpr/garbage.res: -------------------------------------------------------------------------------- 1 | @module("moduleName") 2 | external printName: (~name:?, unit) => unit = "printName" 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/structure/expected/module.res.txt: -------------------------------------------------------------------------------- 1 | module A : Map = struct let m = 2 end 2 | module A = struct let m = 2 end -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/bsObject.res: -------------------------------------------------------------------------------- 1 | type foo<'a> = {.. "foo": int} as 'a 2 | type foo<'a> = {"foo": int} as 'a 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/expected/constraint.res.txt: -------------------------------------------------------------------------------- 1 | type t = Reducer constraint 't = @attr ('state, 'action) => 'nextSubtree 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/private.res: -------------------------------------------------------------------------------- 1 | type t1 = private {} 2 | 3 | type t2 = private {x: int} 4 | 5 | type t3 = private A | B 6 | -------------------------------------------------------------------------------- /tests/tests/src/DynamicImportModuleWithAlias.res: -------------------------------------------------------------------------------- 1 | let foo = async z => { 2 | module Utils = await ModuleWithAlias 3 | 4 | Utils.x + z 5 | } 6 | -------------------------------------------------------------------------------- /tests/tests/src/abstract_type.resi: -------------------------------------------------------------------------------- 1 | type t 2 | 3 | type arrow_type = int => int 4 | 5 | type poly_type<'a> = 'a 6 | type poly_abstract_type<'a> 7 | -------------------------------------------------------------------------------- /tests/tests/src/debug_keep_test.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | debugger; 5 | 6 | /* Not a pure module */ 7 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_1692_test.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | (f => 0)(""); 5 | 6 | /* Not a pure module */ 7 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_4931_allow.res: -------------------------------------------------------------------------------- 1 | %%raw(` 2 | if(import.meta.hot) { 3 | import.meta.hot.accept(); 4 | }else{ 5 | console.log("ok") 6 | }`) 7 | -------------------------------------------------------------------------------- /tests/tests/src/incomplete_toplevel_test.res: -------------------------------------------------------------------------------- 1 | let f = () => { 2 | Console.log("no inline") 3 | (1, 2, 3) 4 | } 5 | 6 | let (a, b, c) = f() 7 | -------------------------------------------------------------------------------- /tests/tests/src/rebind_module_test.res: -------------------------------------------------------------------------------- 1 | let x = (v: Rebind_module.b) => 2 | switch v { 3 | | Rebind_module.AA => 0 4 | | _ => 1 5 | } 6 | -------------------------------------------------------------------------------- /tests/tests/src/test_incr_ref.res: -------------------------------------------------------------------------------- 1 | include ( 2 | { 3 | let u = ref(0) 4 | let v = incr(u) 5 | }: { 6 | let v: unit 7 | } 8 | ) 9 | -------------------------------------------------------------------------------- /tests/tests/src/test_pervasives3.res: -------------------------------------------------------------------------------- 1 | module Pervasives = { 2 | include Pervasives 3 | include Belt.List 4 | } 5 | let v = Pervasives.\"@" 6 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_Result.res.expected: -------------------------------------------------------------------------------- 1 | type r = result 2 | let res: result = Ok(1) 3 | 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_WeakSet.res: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.WeakSet.t 2 | external ws: Js.WeakSet.t<{..}> = "ws" 3 | -------------------------------------------------------------------------------- /compiler/gentype/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name gentype) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-4-9-40-41-42-48-70)) 6 | (libraries ml)) 7 | -------------------------------------------------------------------------------- /compiler/ml/used_attributes.mli: -------------------------------------------------------------------------------- 1 | val mark_used_attribute : Parsetree.attribute -> unit 2 | 3 | val is_used_attribute : string Asttypes.loc -> bool 4 | -------------------------------------------------------------------------------- /compiler/syntax/src/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name syntax) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-4-42-40-9-48-70)) 6 | (libraries ml)) 7 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Primitive_int_extern.res: -------------------------------------------------------------------------------- 1 | external div: (int, int) => int = "%divint" 2 | 3 | external mod_: (int, int) => int = "%modint" 4 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Jsx.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Obj.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Jsx.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Obj.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/dep02/src/Dep02.res: -------------------------------------------------------------------------------- 1 | open Array 2 | let log = () => ["a", "b"]->forEach(Console.log) 3 | Console.log(NS.Alias.hello_world()) 4 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/JSResource.res: -------------------------------------------------------------------------------- 1 | type t<'a> 2 | 3 | @module external jSResource: string => t<'a> = "JSResource" 4 | 5 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/NestedModulesInSignature.resi: -------------------------------------------------------------------------------- 1 | module Universe: { 2 | @genType 3 | let theAnswer: int 4 | } 5 | 6 | -------------------------------------------------------------------------------- /tests/build_tests/build_warn_as_error/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "build_warn_as_error", 3 | "version": "0.1.0", 4 | "sources": ["src"] 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/case2/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "case2", 3 | "version": "0.1.0", 4 | "sources": ["src"], 5 | "dependencies": [] 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/custom_namespace/src/demo.res.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | let v = 42; 5 | 6 | export { 7 | v, 8 | } 9 | /* No side effect */ 10 | -------------------------------------------------------------------------------- /tests/build_tests/jsx_settings_inheritance/src/C.res: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make = () => { 3 | <> 4 | 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /tests/build_tests/rerror/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rerror", 3 | "version": "0.1.0", 4 | "sources": ["src"], 5 | "dependencies": [] 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/OptionalInlineImplIntf.res: -------------------------------------------------------------------------------- 1 | module M: { 2 | type t = A({x?: int}) 3 | } = { 4 | type t = A({x: int}) 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/UncurriedArgsNotApplied.res: -------------------------------------------------------------------------------- 1 | let apply = (fn: unit => option) => fn() 2 | 3 | let _ = apply(Some(1)) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/feature_letunwrap_not_enabled.res: -------------------------------------------------------------------------------- 1 | let ok = Ok(1) 2 | 3 | let x = { 4 | let? Ok(_x) = ok 5 | Ok() 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/fun_return_poly1.res: -------------------------------------------------------------------------------- 1 | let f = (_, ~def=3) => assert(false) 2 | 3 | let ok = f(1)(2) 4 | let err = f(1, 2) 5 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/pattern_matching_on_option_but_value_not_option.res: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | switch x { 4 | | Some(1) => () 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_string_as.res: -------------------------------------------------------------------------------- 1 | type x = One | @as(2) Two 2 | 3 | let x = One 4 | 5 | let y = (x :> string) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_tag_missing.res: -------------------------------------------------------------------------------- 1 | @tag("kind") type a = One(int) | Two(string) 2 | type b = | ...a | Three(bool) 3 | -------------------------------------------------------------------------------- /tests/build_tests/unboxed_bool_with_const/src/Main.res: -------------------------------------------------------------------------------- 1 | @unboxed 2 | type t<'a> = 3 | | Bool(bool) 4 | | @as(false) False 5 | | @as(true) True 6 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/ExportWithRename.res: -------------------------------------------------------------------------------- 1 | @genType.as("Renamed") @react.component 2 | let make = (~s) => React.string(s) 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/packs/SchoolsCoursesIndexPack.res: -------------------------------------------------------------------------------- 1 | ReactDOMRe.renderToElementWithId(, "course-editor") 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/other/hashIdent.res: -------------------------------------------------------------------------------- 1 | let x = #10s 2 | 3 | type t = [ #red | #10s ] 4 | 5 | switch x { 6 | | #10s => () 7 | } 8 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/errors/structure/recordFieldKeywordInType2.res: -------------------------------------------------------------------------------- 1 | type r = { 2 | id: string, 3 | type: int, 4 | x: bool, 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/expressions/expected/float.res.txt: -------------------------------------------------------------------------------- 1 | ;;1. /. 2. 2 | ;;3. *. 4. 3 | ;;2. ** 2. 4 | ;;10.2 +. 5.4 5 | ;;28.9 -. 13.8 -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/recovery/pattern/record.res: -------------------------------------------------------------------------------- 1 | switch x { 2 | | {a, b: {x, y => () 3 | | {...x, y} => () 4 | | {a, _, b} => () 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/ppx/react/interfaceWithRef.resi: -------------------------------------------------------------------------------- 1 | @react.component 2 | let make: (~x: string, ~ref: ReactDOM.Ref.currentDomRef=?) => React.element -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/fileWithOnlyComments.res: -------------------------------------------------------------------------------- 1 | // test 2 | 3 | /* multi 4 | line 5 | comment 6 | */ 7 | 8 | // more comments 9 | -------------------------------------------------------------------------------- /tests/tests/src/b.res: -------------------------------------------------------------------------------- 1 | type point = {x: float, y: float} 2 | 3 | let f = point => { 4 | let {x, y} = point 5 | (x *. x +. y *. y) ** 2. 6 | } 7 | -------------------------------------------------------------------------------- /tests/tests/src/complete_parmatch_test.res: -------------------------------------------------------------------------------- 1 | let f = x => 2 | switch x { 3 | | 1 => 'a' 4 | | 2 => 'b' 5 | | 3 => 'c' 6 | | _ => 'x' 7 | } 8 | -------------------------------------------------------------------------------- /tests/tests/src/esmodule_ref.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | console.log(false); 5 | 6 | /* Not a pure module */ 7 | -------------------------------------------------------------------------------- /tests/tests/src/hello.foo.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | console.log("Hello"); 5 | 6 | /* Not a pure module */ 7 | -------------------------------------------------------------------------------- /tests/tests/src/module_as_function.res: -------------------------------------------------------------------------------- 1 | @module external nightmare: {"show": bool} => int = "nightmare" 2 | 3 | let v = nightmare({"show": true}) 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_ArrayAppend.res.expected: -------------------------------------------------------------------------------- 1 | let ys = Array.concat([1], [2]) 2 | let zs = [1]->Array.concat([1], [2]) 3 | 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_Map.res.expected: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.Map.t 2 | external m: Map.t = "m" 3 | 4 | -------------------------------------------------------------------------------- /tests/tools_tests/src/migrate/StdlibMigration_WeakMap.res: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.WeakMap.t 2 | external wm: Js.WeakMap.t<{..}, int> = "wm" 3 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/exception/ExportWithRename.res: -------------------------------------------------------------------------------- 1 | @genType("ExportWithRename") @react.component 2 | let make = (~s) => React.string(s) 3 | -------------------------------------------------------------------------------- /analysis/src/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name analysis) 3 | (flags 4 | (-w "+6+26+27+32+33+39")) 5 | (libraries unix str ext ml jsonlib syntax reanalyze)) 6 | -------------------------------------------------------------------------------- /compiler/bsb/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name bsb) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-4-9-40-41-42-70)) 6 | (libraries common ext str unix)) 7 | -------------------------------------------------------------------------------- /compiler/frontend/dune: -------------------------------------------------------------------------------- 1 | (library 2 | (name frontend) 3 | (wrapped false) 4 | (flags 5 | (:standard -w +a-4-9-40-42-70)) 6 | (libraries common ml)) 7 | -------------------------------------------------------------------------------- /ninja/misc/afl-fuzz/build.ninja: -------------------------------------------------------------------------------- 1 | rule b 2 | command = clang -MMD -MF $out.d -o $out -c $in 3 | description = building $out 4 | 5 | build a.o: b a.c 6 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Primitive_dict.res: -------------------------------------------------------------------------------- 1 | // Note: this is exposed to support syntax 2 | external make: array<(string, 'a)> => dict<'a> = "%makedict" 3 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_OO.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | let Callback = {}; 5 | 6 | export { 7 | Callback, 8 | } 9 | /* No side effect */ 10 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_blob.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_date.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_file.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_float.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_map.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_obj.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_re.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_set.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/JsxDOM.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_OO.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | let Callback = {}; 5 | 6 | exports.Callback = Callback; 7 | /* No side effect */ 8 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_array2.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_blob.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_date.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_extern.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_file.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_float.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_global.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_map.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_obj.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_re.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_result.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Js_set.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/JsxDOM.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/js/Stdlib_RegExp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | let Result = {}; 5 | 6 | exports.Result = Result; 7 | /* No side effect */ 8 | -------------------------------------------------------------------------------- /rewatch/testrepo/packages/nohoist/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@testrepo/nohoist", 3 | "sources": ["src"], 4 | "dependencies": ["rescript-bun"] 5 | } -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTestWithInterface.res: -------------------------------------------------------------------------------- 1 | module Ext_buffer: { 2 | let x: int 3 | } = { 4 | let x = 42 5 | } 6 | 7 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/LetPrivate.res: -------------------------------------------------------------------------------- 1 | %%private( 2 | @genType 3 | let x = 34 4 | ) 5 | 6 | @genType 7 | let y = x 8 | 9 | -------------------------------------------------------------------------------- /tests/analysis_tests/tests-reanalyze/deadcode/src/TypeParams1.res: -------------------------------------------------------------------------------- 1 | @gentype 2 | type ocaml_array<'a> = array<'a> 3 | 4 | let exportSomething = 10 5 | 6 | -------------------------------------------------------------------------------- /tests/build_tests/hyphen2/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyphen2", 3 | "version": "0.1.0", 4 | "sources": ["y-src"], 5 | "namespace": true 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/not_undefined_attribute/rescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "not_undefined_attribute", 3 | "version": "0.1.0", 4 | "sources": ["."] 5 | } 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/bigint_match_literal.res: -------------------------------------------------------------------------------- 1 | let m1 = switch 1n { 2 | | 0001n => 1 3 | | 1n => 1 4 | | -0001n => -1 5 | | _ => 0 6 | } 7 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/mix_object_record_spread_constructor.res: -------------------------------------------------------------------------------- 1 | type obj = {"name": string} 2 | 3 | type t = V({...obj, label: string}) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/mix_record_object_spread.res: -------------------------------------------------------------------------------- 1 | type baseProps = {name: string} 2 | 3 | type props = {...baseProps, "label": string} 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/react_component_with_props_external.res: -------------------------------------------------------------------------------- 1 | @react.componentWithProps 2 | external make: React.element = "default" 3 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/stdlib_removed_in_error.res: -------------------------------------------------------------------------------- 1 | type x = Stdlib.Promise.t 2 | 3 | let x: x = Stdlib.Promise.resolve("hello") 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_bigint_as.res: -------------------------------------------------------------------------------- 1 | type x = | @as(1n) One | Two 2 | 3 | let x = One 4 | 5 | let y = (x :> bigint) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_float_as.res: -------------------------------------------------------------------------------- 1 | type x = | @as(1.1) One | Two 2 | 3 | let x = One 4 | 5 | let y = (x :> float) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_non_unboxed_with_payload.res: -------------------------------------------------------------------------------- 1 | type x = One(bool) 2 | let x = One(true) 3 | let y = (x :> string) 4 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_coercion_string.res: -------------------------------------------------------------------------------- 1 | type x = One(bool) | Two 2 | 3 | let x = One(true) 4 | 5 | let y = (x :> string) 6 | -------------------------------------------------------------------------------- /tests/build_tests/super_errors/fixtures/variant_spread_unboxed_mismatch.res: -------------------------------------------------------------------------------- 1 | @unboxed type a = One(int) | Two(string) 2 | type b = | ...a | Three(bool) 3 | -------------------------------------------------------------------------------- /tests/gentype_tests/typescript-react-example/src/shims/Jsx.shim.ts: -------------------------------------------------------------------------------- 1 | import type { ReactElement } from "react"; 2 | 3 | export type element = ReactElement; 4 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/expected/unicode.res.txt: -------------------------------------------------------------------------------- 1 | let x = "✅ foo bar" 2 | 3 | let x = "\n okokok" 4 | 5 | let z = "\t \b \n okok 🙈" 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/conversion/reason/moduleLanguage.res: -------------------------------------------------------------------------------- 1 | let someFunctorAsFunction = (x: module(MT)): module(ResT) => module(SomeFunctor(unpack(x))) 2 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/idempotency/pupilfirst/users/UsersHome__Types.res: -------------------------------------------------------------------------------- 1 | module Course = UsersHome__Course 2 | module Community = UsersHome__Community 3 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/parsing/grammar/typedefinition/expected/missingPipeBeforeConstructorAttribute.res.txt: -------------------------------------------------------------------------------- 1 | type nonrec t = 2 | | One [@as {js|one|js}] -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/comments/expected/whitespaceCase1.res.txt: -------------------------------------------------------------------------------- 1 | let x = 1 2 | // comment 3 | 4 | let 123 = 123 5 | // comment2 6 | let f = () 7 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/expected/comments.res.txt: -------------------------------------------------------------------------------- 1 | /* nested /* comments */ */ 2 | 3 | /* lvl 0 /* lvl 1 /* lvl 2 */ */ */ 4 | let x = 1 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/expected/reasonFile.res.txt: -------------------------------------------------------------------------------- 1 | /* parses reason file */ 2 | let () = { 3 | let msg = "test" 4 | msg->Js.log 5 | } 6 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/other/reasonString.res: -------------------------------------------------------------------------------- 1 | let x = `foo \${bar` 2 | let x = `foo \`bar` 3 | let x = `foo \\bar` 4 | let x = `foo \\\${bar` 5 | -------------------------------------------------------------------------------- /tests/syntax_tests/data/printer/typeDef/expected/private.res.txt: -------------------------------------------------------------------------------- 1 | type t1 = private {} 2 | 3 | type t2 = private {x: int} 4 | 5 | type t3 = private A | B 6 | -------------------------------------------------------------------------------- /tests/tests/src/gpr_5753.mjs: -------------------------------------------------------------------------------- 1 | // Generated by ReScript, PLEASE EDIT WITH CARE 2 | 3 | 4 | console.log(/* '文' */25991); 5 | 6 | /* Not a pure module */ 7 | -------------------------------------------------------------------------------- /tests/tests/src/hash_utils.res: -------------------------------------------------------------------------------- 1 | external seeded_hash_param: (int, int, int, 'a) => int = "%hash" 2 | 3 | let hash = x => seeded_hash_param(10, 100, 0, x) 4 | -------------------------------------------------------------------------------- /tests/tests/src/test_regex.res: -------------------------------------------------------------------------------- 1 | let v = /b/ig 2 | let r = /Bucklescript是一个程序语言/ 3 | 4 | /* Console.log(v);; 5 | Console.log(r);; */ 6 | 7 | let c = v 8 | -------------------------------------------------------------------------------- /tests/tools_tests/src/expected/StdlibMigration_WeakSet.res.expected: -------------------------------------------------------------------------------- 1 | // Type alias migration for Js.WeakSet.t 2 | external ws: WeakSet.t<{..}> = "ws" 3 | 4 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | defaultSemverRangePrefix: "" 2 | 3 | nmMode: hardlinks-global 4 | 5 | nodeLinker: node-modules 6 | 7 | yarnPath: .yarn/releases/yarn-4.10.3.cjs 8 | -------------------------------------------------------------------------------- /analysis/examples/larger-project/src/OptArg.resi: -------------------------------------------------------------------------------- 1 | let foo: (~x: int=?, ~y: int=?, ~z: int=?, int) => int 2 | let bar: (~x: 'a=?, ~y: int, ~z: 'b=?, int) => int 3 | -------------------------------------------------------------------------------- /analysis/examples/workspace-project/README.md: -------------------------------------------------------------------------------- 1 | # ReScript workspaces example (monorepo) 2 | 3 | ``` 4 | npm install 5 | npm run build 6 | npm run start 7 | ``` 8 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/Primitive_promise.res: -------------------------------------------------------------------------------- 1 | external unsafe_async: 'a => promise<'a> = "%identity" 2 | external unsafe_await: promise<'a> => 'a = "%await" 3 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Dom_storage2.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_array2.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_console.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_extern.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_global.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_result.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_string2.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_weakmap.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Js_weakset.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/JsxDOMStyle.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Stdlib_Object.js: -------------------------------------------------------------------------------- 1 | /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ 2 | -------------------------------------------------------------------------------- /packages/@rescript/runtime/lib/es6/Stdlib_RegExp.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | let Result = {}; 5 | 6 | export { 7 | Result, 8 | } 9 | /* No side effect */ 10 | --------------------------------------------------------------------------------