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

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

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

import izumi.idealingua.model.il.ast.InputPosition
import fastparse.NoWhitespace._
import fastparse._

class DefPositions(context: IDLParserContext) {
  def positioned[T](defparser: => P[T])(implicit v: P[?]): P[(InputPosition, T)] = {
    (Index ~ defparser ~ Index).map {
      case (start, value, stop) =>
        (InputPosition.Defined(start, stop, context.file), value)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy