[Doc-SIG] formalizing StructuredText: issues

Tony J Ibbs (Tibs) tony@lsl.co.uk
Wed, 14 Mar 2001 11:02:36 -0000

Edward D. Loper wrote:
> 2 issues have come up recently in my attempts at formalizing ST:
>   1. what is the most elegant way to capture indentation constraints?
>      EBNF+la can't do it very well.  This is important when I try to
>      write productions for literal blocks (ones preceeded by '::'),
>      since where they end depends on indentation.  Perhaps use rules
>      like::
>        literal_block = (?P<indent> S+) line NL ((?P=indent)
> S+ line NL)+
>      ?

Erm - that requires thinking too hard for me to answer at the moment, so
I'll avoid it.

>   2. Is there an elegant way to let people say things like
> 'TestSet's for
>      the plural of 'TestSet' (instead of 'TestSets')?  Currently,
>      the second "'" in 'TestSet's would be ignored, as it
> would be with
>      what's or it's.  This isn't a problem if we use '#': #TestSet#s.
>      But I could see it confusing people..

If I understand you correctly, you want to be able to type::


and have it work as if you had a literal "Word" followed by non-literal
text, without any intervening space. So as a general case, the answer is
"no" (as you might expect when it is explained like that).

Now, if one narrows it down to "non-literal text which is constrained to
be a single lower case 's'", then of course it would be possible to do,
but I would worry that it is getting a bit overcomplex. On the other
hand, it may well be a useful thing to do.

I would avoid it for now, and consider it as an enhancement for later
(btw, I would also ask the same question on the ZWiki, to see what they
say - I'd probably be heavily influenced by their reply).

(oh - and STpy shouldn't "ignore" the second apostrophe, it should
decide that the whole thing doesn't contain a literal string - the
literal string can't continue past the second apostrophe since they're
not allowed inside literal strings).


Tony J Ibbs (Tibs)      http://www.tibsnjoan.co.uk/
Give a pedant an inch and they'll take 25.4mm
(once they've established you're talking a post-1959 inch, of course)
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)