1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-01-01 06:29:53 +00:00

Java 11 compatibility

This commit is contained in:
Karol Stasiak 2019-06-28 17:54:08 +02:00
parent 0af9bc4696
commit 13c23c1bd1
6 changed files with 6 additions and 6 deletions

View File

@ -89,7 +89,7 @@ abstract class AbstractSourceLoadingQueue[T](val initialFilenames: List[String],
}
}
val parser = createParser(shortFileName, src, parentDir, featureConstants, pragmas.keySet)
options.log.addSource(shortFileName, src.lines.toIndexedSeq)
options.log.addSource(shortFileName, src.linesIterator.toIndexedSeq)
parser.toAst match {
case Success(prog, _) =>
parsedModules.synchronized {

View File

@ -18,7 +18,7 @@ object Preprocessor {
private val Regex = """\A\s*(?:#|\$\$)\s*([a-z]+)\s*(.*?)\s*\z""".r
def preprocessForTest(options: CompilationOptions, code: String): PreprocessingResult = {
apply(options, "", code.lines.toSeq)
apply(options, "", code.linesIterator.toSeq)
}
case class IfContext(hadEnabled: Boolean, hadElse: Boolean, enabledBefore: Boolean)

View File

@ -92,7 +92,7 @@ class EmuI86Run(nodeOptimizations: List[NodeOptimization], assemblyOptimizations
log.verbosity = 999
var effectiveSource = source
if (!source.contains("_panic")) effectiveSource += "\n void _panic(){while(true){}}"
log.setSource(Some(effectiveSource.lines.toIndexedSeq))
log.setSource(Some(effectiveSource.linesIterator.toIndexedSeq))
val PreprocessingResult(preprocessedSource, features, pragmas) = Preprocessor.preprocessForTest(options, effectiveSource)
// tests use Intel syntax only when forced to:
val parserF = Z80Parser("", preprocessedSource, "", options, features, pragmas.contains("intel_syntax"))

View File

@ -165,7 +165,7 @@ class EmuRun(cpu: millfork.Cpu.Value, nodeOptimizations: List[NodeOptimization],
| sep #$30
|}
""".stripMargin
log.setSource(Some(effectiveSource.lines.toIndexedSeq))
log.setSource(Some(effectiveSource.linesIterator.toIndexedSeq))
val PreprocessingResult(preprocessedSource, features, _) = Preprocessor.preprocessForTest(options, effectiveSource)
val parserF = MosParser("", preprocessedSource, "", options, features)
parserF.toAst match {

View File

@ -92,7 +92,7 @@ class EmuZ80Run(cpu: millfork.Cpu.Value, nodeOptimizations: List[NodeOptimizatio
log.verbosity = 999
var effectiveSource = source
if (!source.contains("_panic")) effectiveSource += "\n void _panic(){while(true){}}"
log.setSource(Some(effectiveSource.lines.toIndexedSeq))
log.setSource(Some(effectiveSource.linesIterator.toIndexedSeq))
val PreprocessingResult(preprocessedSource, features, pragmas) = Preprocessor.preprocessForTest(options, effectiveSource)
// tests use Intel syntax only when forced to:
val parserF = Z80Parser("", preprocessedSource, "", options, features, pragmas.contains("intel_syntax"))

View File

@ -35,7 +35,7 @@ object ShouldNotCompile extends Matchers {
if (!source.contains("_panic")) effectiveSource += "\n void _panic(){while(true){}}"
if (source.contains("import zp_reg"))
effectiveSource += Files.readAllLines(Paths.get("include/zp_reg.mfk"), StandardCharsets.US_ASCII).asScala.mkString("\n", "\n", "")
log.setSource(Some(effectiveSource.lines.toIndexedSeq))
log.setSource(Some(effectiveSource.linesIterator.toIndexedSeq))
val PreprocessingResult(preprocessedSource, features, _) = Preprocessor.preprocessForTest(options, effectiveSource)
val parserF = MosParser("", preprocessedSource, "", options, features)
parserF.toAst match {