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

Represent 'let f _ = function' in the CST #2596

Merged
merged 22 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
extended: Missing Printast for pvb_is_pun and pvb_args
  • Loading branch information
Julow committed Oct 18, 2024
commit 83dc158ca52921610c5c9e8c44bff6290a8eca27
48 changes: 36 additions & 12 deletions test/cli/debug.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
[
<def> (a.ml[2,34+0]..[4,59+7])
comments
before: (* Intentionally not formatted *)
before: (* Intentionally not formatted *) is_pun=false
None
pattern (a.ml[2,34+4]..[2,34+6])
Ppat_construct "()" (a.ml[2,34+4]..[2,34+6])
None
args
[]
expression (a.ml[3,43+2]..[4,59+7])
Pexp_apply
expression (a.ml[3,43+2]..[3,43+15])
Expand All @@ -47,11 +49,13 @@
[
<def> (a.ml[2,34+0]..[4,59+7])
comments
before: (* Intentionally not formatted *)
before: (* Intentionally not formatted *) is_pun=false
None
pattern (a.ml[2,34+4]..[2,34+6])
Ppat_construct "()" (a.ml[2,34+4]..[2,34+6])
None
args
[]
expression (a.ml[3,43+2]..[4,59+7])
Pexp_apply
expression (a.ml[3,43+2]..[3,43+15])
Expand All @@ -76,11 +80,13 @@
[
<def> (a.ml[2,34+0]..[2,34+26])
comments
before: (* Intentionally not formatted *)
before: (* Intentionally not formatted *) is_pun=false
None
pattern (a.ml[2,34+4]..[2,34+6])
Ppat_construct "()" (a.ml[2,34+4]..[2,34+6])
None
args
[]
expression (a.ml[2,34+9]..[2,34+26])
Pexp_apply
expression (a.ml[2,34+9]..[2,34+22])
Expand All @@ -104,11 +110,13 @@
[
<def> (a.ml[2,34+0]..[2,34+26])
comments
before: (* Intentionally not formatted *)
before: (* Intentionally not formatted *) is_pun=false
None
pattern (a.ml[2,34+4]..[2,34+6])
Ppat_construct "()" (a.ml[2,34+4]..[2,34+6])
None
args
[]
expression (a.ml[2,34+9]..[2,34+26])
Pexp_apply
expression (a.ml[2,34+9]..[2,34+22])
Expand Down Expand Up @@ -148,11 +156,13 @@
<def> (a.ml[2,25+0]..[6,233+3])
comments
before: (* before let-binding *)
after: (* after let-binding *)
after: (* after let-binding *) is_pun=false
None
pattern (a.ml[2,25+4]..[2,25+6])
Ppat_construct "()" (a.ml[2,25+4]..[2,25+6])
None
args
[]
expression (a.ml[5,90+2]..[6,233+3])
comments
before: (* before x binding #1 *)
Expand All @@ -162,7 +172,7 @@
comments
before: (* after unit *)
[
<def> (a.ml[5,90+2]..[5,90+122])
<def> (a.ml[5,90+2]..[5,90+122]) is_pun=false
None
pattern (a.ml[5,90+21]..[5,90+22])
comments
Expand All @@ -174,6 +184,8 @@
before: (* before x *)
after: (* after x #1 *)
after: (* after x #2 *)
args
[]
expression (a.ml[5,90+77]..[5,90+122])
comments
before: (* before unit *)
Expand Down Expand Up @@ -204,11 +216,13 @@
<def> (a.ml[2,25+0]..[6,233+3])
comments
before: (* before let-binding *)
after: (* after let-binding *)
after: (* after let-binding *) is_pun=false
None
pattern (a.ml[2,25+4]..[2,25+6])
Ppat_construct "()" (a.ml[2,25+4]..[2,25+6])
None
args
[]
expression (a.ml[5,90+2]..[6,233+3])
comments
before: (* before x binding #1 *)
Expand All @@ -218,7 +232,7 @@
comments
before: (* after unit *)
[
<def> (a.ml[5,90+2]..[5,90+122])
<def> (a.ml[5,90+2]..[5,90+122]) is_pun=false
None
pattern (a.ml[5,90+21]..[5,90+22])
comments
Expand All @@ -230,6 +244,8 @@
before: (* before x *)
after: (* after x #1 *)
after: (* after x #2 *)
args
[]
expression (a.ml[5,90+77]..[5,90+122])
comments
before: (* before unit *)
Expand Down Expand Up @@ -260,11 +276,13 @@
<def> (a.ml[2,25+0]..[13,265+3])
comments
before: (* before let-binding *)
after: (* after let-binding *)
after: (* after let-binding *) is_pun=false
None
pattern (a.ml[2,25+4]..[2,25+6])
Ppat_construct "()" (a.ml[2,25+4]..[2,25+6])
None
args
[]
expression (a.ml[5,90+2]..[13,265+3])
comments
before: (* before x binding #1 *)
Expand All @@ -274,7 +292,7 @@
[
<def> (a.ml[5,90+2]..[10,210+28])
comments
after: (* after unit *)
after: (* after unit *) is_pun=false
None
pattern (a.ml[5,90+21]..[5,90+22])
comments
Expand All @@ -286,6 +304,8 @@
before: (* before x *)
after: (* after x #1 *)
after: (* after x #2 *)
args
[]
expression (a.ml[9,183+4]..[10,210+28])
comments
before: (* before unit *)
Expand Down Expand Up @@ -315,11 +335,13 @@
<def> (a.ml[2,25+0]..[13,265+3])
comments
before: (* before let-binding *)
after: (* after let-binding *)
after: (* after let-binding *) is_pun=false
None
pattern (a.ml[2,25+4]..[2,25+6])
Ppat_construct "()" (a.ml[2,25+4]..[2,25+6])
None
args
[]
expression (a.ml[5,90+2]..[13,265+3])
comments
before: (* before x binding #1 *)
Expand All @@ -329,7 +351,7 @@
[
<def> (a.ml[5,90+2]..[10,210+28])
comments
after: (* after unit *)
after: (* after unit *) is_pun=false
None
pattern (a.ml[5,90+21]..[5,90+22])
comments
Expand All @@ -341,6 +363,8 @@
before: (* before x *)
after: (* after x #1 *)
after: (* after x #2 *)
args
[]
expression (a.ml[9,183+4]..[10,210+28])
comments
before: (* before unit *)
Expand Down
13 changes: 8 additions & 5 deletions vendor/parser-extended/printast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,11 +1094,14 @@ and case i ppf {pc_lhs; pc_guard; pc_rhs} =
expression (i+1) ppf pc_rhs;

and value_binding i ppf x =
line i ppf "<def> %a\n" fmt_location x.pvb_loc;
ext_attrs (i+1) ppf x.pvb_attributes;
pattern (i+1) ppf x.pvb_pat;
Option.iter (value_constraint (i+1) ppf) x.pvb_constraint;
expression (i+1) ppf x.pvb_expr
line i ppf "<def> %a is_pun=%b\n" fmt_location x.pvb_loc x.pvb_is_pun;
let i = i + 1 in
ext_attrs i ppf x.pvb_attributes;
pattern i ppf x.pvb_pat;
line i ppf "args\n";
list i expr_function_param ppf x.pvb_args;
Option.iter (value_constraint i ppf) x.pvb_constraint;
expression i ppf x.pvb_expr

and value_constraint i ppf x =
let pp_sep ppf () = Format.fprintf ppf "@ "; in
Expand Down