@@ -428,26 +428,26 @@ object Logika {
428
428
def checkScript (fileUriOpt : Option [String ], input : String , config : Config , nameExePathMap : HashMap [String , String ],
429
429
maxCores : Z , smt2f : lang.tipe.TypeHierarchy => Smt2 , cache : Logika .Cache , reporter : Reporter ,
430
430
hasLogika : B , plugins : ISZ [Plugin ], line : Z ,
431
- skipMethods : ISZ [String ], skipTypes : ISZ [String ]): Unit = {
431
+ skipMethods : ISZ [String ], skipTypes : ISZ [String ]): Option [ AST . TopUnit ] = {
432
432
val parsingStartTime = extension.Time .currentMillis
433
433
val isWorksheet : B = fileUriOpt match {
434
434
case Some (p) => ! ops.StringOps (p).endsWith(" .scala" ) && ! ops.StringOps (p).endsWith(" .slang" )
435
435
case _ => T
436
436
}
437
437
438
- def checkScriptH (): Unit = {
438
+ def checkScriptH (): Option [ AST . TopUnit ] = {
439
439
val topUnitOpt = lang.parser.Parser (input).parseTopUnit[AST .TopUnit ](
440
440
isWorksheet = isWorksheet, isDiet = F , fileUriOpt = fileUriOpt, reporter = reporter)
441
441
val libraryStartTime = extension.Time .currentMillis
442
442
reporter.timing(parsingDesc, libraryStartTime - parsingStartTime)
443
443
if (reporter.hasError) {
444
444
reporter.illFormed()
445
- return
445
+ return topUnitOpt
446
446
}
447
447
topUnitOpt match {
448
448
case Some (program : AST .TopUnit .Program ) =>
449
449
if (! isWorksheet) {
450
- return
450
+ return topUnitOpt
451
451
}
452
452
val (tc, rep) = extension.Cancel .cancellable(() => lang.FrontEnd .checkedLibraryReporter)
453
453
val typeCheckingStartTime = extension.Time .currentMillis
@@ -486,9 +486,10 @@ object Logika {
486
486
}
487
487
case _ =>
488
488
}
489
+ return topUnitOpt
489
490
}
490
491
491
- extension.Cancel .cancellable(checkScriptH _)
492
+ return extension.Cancel .cancellable(checkScriptH _)
492
493
}
493
494
494
495
@ pure def shouldCheck (fileSet : HashSSet [String ], line : Z , posOpt : Option [Position ]): B = {
0 commit comments