输入不匹配 'to' 预期 'end of line without line continuation'

Mismatched input 'to' expecting 'end of line without line continuation'

compareFunction(start, len) =>
    for i = start to len
        if not long
            if x[1] < x[i]
            false
        else
            if x[1] > x[i]
            false
    true

哪里有问题,看不懂

您的 if 语句下的 false 语句未正确缩进。

应该是这样的:

compareFunction(_start, _len) =>
    for i = _start to _len
        if not long
            if x[1] < x[i]
                false
        else
            if x[1] > x[i]
                false
    true