koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.27k stars 163 forks source link

Koka leaves ANSI control letters on empty output #99

Open SchrodingerZhu opened 3 years ago

SchrodingerZhu commented 3 years ago
test = TEST_DIR + "/" + "/".join(i[:-2]) + "test-" + i[-1]
        src  = test + ".kk"
        log.info("TESTING {}".format(src))
        res = run(["koka", *TEST_ARGS, "-e", src, "-v0"], stdout=PIPE, text=True, stderr=PIPE)
        out = re.sub("[^{}]+".format(printable), "", res.stdout.strip())
        if len(out) != 0 or res.returncode != 0:
            for i in out:
                print(i)

And I found

[
0
0
m

Is this left by koka?

SchrodingerZhu commented 3 years ago

url: https://github.com/SchrodingerZhu/koka-collections

daanx commented 3 years ago

Yes -- I think so; give the --console=raw to suppress color output

daanx commented 3 years ago

Nice you are working on collections; Did you read about size-balanced trees as I used in the Haskell Data.Map implementation? or the integer Patricia trees in Haskell's Data.IntMap ?

SchrodingerZhu commented 3 years ago

I understand Patricia. But isn't already reserved for std/data/imap? :D

daanx commented 3 years ago

Anyone is welcome to try to help implementing and creating std/ libraries :-)