mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Improve sieve parser
This commit is contained in:
parent
0a3a5f6d59
commit
c773b852a1
11 changed files with 124 additions and 106 deletions
|
|
@ -154,12 +154,10 @@ export const parseScript = (script, name = 'script.sieve') => {
|
|||
pushArgs();
|
||||
value = value.toLowerCase();
|
||||
let new_command;
|
||||
if ('if' === value) {
|
||||
new_command = new ConditionalCommand(value);
|
||||
} else if ('elsif' === value || 'else' === value) {
|
||||
// (prev_command instanceof ConditionalCommand) || error('Not after IF condition');
|
||||
new_command = new ConditionalCommand(value);
|
||||
} else if (Commands[value]) {
|
||||
if (Commands[value]) {
|
||||
if ('elsif' === value || 'else' === value) {
|
||||
// (prev_command instanceof ConditionalCommand) || error('Not after IF condition');
|
||||
}
|
||||
if ('allof' === value || 'anyof' === value) {
|
||||
// (command instanceof ConditionalCommand || command instanceof NotTest) || error('Test-list not in conditional');
|
||||
}
|
||||
|
|
@ -293,5 +291,6 @@ export const parseScript = (script, name = 'script.sieve') => {
|
|||
}
|
||||
|
||||
tree.requires = requires;
|
||||
tree.toString = () => tree.join('\r\n');
|
||||
return tree;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue