candy-lang / candy

🍭 A sweet, functional programming language that is robust, minimalistic, and expressive.
MIT License
313 stars 3 forks source link

Leading whitespaces after indentation are not parsed correctly #1016

Open styrix560 opened 2 months ago

styrix560 commented 2 months ago

When parsing the string:

"
    foo
"

two of the white-spaces should be flagged as trailing white-space and two should remain with the string. Currently, both are marked as being trailing white-space.

The same error occurs when parsing

  foo
    bar

Here all four white-spaces in front of bar are marked as trailing, while only two of them should be.