janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

(doc cond) bug #141

Closed ghost closed 5 years ago

ghost commented 5 years ago

The documentation is badly printed. The order of words is bad. I am using janet-v1.1.0-windows.zip on Windows 10.

https://github.com/janet-lang/janet/blob/6887dd05f674ccf931bc99dabeca4fc095988a08/src/boot/boot.janet#L157

bug


What is it for (5381: 5908)?

bakpakin commented 5 years ago

The pair (5381: 5908) is the (byte start index, byte end index) pair in the file. Rather than line, col, this is unambiguous and gives a range rather than a point, usually the entire s expression. Using vim, you can type :5381go to go to a specific byte (character). Emacs has something similar.

I will look at the strange formatting issue, however.

bakpakin commented 5 years ago

The culprit was windows text mode when reading files, which was inserting a carriage return into the parsed doc strings. The docstring formatter did not like that and was screwing it up. My making the parser ignore carriage returns in double quoted strings, we solve the problem. We also try to make most file utility functions use binary mode when possible. It's now fixed on the latest master.