ietf-mta-filters
[Top] [All Lists]

Re: Sieve Readability Suggestions

1997-04-30 10:18:14
Ned Freed <Ned(_dot_)Freed(_at_)innosoft(_dot_)com> writes:
I finally figured out why I dislike the use of SMTP-style message text: It is
because it makes the grammar context-sensitive: "message" (or "text:") has to
kick the lexer into a special state. I think this is fairly problematic
behavior at best. What happens when we want to extend the language by adding
some other construct that requires message text as an argument.

  The grammar's still regular - when the lexer sees a "message" or
"text:" token, it switches states until it sees the end of the
SMTP-style message text; this is well within the capabilities of a
DFA.

  (By the same argument, you're against "'s, yes?  Because when a
lexer sees a " mark, it must enter a special state in which characters
are processed until a closing unescaped "... this is really no
different.)

I think we really need to bite the bullet here and go back to some sort of
consistent quoting scheme. I'd recommend using C style string constants,
possibly with the extension of alloing a string to cross line boundaries.

  The problem with multiline strings is that either you wind up with
lots of backslashes at the ends of lines (which're a pain to keep
consistant when one reworks one's linebreaks), or you create a
situation in which there really isn't anything to keep a dropped
end-of-string character from causing your string to chew up far more
data than it really should, causing syntax errors far removed from the
source of the problem.

  I don't think we want lots of backslashes, and I think that a . on a
line by itself stands out much better than a " marks; much as I hate
special casing lexers, I think it's better to have two ways to quote
strings.

  (OTOH, with any non-backslash mechanism, you run the risk that it'll
still parse, potentially mailing pieces of your script and automated
responses to people who really shouldn't see it...)

  )Rob