2 ms·
I just solved this problem in Oil. In our two main influences, shell and Python, newlines are significant. However Oil uses {} for blocks, and it also has dic
by chubot 6y ago
I just solved this problem in Oil. In our two main influences, shell and Python, newlines are significant.
However Oil uses {} for blocks, and it also has dicts.
Originally I thought we should have something like %{} for dicts to give the lexer and easier job when deciding when newlines are significant. Oil uses Python's rules of newlines being ignored between () and [], and it would make sense to ignore them inside {} but not %{}.
But I found I could just makes newlines significant within {} and then put them in the grammar for dicts, as well as for blocks. It seems to work fine.
http://www.oilshell.org/blog/2020/10/big-changes.html#dicts-are-not http://www.oilshell.org/blog/2020/10/big-changes.html#dicts-...
I am open to feedback if anyone wants to kick the tires :)