Skip to content

Commit

Permalink
Fix possible future breakage when Bison might drop adding ; automatic…
Browse files Browse the repository at this point in the history
…ally to the

action codes.

datalang.y:*: warning: a ';' might be needed at the end of action code
datalang.y:*:     future versions of Bison will not add the ';'

Signed-off-by: Marko Saukko <marko.saukko@jollamobile.com>
  • Loading branch information
Marko Saukko committed May 6, 2013
1 parent 2e44895 commit 53b95aa
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/datalang.y
Expand Up @@ -51,22 +51,22 @@ void iodata_error(YYLTYPE* locp, iodata::parser* context, const char* format, ..

%%

config : record '.' { context->tree = $1 }
config : record '.' { context->tree = $1; }
;

item : '{' record '}' { $$=$2 }
| '[' array ']' { $$=$2 }
| '[' ']' { $$=new iodata::array }
| integer { $$=$1 }
| bitmask { $$=$1 }
| bytes { $$=$1 }
item : '{' record '}' { $$=$2; }
| '[' array ']' { $$=$2; }
| '[' ']' { $$=new iodata::array; }
| integer { $$=$1; }
| bitmask { $$=$1; }
| bytes { $$=$1; }
;

record : { $$ = new iodata::record }
| record_ { $$=$1 }
record : { $$ = new iodata::record; }
| record_ { $$=$1; }
;

record_ : TIDENT '=' item { ($$=new iodata::record)->add(*$1,$3) ; delete $1 }
record_ : TIDENT '=' item { ($$=new iodata::record)->add(*$1,$3) ; delete $1; }
| TIDENT '=' item ',' record_ {
if ($5->key_present(*$1))
{
Expand All @@ -84,26 +84,26 @@ record_ : TIDENT '=' item { ($$=new iodata::record)->add(*$1,$3) ; delete $1 }
}
;

array : item { ($$=new iodata::array)->add($1) }
| array ',' item { ($$=$1)->add($3) }
array : item { ($$=new iodata::array)->add($1); }
| array ',' item { ($$=$1)->add($3); }
;

integer : TPOSITIVE { $$=new iodata::integer(iodata::integer_t($1)) } ;
integer : TPOSITIVE { $$=new iodata::integer(iodata::integer_t($1)); } ;

integer : TSIGNED { $$=new iodata::integer($1) } ;
integer : TSIGNED { $$=new iodata::integer($1); } ;

ibits : '$' TPOSITIVE { $$ = $2 } ;
ibits : '$' TPOSITIVE { $$ = $2; } ;

sbits : TDOLLAR { $$ = $1 } ;
sbits : TDOLLAR { $$ = $1; } ;

bitmask : ibits { ($$=new iodata::bitmask)->add($1) }
| sbits { ($$=new iodata::bitmask)->add(*$1) ; delete $1 }
| bitmask '|' ibits { ($$=$1)->add($3) }
| bitmask '|' sbits { ($$=$1)->add(*$3) ; delete $3 }
bitmask : ibits { ($$=new iodata::bitmask)->add($1); }
| sbits { ($$=new iodata::bitmask)->add(*$1) ; delete $1; }
| bitmask '|' ibits { ($$=$1)->add($3); }
| bitmask '|' sbits { ($$=$1)->add(*$3) ; delete $3; }
;

bytes : TSTRING { $$=new iodata::bytes(*$1) ; delete $1 }
| bytes '+' TSTRING { ($$=$1)->x += *$3 ; delete $3 }
bytes : TSTRING { $$=new iodata::bytes(*$1) ; delete $1; }
| bytes '+' TSTRING { ($$=$1)->x += *$3 ; delete $3; }
;


Expand Down

0 comments on commit 53b95aa

Please sign in to comment.