Remove Heredocs, they slow down the parser
Heredocs make the parser non-deterministic and make it impossible to make efficient parsers due to the need to store the end character, which can't be efficiently implemented in the parser. 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 favourise non-ergonomic behaviour. If the string is simple, herestring 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
Showing
- benches/herestring.ion 16 additions, 24 deletionsbenches/herestring.ion
- examples/herestring.ion 0 additions, 6 deletionsexamples/herestring.ion
- examples/herestring.out 0 additions, 3 deletionsexamples/herestring.out
- src/lib/parser/pipelines/collector.rs 2 additions, 31 deletionssrc/lib/parser/pipelines/collector.rs
- src/lib/parser/pipelines/mod.rs 1 addition, 1 deletionsrc/lib/parser/pipelines/mod.rs
- src/lib/parser/quotes.rs 0 additions, 46 deletionssrc/lib/parser/quotes.rs
Loading
Please register or sign in to comment