~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[RFC PATCH] Multiline strings

Details
Message ID
<20201019165400.38320-1-hubert@hirtz.pm>
DKIM signature
fail
Download raw message
Patch: +15 -5 DKIM signature: fail
---
Thoughts about the design of the feature?  This would be useful eg for
the MOTD in ellidri, and also in eventual build scripts.

Newlines would be kept, but not the whitespace around (as shown in the
changes already done to the grammar).

 README.md | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 55d8919..1a36a3b 100644
--- a/README.md
+++ b/README.md
@@ -2,15 +2,21 @@

A simple configuration file format.

The config file has one directive per line. Directives have a name, followed
by parameters separated by space characters. Parameters may be quoted.
Directives may have children in blocks delimited by "{" and "}". Lines
beginning with "#" are comments.
The config file has one directive per line. Directives have a name, followed by
parameters separated by space characters. Parameters may be quoted.  Directives
may have children in blocks delimited by "{" and "}".  Multiline strings are
enclosed between "[" and "]".  Lines beginning with "#" are comments.

Example:

```
train "Shinkansen" {
    description [
        Shinkansen trains are electric multiple units, offering fast
        acceleration, deceleration and reduced damage to the track because of
        the use of lighter vehicles compared to locomotives or power cars.
    ]

	model "E5" {
		max-speed 320km/h
		weight 453.5t
@@ -38,12 +44,16 @@ Grammar in [ABNF]:
```abnf
config = *directive

directive = directive-name [ 1*WSP directive-params ] [ 1*WSP block ] newline
directive = directive-name [ 1*WSP directive-params ] [ 1*WSP directive-block ] newline
directive-name = word
directive-params = [ word ] / word 1*( 1*WSP word )
directive-block = block / multiline-string

block = "{" newline *directive "}"

multiline-string = "[" newline 1*( string-line newline ) "]"
string-line = *( **TBD** )

word = atom / dquote-word / squote-word
atom = 1*( ACHAR / esc-pair )
dquote-word = DQUOTE *( DQCHAR / esc-pair ) DQUOTE
--
2.28.0
Details
Message ID
<UFu09A3F4xjhhVsjEvsCFDngWuD4yRPRfeMScGEtaz03VjpCUhv6kl8PdyGtS03n_C1C4svybe4JA3t_OAFgQw8gFm5us0eZg3H8XiL1BJc=@emersion.fr>
In-Reply-To
<20201019165400.38320-1-hubert@hirtz.pm> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Both Caddy and POSIX sh just allow quoted strings to span over multiple
lines, so I was considering not adding any new syntax and simply remove
the restriction that quoted strings must be single-line. What do you
think?
Reply to thread Export thread (mbox)