Skip to content

Commit db8f93a

Browse files
authored
Update to v12 AST (#12)
* Update to latest syntax @ 12.1.0 * Update to v12 * Fix dune * Use the new api * Fix flake.nix * Bump version * Remove unused compiler related files * Run formatter * Fix changes in JSX ast * Add github workflow
1 parent 9fd565a commit db8f93a

5,403 files changed

Lines changed: 82441 additions & 635934 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
push:
9+
branches:
10+
- master
11+
- main
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install Nix
22+
uses: cachix/install-nix-action@v27
23+
with:
24+
nix_path: nixpkgs=channel:nixos-unstable
25+
26+
- name: Build project
27+
run: nix build
28+
29+
- name: Run tests
30+
run: nix flake check

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ReScript Linter Changelog
22

3+
### 2026-01-27 - v0.4.0
4+
* Updated the AST to ReScript v12.1.0
5+
36
### 2025-09-30 - v0.3.3
47
* Adds support for JSON output
58
* To enable JSON output, use the `--json` flag when running the linter
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525
type t = Location.t = {
26-
loc_start : Lexing.position;
27-
loc_end : Lexing.position;
28-
loc_ghost : bool;
26+
loc_start: Lexing.position;
27+
loc_end: Lexing.position;
28+
loc_ghost: bool;
2929
}
3030

3131
let is_ghost x = x.loc_ghost
@@ -35,7 +35,7 @@ let merge (l : t) (r : t) =
3535
else if is_ghost r then l
3636
else
3737
match (l, r) with
38-
| { loc_start; _ }, { loc_end; _ } (* TODO: improve*) ->
39-
{ loc_start; loc_end; loc_ghost = false }
38+
| {loc_start; _}, {loc_end; _} (* TODO: improve*) ->
39+
{loc_start; loc_end; loc_ghost = false}
4040

4141
(* let none = Location.none *)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525
type t = Location.t = {
26-
loc_start : Lexing.position;
27-
loc_end : Lexing.position;
28-
loc_ghost : bool;
26+
loc_start: Lexing.position;
27+
loc_end: Lexing.position;
28+
loc_ghost: bool;
2929
}
3030

3131
(* val is_ghost : t -> bool *)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121
* You should have received a copy of the GNU Lesser General Public License
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
24-
let version = "11.1.4"
24+
let version = "12.1.0"
2525
let header = "// Generated by ReScript, PLEASE EDIT WITH CARE"
26-
let package_name = ref "rescript"
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@
2525
val version : string
2626

2727
val header : string
28-
29-
val package_name : string ref
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
let warn_missing_primitive loc txt =
26-
Location.prerr_warning loc (Bs_unimplemented_primitive txt)
27-
2825
let warn_literal_overflow loc =
2926
Location.prerr_warning loc Bs_integer_literal_overflow
3027

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
val warn_missing_primitive : Location.t -> string -> unit
26-
2725
val warn_literal_overflow : Location.t -> unit
2826

2927
val error_unescaped_delimiter : Location.t -> string -> unit

compiler/common/dune

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(library
2+
(name common)
3+
(wrapped false)
4+
(preprocess
5+
(action
6+
(run %{bin:cppo} %{env:CPPO_FLAGS=} %{input-file})))
7+
(flags
8+
(:standard -w +a-9-40-42))
9+
(libraries syntax))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let dwarn ?(__POS__ : (string * int * int * int) option) f =
3030
match __POS__ with
3131
| None -> Format.fprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.")
3232
| Some (file, line, _, _) ->
33-
Format.fprintf Format.err_formatter
34-
("WARN: %s,%d " ^^ f ^^ "@.")
35-
file line
33+
Format.fprintf Format.err_formatter
34+
("WARN: %s,%d " ^^ f ^^ "@.")
35+
file line
3636
else Format.ifprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.")

0 commit comments

Comments
 (0)