@@ -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 != ']' )).splitOn ", "
338+ let tr := (( line.takeWhile (fun c => c != ']' )).toString. splitOn ", " )
339339 let tr : Array (Result × Nat × Nat) ← (Array.mk tr).mapM (fun s => do
340340 let [sr, st, sh] := s.splitOn " "
341- | throwError "s! {decl_name%} :: In file {fileName}, {s} is not of the form `<result> <time> <heartbeats>`"
341+ | 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>`" )
345345 let line := (line.dropWhile (fun c => c != ']' )).drop 2
346- let name := Name.parseUniqRepr line
346+ let name := Name.parseUniqRepr line.toString
347347 return (name, tr)
348348
349349structure EvalTacticOnMathlibConfig where
@@ -493,9 +493,9 @@ def readETMHTResult (config : EvalTacticOnMathlibConfig) :
493493 let allPaths ← System.FilePath.walkDir resultFolder
494494 let mut ret := #[]
495495 for path in allPaths do
496- if !(← System.FilePath.isDir path) && path.toString.takeRight 7 == ".result" then
496+ 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 )).dropRight 7
498+ let suffix := (( path.toString.drop (resultFolder.length + 1 )).dropEnd 7 ).toString
499499 let modName := (suffix.splitOn "/" ).foldl (fun a b => Name.str a b) .anonymous
500500 ret := ret.push (modName, content)
501501 return ret
@@ -513,13 +513,13 @@ def readETMHTResultAllowNonRet (config : EvalTacticOnMathlibConfig) :
513513 let mut ret := #[]
514514 let mut nonRet := #[]
515515 for path in allPaths do
516- if !(← System.FilePath.isDir path) && path.toString.takeRight 7 == ".result" then
516+ 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.dropRight 7 )
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 )).dropRight 7
522+ let suffix := (( path.toString.drop (resultFolder.length + 1 )).dropEnd 7 ).toString
523523 let modName := (suffix.splitOn "/" ).foldl (fun a b => Name.str a b) .anonymous
524524 ret := ret.push (modName, content)
525525 return (nonRet, ret)
@@ -579,8 +579,8 @@ def readETMHTEvaluateFiles (config : EvalTacticOnMathlibConfig) : CoreM (Array N
579579 if line.contains ':' then
580580 let [name, retCode] := line.splitOn ":"
581581 | throwError "{decl_name%} :: Unexpected line format, line content : `{line}`"
582- let name := name.dropRight 1
583- let retCode := retCode.drop 1
582+ let name := ( name.dropEnd 1 ).toString
583+ let retCode := ( retCode.drop 1 ).toString
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