File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -101,17 +101,21 @@ module IfThenElse = struct
101
101
if ! changed then Some newStructure else None
102
102
end
103
103
104
+ let parse ~filename =
105
+ let {Res_driver. parsetree = structure; comments} =
106
+ Res_driver. parsingEngine.parseImplementation ~for Printer:false ~filename
107
+ in
108
+ let print ~structure =
109
+ Res_printer. printImplementation ~width: ! Res_cli.ResClflags. width ~comments
110
+ structure
111
+ in
112
+ (structure, print)
113
+
104
114
let command ~path ~pos =
105
115
if Filename. check_suffix path " .res" then
106
- let parser =
107
- Res_driver. parsingEngine.parseImplementation ~for Printer:false
108
- in
109
- let {Res_driver. parsetree = structure; comments} = parser ~filename: path in
110
- let printer =
111
- Res_printer. printImplementation ~width: ! Res_cli.ResClflags. width ~comments
112
- in
116
+ let structure, print = parse ~filename: path in
113
117
match IfThenElse. xform ~pos structure with
114
118
| None -> ()
115
119
| Some newStructure ->
116
- let formatted = printer newStructure in
120
+ let formatted = print newStructure in
117
121
Printf. printf " Hit IfThenElse. Formatted:\n %s" formatted
You can’t perform that action at this time.
0 commit comments