GreatSyntacticShift: Parser test data fixed

This commit is contained in:
Andrey Breslav
2011-12-21 10:57:09 +02:00
parent 6bad4830c3
commit 91d10790b4
84 changed files with 797 additions and 901 deletions
@@ -1,4 +1,4 @@
type Comparison<in T> = fun (T, T) : Int
type Comparison<in T> = (T, T) -> Int
fun naturalOrder<in T : Comparable<T>>(a : T, b : T) : Int = a.compareTo(b)
@@ -8,9 +8,9 @@ enum class ComparisonResult {
LS; EQ; GR
}
type MatchableComparison<in T> = fun (T, T) : ComparisonResult
type MatchableComparison<in T> = (T, T) -> ComparisonResult
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {(a, b) =>
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {(a, b) ->
val res = cmp(a, b)
if (res == 0) return ComparisonResult.EQ
if (res < 0) return ComparisonResult.LS