candy-lang / candy

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

1016 leading whitespaces after indentation are not parsed correctly #1023

Open styrix560 opened 2 months ago

styrix560 commented 2 months ago

Closes: #1016

The problem was, that after parsing indentation whitespace-parsing was postponed. When the whitespaces consisted of two spaces, we first checked if you could parse indentation from the remaining input. Because of the two spaces you could, so more indentation was parsed. The solution was to not postpone whitespace-parsing and instead do it immediately after parsing indentation.

I am more or less sure the test cases look okay. If I were to choose, however, I would pick less. So, I would appreciate feedback.

Checklist

jwbot commented 2 months ago

🐰Bencher

ReportSun, April 21, 2024 at 13:13:42 UTC
ProjectCandy
Branch1016-leading-whitespaces-after-indentation-are-not-parsed-correctly
TestbedGitHub Actions: Ubuntu 22.04
BenchmarkEstimated CyclesEstimated Cycles Results
estimated cycles
InstructionsInstructions Results
instructions
L1 AccessesL1 Accesses Results
accesses
L2 AccessesL2 Accesses Results
accesses
RAM AccessesRAM Accesses Results
accesses
Total AccessesTotal Accesses Results
total-accesses
compile: Examples/fibonacci.candy ➖ (view plot)1791670090.000➖ (view plot)1189937665.000➖ (view plot)1618812475.000➖ (view plot)10751132.000➖ (view plot)3402913.000➖ (view plot)1632966520.000
compile: Examples/helloWorld.candy ➖ (view plot)284198198.000➖ (view plot)176272890.000➖ (view plot)248121798.000➖ (view plot)1479711.000➖ (view plot)819367.000➖ (view plot)250420876.000
vm_runtime: Examples/fibonacci.candy 10➖ (view plot)181431754.000➖ (view plot)106024775.000➖ (view plot)149334889.000➖ (view plot)795013.000➖ (view plot)803480.000➖ (view plot)150933382.000
vm_runtime: Examples/helloWorld.candy ➖ (view plot)154535457.000➖ (view plot)88645701.000➖ (view plot)124969072.000➖ (view plot)701441.000➖ (view plot)744548.000➖ (view plot)126415061.000

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help