Skip to content

Remove Heredocs

AdminXVII requested to merge AdminXVII/ion:no-heredocs into master

Heredocs make the parser non-deterministic and make it impossible to make efficient parsers due to the need to store the end characters. To make it easier to switch to a recursive ascent parser like nom, it is better to avoid heredocs in the syntax

From a user point-of-view, heredocs are redundant and/or encourage non-ergonomic behaviour. If the string is simple, herestrings are sufficient and do not require a user-defined terminator. If the string is long or implies nested comments and/or code, it is probably better to store it in a separate file and use cat for script legibility.

This has already been made by fish and does not seem like a pain point. See https://fishshell.com/docs/current/design.html#ortho

Merge request reports