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

[Indent] use ocp-indent when ocamlformat is deactivated #1811

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/Translation_unit.ml
Expand Up @@ -534,12 +534,16 @@ let numeric (type a b) (fg : a list Extended_ast.t)
| Ok parsed -> Ok parsed
| Error _ -> parse_result recover fg conf ~source:src ~input_name
in
match parse_or_recover ~src:source with
| Ok parsed -> (
match parse_result Std_ast.Parse.ast std_fg conf ~source ~input_name with
| Ok std_parsed -> indent_parsed parsed std_parsed ~src:source ~range
| Error _ -> fallback () )
| Error _ -> fallback ()
if conf.disable then fallback ()
else
match parse_or_recover ~src:source with
| Ok parsed -> (
match
parse_result Std_ast.Parse.ast std_fg conf ~source ~input_name
with
| Ok std_parsed -> indent_parsed parsed std_parsed ~src:source ~range
| Error _ -> fallback () )
| Error _ -> fallback ()

let numeric = function
| Syntax.Structure -> numeric Structure Structure
Expand Down