Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused inless parameter #2509

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/jsbackend/print.fs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ and pretty_print_statement (p:statement_t) : doc =

| JSS_For(i,c,l,s) -> reduce [ws; text "for"; reduce [
(match i with None -> empty
| Some e -> (match e with JSF_Expression(f) -> pretty_print_exp_il f
| Some e -> (match e with JSF_Expression(f) -> pretty_print_exp f
| JSF_Declaration(l) -> List.map
(fun (x,vl) -> reduce [text "var"; ws; text (jstr_escape x);
(match vl with None -> empty | Some v -> reduce [ws; text "="; ws; pretty_print_exp_cl v])]
Expand All @@ -84,7 +84,7 @@ and pretty_print_statement (p:statement_t) : doc =
hardline; optws s]

| JSS_Forin(i,e,s) -> reduce [ws; text "for"; reduce [
(match i with JSF_Expression(f) -> pretty_print_exp_il f
(match i with JSF_Expression(f) -> pretty_print_exp f
| JSF_Declaration(l) -> List.map (fun (x,v) -> reduce [text "var"; ws; text (jstr_escape x);
(match v with None->empty | Some v -> reduce [ws; text "="; ws; pretty_print_exp_cl v])])
l |> combine comma); ws; colon; ws; pretty_print_exp e] |> parens;
Expand Down Expand Up @@ -113,7 +113,7 @@ and pretty_print_statements l = reduce (List.map pretty_print_statement l)

and pt s b = if b then parens s else s

and pretty_print_exp_gen (commaless:bool) (inless:bool) =
and pretty_print_exp_gen (commaless:bool) =
let rec ppe input = match input with
| JSE_This -> (text "this", 0)
| JSE_Null -> (text "null", 0)
Expand Down Expand Up @@ -175,9 +175,8 @@ and pretty_print_exp_gen (commaless:bool) (inless:bool) =
(reduce [pt s1 (p1>k1); ws; text op; ws; pt s2 (p2>k2)], pr)
in fun e -> fst (ppe e)

and pretty_print_exp : expression_t -> doc = pretty_print_exp_gen false false
and pretty_print_exp_cl = pretty_print_exp_gen true false
and pretty_print_exp_il = pretty_print_exp_gen false true
and pretty_print_exp : expression_t -> doc = pretty_print_exp_gen false
and pretty_print_exp_cl = pretty_print_exp_gen true

and pretty_print_elist l = List.map pretty_print_exp_cl l |> combine comma

Expand Down