chaos-lang / chaos

The Chaos Programming Language
https://chaos-lang.org
GNU General Public License v3.0
281 stars 17 forks source link

[Bug] My Eyes! #109

Open iacore opened 3 years ago

iacore commented 3 years ago

Describe the bug The colors! The horror!

To Reproduce

Try to run the following code with chaos my_eyes.kaos.

some compile error:

pretty c

image

syntax error:

bool a = true
bool a = true

image

my terminal palette: image

Expected behavior Please don't change the background color whatsoever. If you want emphasis, use italic, bold text, or colored text, or both!

This is how Rust does it: image

Environment:

iacore commented 3 years ago

Also, chaos doesn't respect TERM at all. I can't find a way to turn it off. My attempts:

env TERM=ansi chaos my_eyes.kaos
chaos my_eyes.kaos | cat
mertyildiran commented 3 years ago

@locriacyber thank you so much for reporting the issue. Would you like to implement the fix? You just need to look at the places where \033[ occur. For example in these places:

https://github.com/chaos-lang/chaos/blob/61a43370d99b3caeff233d4fef7542b127088fdc/interpreter/errors.c#L283

https://github.com/chaos-lang/chaos/blob/8ca8d6bb4505f74d45d959f922a441da775672b4/utilities/messages.c#L101

https://github.com/chaos-lang/chaos/blob/12cc3252c1c1bcc7565c9a6cca303e42486896d1/parser/parser.c#L427

iacore commented 3 years ago

I don't have time to implement this.

As a side note, you claim that Chaos has "zero cyclomatic complexity". Is this a joke language?