Re: sievec: Misleading error message

2023-08-25 Thread Markus Schönhaber

25.08.23, 13:06 +0200, Robert Nowotny via dovecot:


I would say "elsif" itself is a typo - in most languages it is "elseif".
in that case both versions should be valid keywords - the current (but 
unusual) "elsif"

and the more common "elseif"


You are obviously entitled to your opinion, but what matters wrt to the 
language syntax is the language specification. And the relevant RFC 
specifies[1] the control if as if ... elsif ... else, regardless if one 
likes that or not.

[1] https://www.rfc-editor.org/rfc/rfc5228.html#section-3.1

So, I concur with Horst that there's a typo in the error message that 
should be corrected.

(trivial patch attached)


Am 25.08.2023 um 12:38 schrieb Horst Prote:

Hi,

in a sieve script I just made a syntax error and got this error 
message on

calling sievec:

   error: the else command must follow an if or elseif command.

My first thougth was "Are you kidding me!" as I used "elseif". But then I
realized that the correct syntax is "elsif". So I think that error 
message

should be corrected to

   error: the else command must follow an if or elsif command.


--
Regards
  mks
diff --git a/src/lib-sieve/cmd-if.c b/src/lib-sieve/cmd-if.c
index 2ae186e3..bd6b5a05 100644
--- a/src/lib-sieve/cmd-if.c
+++ b/src/lib-sieve/cmd-if.c
@@ -148,7 +148,7 @@ static bool cmd_elsif_validate
 		( !sieve_command_is(prev, cmd_if) && !sieve_command_is(prev, cmd_elsif) ) )
 	{
 		sieve_command_validate_error(valdtr, cmd,
-			"the %s command must follow an if or elseif command",
+			"the %s command must follow an if or elsif command",
 			sieve_command_identifier(cmd));
 		return FALSE;
 	}
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: sievec: Misleading error message

2023-08-25 Thread Robert Nowotny via dovecot

I would say "elsif" itself is a typo - in most languages it is "elseif".
in that case both versions should be valid keywords - the current (but 
unusual) "elsif"

and the more common "elseif"

this would not introduce downsides but makes programmers life a bit more 
easy.


Am 25.08.2023 um 12:38 schrieb Horst Prote:

Hi,

in a sieve script I just made a syntax error and got this error message on
calling sievec:

   error: the else command must follow an if or elseif command.

My first thougth was "Are you kidding me!" as I used "elseif". But then I
realized that the correct syntax is "elsif". So I think that error message
should be corrected to

   error: the else command must follow an if or elsif command.

Thanks,
Horst
___
dovecot mailing list --dovecot@dovecot.org
To unsubscribe send an email todovecot-le...@dovecot.org


smime.p7s
Description: S/MIME Cryptographic Signature
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org