scala.annotation.switch.scala Maven / Gradle / Ivy
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.annotation
/**
* An annotation to be applied to a match expression. If present,
* the compiler will verify that the match has been compiled to a
* tableswitch or
* lookupswitch, and issue an error if it
* instead compiles into a series of conditional expressions.
* Example:
*
*
* def fetchToken() {
* (ch: @switch) match {
* case ' ' | '\t' | CR | LF | FF =>
* nextChar()
* fetchToken()
* case 'A' /*..'Z'*/ | '$' | '_' | 'a' /*..'z'*/ =>
* putChar(ch)
* nextChar()
* getIdentRest()
* case ',' =>
* nextChar(); token = COMMA
* // more cases
* }
* }
*
* @since 2.8
*/
final class switch extends StaticAnnotation
© 2015 - 2025 Weber Informatics LLC | Privacy Policy