Skip to content

Commit 35e35c5

Browse files
authored
Rename syntax cli from "rescript" to "res_parser" (#5810)
1 parent d7fd653 commit 35e35c5

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

res_syntax/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ Debug a file:
5757

5858
```sh
5959
# write code in test.res
60-
dune exec -- rescript test.res # test printer
61-
dune exec -- rescript -print ast test.res # print ast
62-
dune exec -- rescript -print comments test.res # print comment table
63-
dune exec -- rescript -print ml test.res # show ocaml code
64-
dune exec -- rescript -print res -width 80 test.res # test printer and change default print width
60+
dune exec -- res_parser test.res # test printer
61+
dune exec -- res_parser -print ast test.res # print ast
62+
dune exec -- res_parser -print comments test.res # print comment table
63+
dune exec -- res_parser -print ml test.res # show ocaml code
64+
dune exec -- res_parser -print res -width 80 test.res # test printer and change default print width
6565
```
6666

6767
Benchmark:

res_syntax/cli/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(executable
22
(name res_cli)
3-
(public_name rescript)
3+
(public_name res_parser)
44
(modes byte exe)
55
(flags
66
(-open Syntax -open Compilerlibs406)

res_syntax/cli/res_cli.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ end = struct
185185
"\n\
186186
**This command line is for the repo developer's testing purpose only. DO \
187187
NOT use it in production**!\n\n"
188-
^ "Usage:\n rescript <options> <file>\n\n" ^ "Examples:\n"
189-
^ " rescript myFile.res\n" ^ " rescript -parse ml -print res myFile.ml\n"
190-
^ " rescript -parse res -print binary -interface myFile.resi\n\n"
188+
^ "Usage:\n res_parser <options> <file>\n\n" ^ "Examples:\n"
189+
^ " res_parser myFile.res\n"
190+
^ " res_parser -parse ml -print res myFile.ml\n"
191+
^ " res_parser -parse res -print binary -interface myFile.resi\n\n"
191192
^ "Options are:"
192193

193194
let spec =

res_syntax/scripts/bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
rm -rf ./bootstrap
55
mkdir ./bootstrap
66

7-
ocaml unix.cma ./scripts/bspack.ml -bs-main Res_cli -I cli -I src -o ./bootstrap/rescript.ml
8-
rescript ./bootstrap/rescript.ml > ./bootstrap/rescript.res
9-
ocamlopt.opt -w a -pp "rescript -print binary" -O2 -o rescript -I +compiler-libs ocamlcommon.cmxa -I lib -impl ./bootstrap/rescript.res
7+
ocaml unix.cma ./scripts/bspack.ml -bs-main Res_cli -I cli -I src -o ./bootstrap/res_parser.ml
8+
res_parser ./bootstrap/res_parser.ml > ./bootstrap/res_parser.res
9+
ocamlopt.opt -w a -pp "res_parser -print binary" -O2 -o res_parser -I +compiler-libs ocamlcommon.cmxa -I lib -impl ./bootstrap/res_parser.res

res_syntax/scripts/test.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ mkdir temp
2222
# parsing
2323
find tests/parsing/{errors,infiniteLoops,recovery} -name "*.res" -o -name "*.resi" >temp/files.txt
2424
while read file; do
25-
rescript -recover -print ml $file &> $(exp $file) & maybeWait
25+
res_parser -recover -print ml $file &> $(exp $file) & maybeWait
2626
done <temp/files.txt
2727
find tests/parsing/{grammar,other} -name "*.res" -o -name "*.resi" >temp/files.txt
2828
while read file; do
29-
rescript -print ml $file &> $(exp $file) & maybeWait
29+
res_parser -print ml $file &> $(exp $file) & maybeWait
3030
done <temp/files.txt
3131

3232
# printing
3333
find tests/{printer,conversion} -name "*.res" -o -name "*.resi" -o -name "*.ml" -o -name "*.mli" >temp/files.txt
3434
while read file; do
35-
rescript $file &> $(exp $file) & maybeWait
35+
res_parser $file &> $(exp $file) & maybeWait
3636
done <temp/files.txt
3737

3838
# printing with ppx
3939
find tests/ppx/react -name "*.res" -o -name "*.resi" >temp/files.txt
4040
while read file; do
41-
rescript -jsx-version 4 -jsx-mode "automatic" $file &> $(exp $file) & maybeWait
41+
res_parser -jsx-version 4 -jsx-mode "automatic" $file &> $(exp $file) & maybeWait
4242
done <temp/files.txt
4343

4444
wait
@@ -78,11 +78,11 @@ if [[ $ROUNDTRIP_TEST = 1 ]]; then
7878
*.resi ) class="res"; resIntf=-interface ;;
7979
esac
8080

81-
rescript $resIntf -parse $class -print sexp $file > $sexpAst1
82-
rescript $resIntf -parse $class -print res $file > $rescript1
81+
res_parser $resIntf -parse $class -print sexp $file > $sexpAst1
82+
res_parser $resIntf -parse $class -print res $file > $rescript1
8383

84-
rescript $resIntf -print sexp $rescript1 > $sexpAst2
85-
rescript $resIntf -print res $rescript1 > $rescript2
84+
res_parser $resIntf -print sexp $rescript1 > $sexpAst2
85+
res_parser $resIntf -print res $rescript1 > $rescript2
8686

8787
diff --unified $sexpAst1 $sexpAst2
8888
[[ "$?" = 1 ]] && echo 1 > $roundtripTestsResult

0 commit comments

Comments
 (0)