File tree 7 files changed +27
-8
lines changed
doc/modules/language-guide/pages
7 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 1
1
= Motoko compiler changelog
2
2
3
+ * new ` moc ` command-line arguments ` --args <file> ` and ` --args0 <file> ` for reading newline/NUL terminated arguments from ` <file> ` .
4
+
3
5
== 0.5.4 (2021-01-07)
4
6
5
7
* _ Option blocks_ ` do ? <block> ` and _ option checks_ ` <exp> ! ` .
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ You can use the following options with the `+moc+` command.
32
32
33
33
|`+--actor-alias+` |Specifies an actor import alias.
34
34
35
+ |`+--args <file>+` |Read additional newline separated command line arguments from <file>
36
+
37
+ |`+--args0 <file>+` |Read additional NUL separated command line arguments from <file>
38
+
35
39
|`+-c+` |Compiles programs to WebAssembly.
36
40
37
41
|`+--check+` |Performs type checking only.
Original file line number Diff line number Diff line change 47
47
"motoko-base" : {
48
48
"branch" : " next-moc" ,
49
49
"repo" : " ssh://git@github.com/dfinity-lab/motoko-base" ,
50
- "rev" : " 5e010560a3f12c85980f61f6fe766eff8c997d57 " ,
50
+ "rev" : " 65855b989792abb8c5e68adb47edfd566a8dd73a " ,
51
51
"type" : " git"
52
52
},
53
53
"motoko-matchers" : {
83
83
"homepage" : " https://github.com/nmattia/niv" ,
84
84
"owner" : " nmattia" ,
85
85
"repo" : " niv" ,
86
- "rev" : " 94dadba1a3a6a2f0b8ca2963e49daeec5d4e3098 " ,
87
- "sha256" : " 1y2h9wl7w60maa2m4xw9231xdr325xynzpph8xr4j5vsznygv986 " ,
86
+ "rev" : " 18b7314c13a6d0e82113a15c14e7a5f54286327d " ,
87
+ "sha256" : " 0b2xb99nn7ddysvgzncwa4vglv0j6c0l4bgxz9hl4i3gmrlq3r59 " ,
88
88
"type" : " tarball" ,
89
- "url" : " https://github.com/nmattia/niv/archive/94dadba1a3a6a2f0b8ca2963e49daeec5d4e3098 .tar.gz" ,
89
+ "url" : " https://github.com/nmattia/niv/archive/18b7314c13a6d0e82113a15c14e7a5f54286327d .tar.gz" ,
90
90
"url_template" : " https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
91
91
},
92
92
"nixpkgs" : {
Original file line number Diff line number Diff line change @@ -3018,7 +3018,7 @@ module Tuple = struct
3018
3018
3019
3019
(* We represent the boxed empty tuple as the unboxed scalar 0, i.e. simply as
3020
3020
number (but really anything is fine, we never look at this) *)
3021
- let unit_vanilla_lit = 1l
3021
+ let unit_vanilla_lit = 0l
3022
3022
let compile_unit = compile_unboxed_const unit_vanilla_lit
3023
3023
3024
3024
(* Expects on the stack the pointer to the array. *)
Original file line number Diff line number Diff line change @@ -95,8 +95,10 @@ let argspec = Arg.align [
95
95
" --sanity-checks" ,
96
96
Arg. Unit
97
97
(fun () -> Flags. sanity := true ),
98
- " enable sanity checking in the RTS and generated code" ;
99
- ]
98
+ " enable sanity checking in the RTS and generated code" ;
99
+ ]
100
+ @ Args. inclusion_args
101
+
100
102
101
103
102
104
let set_out_file files ext =
@@ -176,7 +178,7 @@ let () =
176
178
(useful for debugging infinite loops)
177
179
*)
178
180
Printexc. record_backtrace true ;
179
- Arg. parse argspec add_arg usage;
181
+ Arg. parse_expand argspec add_arg usage;
180
182
if ! mode = Default then mode := (if ! args = [] then Interact else Compile );
181
183
Flags. compiled := (! mode = Compile || ! mode = Idl );
182
184
process_profiler_flags () ;
Original file line number Diff line number Diff line change @@ -26,3 +26,13 @@ let error_args = [
26
26
" --error-detail" , Arg. Set_int Flags. error_detail, " set error message detail for syntax errors"
27
27
(* TODO move --hide-warnings here? *)
28
28
]
29
+
30
+ let inclusion_args = [
31
+ (* generic arg inclusion from file *)
32
+ " --args" , Arg. Expand Arg. read_arg,
33
+ " <file> Read additional newline separated command line arguments \n \
34
+ \ from <file>" ;
35
+ " --args0" , Arg. Expand Arg. read_arg0,
36
+ " <file> Read additional NUL separated command line arguments from \n \
37
+ \ <file>"
38
+ ]
Original file line number Diff line number Diff line change 1
1
val error_args : (Arg .key * Arg .spec * Arg .doc ) list
2
2
val package_args : (Arg .key * Arg .spec * Arg .doc ) list
3
+ val inclusion_args : (Arg .key * Arg .spec * Arg .doc ) list
You can’t perform that action at this time.
0 commit comments