Skip to content

Update the compiler libs with those from the compiler. #744

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
node-version: 16

- run: npm ci
- run: opam install dune
- run: opam install dune cppo
- run: npm run compile

# These 2 runs (or just the second?) are for when you have opam dependencies. We don't.
Expand Down
15 changes: 15 additions & 0 deletions analysis/dune
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
(dirs src reanalyze vendor)

(env
(dev
(env-vars
(CPPO_FLAGS -U=RELEASE)))
(release
(env-vars
(CPPO_FLAGS -D=RELEASE))
(ocamlopt_flags
(:standard -O3 -unbox-closures)))
(static
(env-vars
(CPPO_FLAGS -D=RELEASE))
(ocamlopt_flags
(:standard -O3 -unbox-closures))))
4 changes: 3 additions & 1 deletion analysis/dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.0)
(lang dune 2.3)

(generate_opam_files true)

Expand All @@ -18,6 +18,8 @@
(>= 4.10))
(ocamlformat
(= 0.22.4))
(cppo
(= 1.6.9))
(reanalyze
(= 2.23.0))
dune))
26 changes: 13 additions & 13 deletions analysis/reanalyze/src/Paths.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Common
module StringMap = Ext_json_types.StringMap
module StringMap = Map_string

let bsconfig = "bsconfig.json"

Expand Down Expand Up @@ -138,19 +138,19 @@ let readDirsFromConfig ~configSources =
in
let rec processSourceItem (sourceItem : Ext_json_types.t) =
match sourceItem with
| Str str -> str |> processDir ~subdirs:false
| Obj map -> (
match map |> StringMap.find_opt "dir" with
| Some (Str str) ->
| Str {str} -> str |> processDir ~subdirs:false
| Obj {map} -> (
match StringMap.find_opt map "dir" with
| Some (Str {str}) ->
let subdirs =
match map |> StringMap.find_opt "subdirs" with
match StringMap.find_opt map "subdirs" with
| Some (True _) -> true
| Some (False _) -> false
| _ -> false
in
str |> processDir ~subdirs
| _ -> ())
| Arr arr -> arr |> Array.iter processSourceItem
| Arr {content = arr} -> arr |> Array.iter processSourceItem
| _ -> ()
in
(match configSources with
Expand All @@ -166,13 +166,13 @@ let readSourceDirs ~configSources =
let dirs = ref [] in
let readDirs json =
match json with
| Ext_json_types.Obj map -> (
match map |> StringMap.find_opt "dirs" with
| Some (Arr arr) ->
| Ext_json_types.Obj {map} -> (
match StringMap.find_opt map "dirs" with
| Some (Arr {content = arr}) ->
arr
|> Array.iter (fun x ->
match x with
| Ext_json_types.Str str -> dirs := str :: !dirs
| Ext_json_types.Str {str} -> dirs := str :: !dirs
| _ -> ());
()
| _ -> ())
Expand All @@ -181,12 +181,12 @@ let readSourceDirs ~configSources =
if sourceDirs |> Sys.file_exists then
let jsonOpt = sourceDirs |> Ext_json_parse.parse_json_from_file in
match jsonOpt with
| Some json ->
| exception _ -> ()
| json ->
if runConfig.bsbProjectRoot <> runConfig.projectRoot then (
readDirs json;
dirs := readDirsFromConfig ~configSources)
else readDirs json
| None -> ()
else (
if !Cli.debug then (
Log_.item "Warning: can't find source dirs: %s\n" sourceDirs;
Expand Down
7 changes: 2 additions & 5 deletions analysis/reanalyze/src/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
(library
(name reanalyze)
(flags
(-w "+6+26+27+32+33+39")
(-open Compilerlibs406)
(-open Jsonlib)
(-open Ext))
(libraries compilerlibs406 jsonlib ext str unix))
(-w "+6+26+27+32+33+39"))
(libraries jsonlib ext ml str unix))
1 change: 1 addition & 0 deletions analysis/rescript-vscode.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bug-reports: "https://github.com/rescript-lang/rescript-vscode/issues"
depends: [
"ocaml" {>= "4.10"}
"ocamlformat" {= "0.22.4"}
"cppo" {= "1.6.9"}
"reanalyze" {= "2.23.0"}
"dune"
]
Expand Down
4 changes: 2 additions & 2 deletions analysis/src/DumpAst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let printAttributes attributes =
let printConstant const =
match const with
| Parsetree.Pconst_integer (s, _) -> "Pconst_integer(" ^ s ^ ")"
| Pconst_char c -> "Pconst_char(" ^ String.make 1 c ^ ")"
| Pconst_char c -> "Pconst_char(" ^ String.make 1 (Char.chr c) ^ ")"
| Pconst_string (s, delim) ->
let delim =
match delim with
Expand Down Expand Up @@ -312,4 +312,4 @@ let dump ~currentFile ~pos =
print_endline
(structure
|> List.map (fun structItem -> printStructItem structItem ~pos ~source)
|> String.concat "")
|> String.concat "")
7 changes: 2 additions & 5 deletions analysis/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
; The main module that will become the binary.
(name Cli)
(flags
(-w "+6+26+27+32+33+39")
(-open Compilerlibs406)
(-open Jsonlib)
(-open Outcomeprinter))
(-w "+6+26+27+32+33+39"))
; Depends on:
(libraries unix str compilerlibs406 jsonlib outcomeprinter reanalyze))
(libraries unix str ext ml jsonlib outcomeprinter reanalyze))
127 changes: 0 additions & 127 deletions analysis/vendor/compiler-libs-406/arg_helper.ml

This file was deleted.

63 changes: 0 additions & 63 deletions analysis/vendor/compiler-libs-406/arg_helper.mli

This file was deleted.

Loading