Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of "not" keyword fails #19

Open
tonioo opened this issue Mar 9, 2014 · 3 comments
Open

Handling of "not" keyword fails #19

tonioo opened this issue Mar 9, 2014 · 3 comments

Comments

@tonioo
Copy link
Owner

tonioo commented Mar 9, 2014

#!sieve

        if allof (
 not (
 header :contains ["To","Resent-to"] "[email protected]" ) ){
        discard;
                }

For all rules containing the not keyword this parsing error occurs:
parsing error: left_parenthesis found while identifier expected near '
'


@tonioo
Copy link
Owner Author

tonioo commented Mar 9, 2014

I use the following to fixup the sieve rule, then it parses correctly

#!python
re.sub(r'not \((.*?)\)', r'not \1', sieverule, flags=re.DOTALL)


Original Comment By: Daniël van Eeden

@tonioo
Copy link
Owner Author

tonioo commented Mar 9, 2014

It seems that Sun/Oracle is not following the RFC here.

Oracle/Sun:

#!sieve

        if allof (
 not (
 header :contains ["To","Resent-to"] "[email protected]" ) ){
        discard;
                }

RFC:

#!sieve

        if allof (
 not 
 header :contains ["To","Resent-to"] "[email protected]"  ){
        discard;
                }

Original Comment By: Daniël van Eeden

@tonioo
Copy link
Owner Author

tonioo commented Mar 9, 2014

It seems to work if I cahnge NotCommand to this:

#!python
class NotCommand(TestCommand):
    accept_children = True
    variable_args_nb = True

    args_definition = [
        {"name": "tests",
         "type": ["testlist"],
         "required": True}
    ]

    def get_expected_first(self):
        return ["left_parenthesis"]



Original Comment By: Daniël van Eeden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant