2022-03-09 19:33:31 +08:00
|
|
|
/**
|
|
|
|
* https://tools.ietf.org/html/rfc5183
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {
|
|
|
|
GrammarQuotedString,
|
|
|
|
GrammarStringList,
|
2022-03-17 16:03:02 +08:00
|
|
|
TestCommand
|
2022-03-09 19:33:31 +08:00
|
|
|
} from 'Sieve/Grammar';
|
|
|
|
|
2022-03-17 16:03:02 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|