I can see wanting more control at the parse tree level. Maybe have two API's on the Node or AST class, one that returns the raw text and another that returns the unescaped version? By the time that the value gets returned as an Argument, I would expect that the escaping has been stripped out.
I filed JSIEVE-57 for the parsing bug. Thanks again, Boris ----- "Robert Burrell Donkin" <[email protected]> wrote: > On Wed, Jul 1, 2009 at 10:49 PM, Boris Burtin<[email protected]> > wrote: > > I'm having some trouble with dot-stuffing in a multi-line form. When > I try to parse the script below, I get a syntax exception on the line > that starts with "..": > > > > org.apache.jsieve.parser.generated.TokenMgrError: Lexical error at > line 8, column 1. Encountered: "." (46), after : "" > > > > require ["fileinto", "reject", "tag", "flag"]; > > > > # reply filter > > if anyof (header :contains "subject" "reply") { > > reply ["[email protected]", "[email protected]"] > "text:" > > This is the first line > > This is the second line > > ..This is a line that begins with a dot > > And here's a dot by itself: > > .. > > The end > > . > > ; > > stop; > > } > > > > Is my syntax wrong, or did I stumble onto a parsing bug? > > at first glance, it looks like a parser bug to me :-/ > > but i need to spend some more time before i'm sure... > > > Another issue I ran into is that when parsing doesn't fail, the > argument I get back has the initial CRLF and the trailing ". > > CRLF". Seems like the parser should return the unescaped content, > instead of expecting the application code to > > handle the unescaping. > > i find that this is always a tricky call: a small minority of > application may require the raw text but most users want a friendly > transparent API to hide these details. certainly, access to the > unescaped should be easy for applications. i'm tempted just to > provide > unescaped text from the current call. > > opinions? > > - robert > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
