Added Sieve parser code in master

This commit is contained in:
the-djmaze 2022-03-09 12:33:31 +01:00
parent e90e8a55ce
commit f4cd25f8ad
21 changed files with 2126 additions and 8 deletions

View file

@ -0,0 +1,38 @@
/**
* https://tools.ietf.org/html/rfc5183
*/
import {
GrammarQuotedString,
GrammarStringList,
GrammarTest
} from 'Sieve/Grammar';
export class EnvironmentCommand extends GrammarTest
{
constructor()
{
super();
this.name = new GrammarQuotedString;
this.key_list = new GrammarStringList;
}
get require() { return 'environment'; }
toString()
{
return 'environment'
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.name
+ ' ' + this.key_list.toString();
}
pushArguments(args)
{
this.name = args[args.length-2];
this.key_list = args[args.length-1];
}
}
//Sieve.Commands.environment = EnvironmentCommand;