@@ -335,15 +335,15 @@ def readEvalTacticsAtModuleResult (resultFile : String) : CoreM (Array (Name ×
335335where
336336 analyzeLine (fileName line : String) : CoreM (Name × Array (Result × Nat × Nat)) := do
337337 let line := (line.dropWhile (fun c => c != ' ' )).drop 3
338- let tr := ((line.takeWhile (fun c => c != ']' )).toString.splitOn ", " )
339- let tr : Array (Result × Nat × Nat) ← (Array.mk tr) .mapM (fun s => do
338+ let tr := ((line.takeWhile (fun c => c != ']' )).split ", " ).toStringArray
339+ let tr : Array (Result × Nat × Nat) ← tr .mapM (fun s => do
340340 let [sr, st, sh] := s.splitOn " "
341341 | throwError s! "{ decl_name%} :: In file { fileName} , { s} is not of the form `<result> <time> <heartbeats>`"
342342 match Result.ofConcise? sr, String.toNat? st, String.toNat? sh with
343343 | .some r, .some t, .some h => return (r, t, h)
344344 | _, _, _ => throwError s! "{ decl_name%} :: In file { fileName} , { s} is not of the form `<result> <time> <heartbeats>`" )
345- let line := (line.dropWhile (fun c => c != ']' )).drop 2
346- let name := Name.parseUniqRepr line.toString
345+ let line := (( line.dropWhile (fun c => c != ']' )).drop 2 ).toString
346+ let name := Name.parseUniqRepr line
347347 return (name, tr)
348348
349349structure EvalTacticOnMathlibConfig where
@@ -495,8 +495,8 @@ def readETMHTResult (config : EvalTacticOnMathlibConfig) :
495495 for path in allPaths do
496496 if !(← System.FilePath.isDir path) && path.toString.takeEnd 7 == ".result" then
497497 let content ← readEvalTacticsAtModuleResult path.toString
498- let suffix := (( path.toString.drop (resultFolder.length + 1 )).dropEnd 7 ).toString
499- let modName := (suffix.splitOn "/" ).foldl (fun a b => Name.str a b) .anonymous
498+ let suffix := (path.toString.drop (resultFolder.length + 1 )).dropEnd 7
499+ let modName := (suffix.split "/" ).toStringArray .foldl (fun a b => Name.str a b) .anonymous
500500 ret := ret.push (modName, content)
501501 return ret
502502
@@ -516,11 +516,11 @@ def readETMHTResultAllowNonRet (config : EvalTacticOnMathlibConfig) :
516516 if !(← System.FilePath.isDir path) && path.toString.takeEnd 7 == ".result" then
517517 let raw ← IO.FS.readFile path
518518 if raw.length == 0 then
519- nonRet := nonRet.push (( path.toString.dropEnd 7 ).toString)
519+ nonRet := nonRet.push (path.toString.dropEnd 7 ).toString
520520 continue
521521 let content ← readEvalTacticsAtModuleResult path.toString
522- let suffix := (( path.toString.drop (resultFolder.length + 1 )).dropEnd 7 ).toString
523- let modName := (suffix.splitOn "/" ).foldl (fun a b => Name.str a b) .anonymous
522+ let suffix := (path.toString.drop (resultFolder.length + 1 )).dropEnd 7
523+ let modName := (suffix.split "/" ).toStringArray .foldl (fun a b => Name.str a b) .anonymous
524524 ret := ret.push (modName, content)
525525 return (nonRet, ret)
526526
@@ -580,7 +580,7 @@ def readETMHTEvaluateFiles (config : EvalTacticOnMathlibConfig) : CoreM (Array N
580580 let [name, retCode] := line.splitOn ":"
581581 | throwError "{decl_name%} :: Unexpected line format, line content : `{line}`"
582582 let name := (name.dropEnd 1 ).toString
583- let retCode := ( retCode.drop 1 ).toString
583+ let retCode := retCode.drop 1
584584 let some retCode := retCode.toNat?
585585 | throwError "{decl_name%} :: Unexpected line format, line content : `{line}`"
586586 retEnd := retEnd.push (str2Name name, retCode)
0 commit comments