mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
samples: add scala compiler options. fix warnings (#856)
This commit is contained in:
parent
083ecbdad2
commit
da8c50e474
|
@ -29,3 +29,10 @@ teavm.js {
|
||||||
addedToWebApp = true
|
addedToWebApp = true
|
||||||
mainClass = "org.teavm.samples.scala.Client"
|
mainClass = "org.teavm.samples.scala.Client"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<ScalaCompile> {
|
||||||
|
scalaCompileOptions.additionalParameters = listOf(
|
||||||
|
"-feature",
|
||||||
|
"-deprecation",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.teavm.jso.dom.html._
|
||||||
import org.teavm.samples.scala.Calculator.{eval, parse, print}
|
import org.teavm.samples.scala.Calculator.{eval, parse, print}
|
||||||
|
|
||||||
object Client {
|
object Client {
|
||||||
def main(args: Array[String]) {
|
def main(args: Array[String]): Unit = {
|
||||||
val doc = HTMLDocument.current
|
val doc = HTMLDocument.current
|
||||||
val exprElem = doc.getElementById("expr").asInstanceOf[HTMLInputElement]
|
val exprElem = doc.getElementById("expr").asInstanceOf[HTMLInputElement]
|
||||||
val calcElem = doc.getElementById("calculate")
|
val calcElem = doc.getElementById("calculate")
|
||||||
|
|
|
@ -17,11 +17,11 @@ trait Rule[T] {
|
||||||
|
|
||||||
def |(other: => Rule[T]): Rule[T] = Rule.firstOf(this, other)
|
def |(other: => Rule[T]): Rule[T] = Rule.firstOf(this, other)
|
||||||
|
|
||||||
def *(): Rule[List[T]] = Rule.unlimited(this)
|
def * : Rule[List[T]] = Rule.unlimited(this)
|
||||||
|
|
||||||
def >>[S](f: T => S): Rule[S] = Rule.andThen(this, f)
|
def >>[S](f: T => S): Rule[S] = Rule.andThen(this, f)
|
||||||
|
|
||||||
def ?(): Rule[Option[T]] = Rule.optional(this)
|
def ? : Rule[Option[T]] = Rule.optional(this)
|
||||||
|
|
||||||
def debug(str: String) = Rule.rule { x =>
|
def debug(str: String) = Rule.rule { x =>
|
||||||
val (result, rem) = parse(x)
|
val (result, rem) = parse(x)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user