snappymail/dev/Sieve/Extensions/rfc5183.js

37 lines
616 B
JavaScript
Raw Normal View History

2022-03-09 19:33:31 +08:00
/**
* https://tools.ietf.org/html/rfc5183
*/
import {
GrammarQuotedString,
GrammarStringList,
TestCommand
2022-03-09 19:33:31 +08:00
} from 'Sieve/Grammar';
export class EnvironmentTest extends TestCommand
2022-03-09 19:33:31 +08:00
{
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
2022-03-16 21:21:23 +08:00
+ ' ' + this.key_list;
2022-03-09 19:33:31 +08:00
}
pushArguments(args)
{
2022-03-15 16:58:04 +08:00
this.key_list = args.pop();
this.name = args.pop();
2022-03-09 19:33:31 +08:00
}
}