Added: rfc5233

Activate: comparator
Bugfix: StringList must use .toString()
Bugfix: redirect command
Bugfix: MultiLine
This commit is contained in:
djmaze 2021-01-15 16:09:03 +01:00
parent 3566f4a538
commit 73e26d388a
12 changed files with 86 additions and 50 deletions

View file

@ -20,10 +20,10 @@ class Body extends Grammar.Test
toString()
{
return 'body'
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.body_transform
+ ' ' + this.key_list;
+ ' ' + this.key_list.toString();
}
pushArguments(args)

View file

@ -20,10 +20,10 @@ class Environment extends Grammar.Test
toString()
{
return 'body'
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.name
+ ' ' + this.key_list;
+ ' ' + this.key_list.toString();
}
pushArguments(args)

View file

@ -55,9 +55,9 @@ class String extends Grammar.Test
{
return 'string'
+ ' ' + this.match_type
// + ' ' + this.comparator
+ ' ' + this.source
+ ' ' + this.key_list;
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.source.toString()
+ ' ' + this.key_list.toString();
}
pushArguments(args)

View file

@ -40,7 +40,7 @@ class Vacation extends Grammar.Command
result += ' :from ' + this.arguments[':from'];
}
if (this.addresses.length) {
result += ' :addresses ' + this.addresses;
result += ' :addresses ' + this.addresses.toString();
}
if (this.mime) {
result += ' :mime';

View file

@ -19,7 +19,7 @@ class Flag extends Grammar.Command
toString()
{
return this.identifier + ' ' + this._variablename + ' ' + this.list_of_flags + ';';
return this.identifier + ' ' + this._variablename + ' ' + this.list_of_flags.toString() + ';';
}
get variablename()
@ -86,9 +86,9 @@ class HasFlag extends Grammar.Test
{
return 'hasflag'
+ ' ' + this.match_type
// + ' ' + this.comparator
+ ' ' + this.variable_list
+ ' ' + this.list_of_flags;
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.variable_list.toString()
+ ' ' + this.list_of_flags.toString();
}
pushArguments(args)

View file

@ -16,14 +16,13 @@ class SpamTest extends Grammar.Test
}
// get require() { return this.percent ? 'spamtestplus' : 'spamtest'; }
// get require() { return /:value|:count/.test(this.match_type) ? 'relational' : ''; }
get require() { return 'spamtestplus'; }
get require() { return /:value|:count/.test(this.match_type) ? ['spamtestplus','relational'] : 'spamtestplus'; }
toString()
{
return 'spamtest'
+ (this.percent ? ' :percent' : '')
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.value;
}
@ -48,13 +47,12 @@ class VirusTest extends Grammar.Test
this.value = new Grammar.QuotedString; // 1 - 5
}
// get require() { return /:value|:count/.test(this.match_type) ? ['virustest','relational'] : 'virustest'; }
get require() { return 'virustest'; }
get require() { return /:value|:count/.test(this.match_type) ? ['virustest','relational'] : 'virustest'; }
toString()
{
return 'virustest'
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.value;
}

View file

@ -29,11 +29,11 @@ class DateTest extends Grammar.Test
return 'date'
+ (this.last ? ' :last' : (this.index.value ? ' :index ' + this.index : ''))
+ (this.originalzone ? ' :originalzone' : (this.zone.length ? ' :zone ' + this.zone : ''))
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.header_name
+ ' ' + this.date_part
+ ' ' + this.key_list;
+ ' ' + this.key_list.toString();
}
pushArguments(args)
@ -75,10 +75,10 @@ class CurrentDate extends Grammar.Test
{
return 'date'
+ (this.zone.length ? ' :zone ' + this.zone : '')
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.date_part
+ ' ' + this.key_list;
+ ' ' + this.key_list.toString();
}
pushArguments(args)

View file

@ -53,7 +53,7 @@ class DeleteHeader extends Grammar.Command
{
return this.identifier
+ (this.last ? ' :last' : (this.index.value ? ' :index ' + this.index : ''))
// + ' ' + this.comparator
+ (this.comparator ? ' :comparator ' + this.comparator : '')
+ ' ' + this.match_type
+ ' ' + this.field_name
+ ' ' + this.value_patterns + ';';