Skip to content

Instantly share code, notes, and snippets.

@okomok
okomok / gist:54935
Created January 30, 2009 04:09
LRule
// Copyright Shunsuke Sogame 2008-2009.
// Distributed under the terms of an MIT-style license.
// See: "Packrat Parsers Can Support Left Recursion"
package mada.peg
@okomok
okomok / gist:54934
Created January 30, 2009 04:09
Triple
package mada.vec
private[mada] object TripleVector {
def apply[A](v: Vector.Triple[A]): Vector[A] = v._1(v._2, v._3)
}
private[mada] object VectorTriple {
def apply[A](v: Vector[A]): Vector.Triple[A] = (v, v.start, v.end)
@okomok
okomok / gist:54933
Created January 30, 2009 04:08
Triples
package mada.vec
/*
private[mada] object TriplesVector {
def apply[A](from: Vector[Vector.Triple[A]]): Vector[Vector[A]] = from match {
case from: VectorTriples[_] => from.from // conversion fusion
case _ => new TriplesVector(from)
}
}