Commit 1f1d0b41 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed port.setencode rule to allow subreferences



Change-Id: If311080c40a9c740ee8c53b4982e11fb8d6d66b1
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 762a1110
...@@ -619,7 +619,7 @@ oct2str RETURN(oct2strKeyword); ...@@ -619,7 +619,7 @@ oct2str RETURN(oct2strKeyword);
regexp RETURN(regexpKeyword); regexp RETURN(regexpKeyword);
replace RETURN(replaceKeyword); replace RETURN(replaceKeyword);
rnd RETURN(rndKeyword); rnd RETURN(rndKeyword);
setencode RETURN(setencodeKeyword); setencode RETURN_DOT(SetencodeKeyword);
sizeof RETURN(sizeofKeyword); sizeof RETURN(sizeofKeyword);
str2bit RETURN(str2bitKeyword); str2bit RETURN(str2bitKeyword);
str2float RETURN(str2floatKeyword); str2float RETURN(str2floatKeyword);
......
...@@ -846,6 +846,7 @@ static const string anyname("anytype"); ...@@ -846,6 +846,7 @@ static const string anyname("anytype");
%token DotStopKeyword %token DotStopKeyword
%token DotTimeoutKeyword %token DotTimeoutKeyword
%token DotTriggerOpKeyword %token DotTriggerOpKeyword
%token DotSetencodeKeyword
/* Predefined function identifiers */ /* Predefined function identifiers */
...@@ -889,7 +890,7 @@ static const string anyname("anytype"); ...@@ -889,7 +890,7 @@ static const string anyname("anytype");
%token replaceKeyword %token replaceKeyword
%token rndKeyword %token rndKeyword
%token testcasenameKeyword %token testcasenameKeyword
%token setencodeKeyword %token SetencodeKeyword
%token sizeofKeyword %token sizeofKeyword
%token str2floatKeyword %token str2floatKeyword
%token str2intKeyword %token str2intKeyword
...@@ -8992,32 +8993,37 @@ SetstateStatement: ...@@ -8992,32 +8993,37 @@ SetstateStatement:
} }
SetencodeStatement: SetencodeStatement:
IDentifier '.' setencodeKeyword '(' Type ',' SingleExpression ')' Reference DotSetencodeKeyword '(' Type ',' SingleExpression ')'
{ {
delete $1; if ($1.is_ref) {
delete $5; delete $1.ref;
delete $7; }
else {
delete $1.id;
}
delete $4;
delete $6;
Location loc(infile, @$); Location loc(infile, @$);
loc.error("'Port.setencode' is not currently supported."); loc.error("'<port>.setencode' is not currently supported.");
$$ = new Statement(Statement::S_ERROR); $$ = new Statement(Statement::S_ERROR);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
| AllKeyword PortKeyword '.' setencodeKeyword '(' Type ',' SingleExpression ')' | AllKeyword PortKeyword DotSetencodeKeyword '(' Type ',' SingleExpression ')'
{ {
delete $6; delete $5;
delete $8; delete $7;
Location loc(infile, @$); Location loc(infile, @$);
loc.error("'all port.setencode' is not currently supported."); loc.error("'all port.setencode' is not currently supported.");
$$ = new Statement(Statement::S_ERROR); $$ = new Statement(Statement::S_ERROR);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
| SelfKeyword '.' setencodeKeyword '(' Type ',' SingleExpression ')' | SelfKeyword DotSetencodeKeyword '(' Type ',' SingleExpression ')'
{ {
if (legacy_codec_handling) { if (legacy_codec_handling) {
Location loc(infile, @$); Location loc(infile, @$);
loc.error("'setencode' is not allowed when using legacy codec handling"); loc.error("'setencode' is not allowed when using legacy codec handling");
} }
$$ = new Statement(Statement::S_SETENCODE, $5, $7); $$ = new Statement(Statement::S_SETENCODE, $4, $6);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
; ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment