Re: NASL2: precedence of 'logical NOT'
Joe Francis <[email protected]>
| Newsgroups | gmane.comp.security.nessus.devel |
|---|---|
| Message-ID | <1045406780.1613.3.camel@hightower> |
I vote for the last interpretation. It seems to be the most explicit and clear, and probably will lead to the least confusion when trying to figure out larger expressions. I can see where either the current or the first choice below could lead to some expressions that are very hard to figure out. Myself, I'll just stick with lots of parenthesis, as that always seems the safe way. Joe On Sun, 2003-02-16 at 14:27, Michel Arboi wrote: > First I forgot to put '!' in the list of %prec instruction. > Then I added it, but probably in the wrong place. > _Currently_, things like ! x == y are parsed as (!x) == y, which is > wrong IMHO. It should be ! (x == y) > > Worse "! x >< y" is parsed as "(!x) >< y" which is absurd. > > So, the priority of NOT should be set _below_ the priority of the > compare operators. > Where exactly? Below AND and OR? Or not? > i.e. "! x && y" = "! (x && y)" or "(!x) && y" ? > I vote for the 2nd interpretation. >