[Doc-SIG] formalizing StructuredText

Edward D. Loper edloper@gradient.cis.upenn.edu
Sun, 25 Mar 2001 10:45:40 EST


> I don't see why.  The * doesn't have a magic meaning *unless* it appears
> at a word boundary with space or punctuator the other side of it.  So
> the * in x*y>z isn't magic.  Is it ?

Well, that's not quite the environment that Tibs was checking for..
According to the STpy regexps, you *just* need a space to the left/right
of the '*'.. so you can say * big * to mean *big*.  It might be that
we'd want to change that.  But there's an argument to be made for
having the environments in which emph can start/end be the same as
the environments that literal can start/end in.  So the question then
is whether we want to allow things like '  x  '.  And actually, thinking
about it now, I don't see why we would want to..  So maybe we *should*
change to your rules.. something like:

  \s 
  (?P<EM> [*]                           # open delimiter
          (?! [\s\n])                   # first char can't be sp
          [^*]*                         # contents
          [^*\s\n]                      # last char can't be sp
          [*])                          # close delimiter
           
Or some cleaner version of that..  (I used the '(?!' so you can
have emph regions with only 1 char in them.)

Another idea I've been toying with (in my more restricted version
of ST) is to *only* allow a *single* word to be emphasized.  If
you want to emphasize multiple words you have to *do* *it* *like*
*this*.  That seems much safer/more local/etc..  And I can't
think of the last time I tried to emphasize more than 2 words
at once anyway.  *It just looks weird, and is hard to read, if 
you try to emphasize a big region.*

-Edward