From: Oren Ben-K. <or...@ri...> - 2002-09-28 07:22:31
|
Brian Ingerson [mailto:in...@tt...] wrote: > > | Really all I want to do is have the indentation reflect > > the nesting. > > | So: > > | > > | --- > > | a: # indent level: 0 > > | b: # indent level: 2 > > | - c # indent level: 3 > > | - d: e # indent level: 3 (seq), 4 (map) > > | f: g # indent level: 4 > > | - h # indent level: 3 > > > > This makes sense. Map-in-seq is a special case anyway... > > Let's call this STATE 3. > > +1 It really is state 1. > I think Why is on target. This needs to be valid: > > --- > - a: map > foo: bar > - another: map > foo: bar I think it is better to focus in this example and forget about the philosophical "indent vs. nest" issue. When Why first suggested this he said it would probably never be used. You suggest a use case where it might come up: > It may have been derived from the following in an editor: So. Two choices: - If we agree that the above example should be valid, we go with state 1; we use the convention that the '-' is part of the indentation but also ends it. That explains state 1 pretty well. The original wording I gave was: The '-' sequence entry indicator is considered to be part of the indentation, as this seems the way people tend to interpret it. Hence this indicator may be not indented relative to its parent node. However, it must be more indented if this parent node is a block sequence entry. This requires some productions to carry two indentation values - one for all nodes and one for block sequence nodes. We'd have to change it to something like: The '-' sequence entry indicator is considered to be part of the indentation, as this seems the way people tend to interpret it. Hence this indicator itself may be not indented relative to its parent node. Note that spaces following this indicator are not taken to be part of the indentation except for in one special case (<a>map_in_seq</a>). - If we say that the above example is not valid we go with state 2. The wording would have to change to: The '-' sequence entry indicator and any following spaces are considered to be part of the indentation, as this seems the way people tend to interpret it. Hence this indicator may be not indented relative to its parent node. However, all '-' indicators must be indented to the same level within the same sequence. This requires some productions to carry two indentation values, one for the '-' and one for the entry itself. Either way I'll have to change the productions to reflect the chosen exact semantics. Brian and Why like state 1. I like state 2 better. But I don't feel that strongly about it. I don't know what Clark's position is. If he agrees with Brian and Why, state 1 it is. Otherwise I guess we'll need to discuss this some more. Clark? Have fun, Oren Ben-Kiki |