Skip to content

Commit

Permalink
gen: ensure no trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek committed Nov 26, 2023
1 parent 49bb34c commit 825bb7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let (inc_indent,dec_indent,make_indent) =

let print_indent () = print_string (make_indent ())
let indent s = print_indent (); print_string s
let indent_endline s = print_indent (); print_endline s
let indent_endline s = print_indent (); print_endline @@ String.trim s
let output fmt = kprintf indent_endline fmt
let output_l = List.iter indent_endline
let print fmt = kprintf print_endline fmt
Expand Down
4 changes: 2 additions & 2 deletions src/gen_caml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ let rec set_var index var =
| SingleIn _ -> ()
| TupleList _ -> ()
| ChoiceIn { param = name; vars; _ } ->
output "begin match %s with " (make_param_name index name);
output "begin match %s with" (make_param_name index name);
output "| [] -> ()";
output "| _ :: _ ->";
inc_indent ();
Expand All @@ -227,7 +227,7 @@ let rec set_var index var =
dec_indent ();
output "end;"
| Choice (name,ctors) ->
output "begin match %s with " (make_param_name index name);
output "begin match %s with" (make_param_name index name);
ctors |> List.iteri begin fun i ctor ->
match ctor with
| Simple (param,args) ->
Expand Down

0 comments on commit 825bb7d

Please sign in to comment.