You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Move React ppx from compiler repo, add tests (#124)
* Move React ppx from compiler repo, add tests
React ppx copied from:
https://github.com/rescript-lang/rescript-compiler/blob/4f4812aa4e1411029392f6dbcacc580e755d68d5/jscomp/syntax/reactjs_jsx_ppx.cppo.ml
* Fix roundtrip tests, ignore test files with .fixme suffix
* add -ppx cmd line arg
* rename .react.res to just .res
* remove unneeded jsx stuff from res_multi_printer
* remove .fixme option and add previously failing test + snapshot
* don't run roundtrip tests if ppx is defined
* move ppx tests to own folder, remove "none" as default arg value, cleanup
Copy file name to clipboardExpand all lines: src/res_cli.ml
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,7 @@ module ResClflags: sig
165
165
valfiles: stringlistref
166
166
valinterface: boolref
167
167
valreport: stringref
168
+
valppx: stringref
168
169
169
170
valparse: unit -> unit
170
171
end=struct
@@ -178,6 +179,7 @@ end = struct
178
179
let origin =ref""
179
180
let interface =reffalse
180
181
let report =ref"pretty"
182
+
let ppx =ref""
181
183
182
184
let usage ="Usage:\n rescript <options> <file>\n\n"^
183
185
"Examples:\n"^
@@ -192,6 +194,7 @@ end = struct
192
194
("-print", Arg.String (funtxt -> print := txt), "Print either binary or ns. Default: ns");
193
195
("-width", Arg.Int (funw -> width := w), "Specify the line length for the printer (formatter)");
194
196
("-interface", Arg.Unit (fun() -> interface :=true), "Parse as interface");
197
+
("-ppx", Arg.String (funtxt -> ppx := txt), "Apply a specific built-in ppx before parsing, none or jsx. Default: none");
195
198
(* ("-report", Arg.String (fun txt -> report := txt), "Stylize errors and messages using color and context. Accepts `Pretty` and `Plain`. Default `Plain`") *)
0 commit comments