let out x = Printf.printf " %s \n" x
let _ = try
while true do
let line = input_line stdin in
begin
match (Str.split (Str.regexp " ") line) with
["commit";code] -> out code;
| ["diff"; _; before; after] -> out before;
out after;
let rec f (xpath: string list) : ( string list ) =
(match Str.split (Str.regexp "/") xpath with
| _ ::rest -> out (String.concat "/" rest)
| _ -> []
)
| _ -> ()
end
done
with
End_of_file -> ()
答案 0 :(得分:0)
你想用
做什么let rec f (xpath: string list) : ( string list ) =
(match Str.split (Str.regexp "/") xpath with
| _ ::rest -> out (String.concat "/" rest)
| _ -> []
)
这段代码与其余代码无关。
删除它,你的代码在语法上是正确的。