mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Bump Scala version in Scala example. Add hack for Scala runtime.
This commit is contained in:
parent
e625409562
commit
eab7ef0a2e
|
@ -46,6 +46,9 @@ public class ScalaHacks implements ClassHolderTransformer {
|
||||||
case "scala.util.Properties$":
|
case "scala.util.Properties$":
|
||||||
transformProperties(cls);
|
transformProperties(cls);
|
||||||
break;
|
break;
|
||||||
|
case "scala.runtime.Statics":
|
||||||
|
transformStatics(cls, context.getHierarchy());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) {
|
if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) {
|
||||||
checkAndRemoveExportAnnotation(cls);
|
checkAndRemoveExportAnnotation(cls);
|
||||||
|
@ -97,6 +100,15 @@ public class ScalaHacks implements ClassHolderTransformer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void transformStatics(ClassHolder cls, ClassHierarchy hierarchy) {
|
||||||
|
for (MethodHolder method : cls.getMethods()) {
|
||||||
|
if (method.getName().equals("releaseFence")) {
|
||||||
|
ProgramEmitter pe = ProgramEmitter.create(method, hierarchy);
|
||||||
|
pe.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void checkAndRemoveExportAnnotation(ClassHolder cls) {
|
private void checkAndRemoveExportAnnotation(ClassHolder cls) {
|
||||||
for (MethodHolder method : cls.getMethods()) {
|
for (MethodHolder method : cls.getMethods()) {
|
||||||
AnnotationContainer items = method.getAnnotations();
|
AnnotationContainer items = method.getAnnotations();
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<scala.version>2.12.11</scala.version>
|
<scala.version>2.13.8</scala.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.alchim31.maven</groupId>
|
<groupId>net.alchim31.maven</groupId>
|
||||||
<artifactId>scala-maven-plugin</artifactId>
|
<artifactId>scala-maven-plugin</artifactId>
|
||||||
<version>4.3.1</version>
|
<version>4.6.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
|
|
|
@ -52,7 +52,7 @@ object Calculator {
|
||||||
|
|
||||||
def keyword(str: String) = s(str) ~ ws >> { case (s, _) => s }
|
def keyword(str: String) = s(str) ~ ws >> { case (s, _) => s }
|
||||||
|
|
||||||
def ws = s(" ").* >> (_ => Unit)
|
def ws = s(" ").* >> (_ => ())
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed abstract class Expr
|
sealed abstract class Expr
|
||||||
|
|
Loading…
Reference in New Issue
Block a user