mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
drop sieve parser from sievescripts branch
This commit is contained in:
parent
2024088ea0
commit
ca91a6e408
18 changed files with 1 additions and 2138 deletions
|
|
@ -1,63 +0,0 @@
|
|||
/**
|
||||
* https://tools.ietf.org/html/rfc6609
|
||||
*/
|
||||
|
||||
(Sieve => {
|
||||
|
||||
const Grammar = Sieve.Grammar;
|
||||
|
||||
class Include extends Grammar.Command
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
super('include');
|
||||
this.global = false; // ':personal' / ':global';
|
||||
this.once = false;
|
||||
this.optional = false;
|
||||
this.value = new Grammar.QuotedString;
|
||||
}
|
||||
|
||||
get require() { return 'include'; }
|
||||
|
||||
toString()
|
||||
{
|
||||
return this.identifier
|
||||
+ (this.global ? ' :global' : '')
|
||||
+ (this.once ? ' :once' : '')
|
||||
+ (this.optional ? ' :optional' : '')
|
||||
+ ' ' + this.value + ';';
|
||||
}
|
||||
|
||||
pushArguments(args)
|
||||
{
|
||||
args.forEach(arg => {
|
||||
if (':global' === arg || ':once' === arg || ':optional' === arg) {
|
||||
this[arg.substr(1)] = true;
|
||||
} else if (arg instanceof Grammar.QuotedString) {
|
||||
this.value = arg;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class Return extends Grammar.Command
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
super('return');
|
||||
}
|
||||
|
||||
get require() { return 'include'; }
|
||||
|
||||
toString()
|
||||
{
|
||||
return 'return;';
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(Sieve.Commands, {
|
||||
include: Include,
|
||||
return: Return
|
||||
});
|
||||
|
||||
})(this.Sieve);
|
||||
Loading…
Add table
Add a link
Reference in a new issue