mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Improved Sieve Script editor with lists of available Actions, Controls and Tests
This commit is contained in:
parent
ff9a89380c
commit
f47eb61aee
14 changed files with 269 additions and 164 deletions
|
|
@ -3,11 +3,12 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
GrammarCommand,
|
||||
GrammarQuotedString
|
||||
ControlCommand,
|
||||
GrammarQuotedString,
|
||||
GrammarStringList
|
||||
} from 'Sieve/Grammar';
|
||||
|
||||
export class IncludeCommand extends GrammarCommand
|
||||
export class IncludeCommand extends ControlCommand
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ export class IncludeCommand extends GrammarCommand
|
|||
|
||||
toString()
|
||||
{
|
||||
return this.identifier
|
||||
return 'include'
|
||||
+ (this.global ? ' :global' : '')
|
||||
+ (this.once ? ' :once' : '')
|
||||
+ (this.optional ? ' :optional' : '')
|
||||
|
|
@ -41,7 +42,28 @@ export class IncludeCommand extends GrammarCommand
|
|||
}
|
||||
}
|
||||
|
||||
export class ReturnCommand extends GrammarCommand
|
||||
export class ReturnCommand extends ControlCommand
|
||||
{
|
||||
get require() { return 'include'; }
|
||||
}
|
||||
|
||||
export class GlobalCommand extends ControlCommand
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
this.value = new GrammarStringList;
|
||||
}
|
||||
|
||||
get require() { return ['include', 'variables']; }
|
||||
|
||||
toString()
|
||||
{
|
||||
return 'global ' + this.value + ';';
|
||||
}
|
||||
|
||||
pushArguments(args)
|
||||
{
|
||||
this.value = args.pop();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue