All Downloads are FREE. Search and download functionalities are using the official Maven repository.

izumi.idealingua.il.parser.DefBuzzer.scala Maven / Gradle / Ivy

The newest version!
package izumi.idealingua.il.parser

import izumi.idealingua.il.parser.structure._
import izumi.idealingua.model.il.ast.raw.defns.{RawBuzzer, RawMethod, RawTopLevelDefn}
import fastparse.NoWhitespace._
import fastparse._

class DefBuzzer(context: IDLParserContext) {

  import context._
  import sep._

  // other method kinds should be added here
  def methods[$: P]: P[Seq[RawMethod]] = P(defSignature.method(kw.defe).rep(sep = any))

  def buzzerBlock[$: P]: P[RawTopLevelDefn.TLDBuzzer] = P(metaAgg.cblock(kw.buzzer, methods)).map {
    case (c, i, v) => RawBuzzer(i.toBuzzerId, v.toList, c)
  }
    .map(RawTopLevelDefn.TLDBuzzer.apply)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy