mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-21 01:00:54 +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$":
|
||||
transformProperties(cls);
|
||||
break;
|
||||
case "scala.runtime.Statics":
|
||||
transformStatics(cls, context.getHierarchy());
|
||||
break;
|
||||
default:
|
||||
if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) {
|
||||
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) {
|
||||
for (MethodHolder method : cls.getMethods()) {
|
||||
AnnotationContainer items = method.getAnnotations();
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<properties>
|
||||
<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>
|
||||
</properties>
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
<version>4.3.1</version>
|
||||
<version>4.6.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -52,7 +52,7 @@ object Calculator {
|
||||
|
||||
def keyword(str: String) = s(str) ~ ws >> { case (s, _) => s }
|
||||
|
||||
def ws = s(" ").* >> (_ => Unit)
|
||||
def ws = s(" ").* >> (_ => ())
|
||||
}
|
||||
|
||||
sealed abstract class Expr
|
||||
|
Loading…
Reference in New Issue
Block a user