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

io.github.ablearthy.tl.parser.IdentWithNs.scala Maven / Gradle / Ivy

The newest version!
package io.github.ablearthy.tl.parser

import fastparse._

case class IdentWithNs(
    namespace: Option[String],
    ident: String
)

object IdentWithNs {

  private def identNsWith[_: P](x: => P[String]): P[IdentWithNs] =
    P((Ident.namespaceParser ~~ CharIn(".")).? ~~ x).map { case (a, b) =>
      IdentWithNs(a, b)
    }

  def lcIdentNsParser[_: P]: P[IdentWithNs] = identNsWith(Ident.lcParser)

  def ucIdentNsParser[_: P]: P[IdentWithNs] = identNsWith(Ident.ucParser)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy