On 2/14/06, Luke Palmer <[EMAIL PROTECTED]> wrote: > On 2/14/06, David Romano <[EMAIL PROTECTED]> wrote: > > I don't want to just skip <B> tags wholly, because they do serve a purpose, > > but only in a particular context. (Can <?ws> be changed back to a "default" > > if > > changed to include html tags?) > > Brackets serve as a kind of scoping for modifiers. We're also > considering that :ws take an argument telling it what to consider to > be whitespeace. So you could do: > > rule Month :w { > [ :w(&my_ws) J a n ] # not sure about the & > # out here we still have the default :w > } Ahh, okay. So am I to understand that my_ws would just return a set of individual characters or character sequences that would be considered whitespace? Or would my_ws do something else?
> > Would something like below be easier to decode for a human reader? > > text:without(<date>) { > > ^ [.*] $ > > } > > Well, if you could define exactly what it means, then perhaps. Does > that mean that date appears nowhere within the matched text, or that > it just doesn't appear at the beginning. In either case, you can make > these rules grammar friendly by including your test at the end: > > rule text_no_date { > (.*) > { $1 !~ /<date>/ } > } This is what I was thinking: nowhere within the matched text...hadn't thought about the closure at the end. > > If that adverb were available, then I could have a rule that doesn't include > > two other rules: > > line:without(<date>&&<name>) { > > ^^ [.*] $$ > > } > > > > > > The rule above would match a line with a <date> or <name>, but not a line > > with > > both. > > Huh. That kind of test really wants a closure. You can't use the > regex & because that requires that they match at the same place. You > can't use the logical &&, because <date> isn't an expression. Of > course, that is unless you include your own parsing rule, but that > isn't recommended. I see. I guess I initally thought that it would be nice to have important information like exclusions at the beginning, rather than at the end, of a rule. Thanks again for the explanations and pointers. David