Excerpts from Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum's message of 2014-05-19 11:45:02 +0200:
Let's start with presenting the problem, then we can discuss if the solution is correct.
heh, of course:
without the patch: Pike v8.0 release 1 running Hilfe v3.5 (Incremental Pike Frontend)
string s ="das"; switch( s ) { case "das": write("gut");};
Compiler Error: 1: switch is a reserved word. Compiler Error: 1: syntax error, unexpected '(' Compiler Error: 1: syntax error, unexpected '}' Compiler Error: 1: Missing ';'.
dump wrapper
Last compiled wrapper: 001: mapping(string:mixed) ___hilfe = ___Hilfe->variables; 002: # 1 003: mixed ___HilfeWrapper() { return switch( (([mapping(string:string)](mixed)___hilfe)->s) ) { case "das": write("gut");} ; } 004:
with the patch: Pike v8.0 release 1 running Hilfe v3.5 (Incremental Pike Frontend)
string s ="das"; switch( s ) { case "das": write("gut");};
gutOk.
dump wrapper
Last compiled wrapper: 001: mapping(string:mixed) ___hilfe = ___Hilfe->variables; 002: # 1 003: mixed ___HilfeWrapper() { switch( (([mapping(string:string)](mixed)___hilfe)->s) ) { case "das": write("gut");} ; } 004:
greetings, martin.