X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCC.lex;h=0fc43d00445ed1bd3f5881bb047b091f04423282;hb=bb226788dab3832b0ec0cda70874ce3fce4eebc6;hp=6567003c575dfd329e9cfdadf1736369e48975de;hpb=d5a894fa00d4da47d6f7110282dd16e49d872350;p=fw%2Fsdcc diff --git a/src/SDCC.lex b/src/SDCC.lex index 6567003c..0fc43d00 100644 --- a/src/SDCC.lex +++ b/src/SDCC.lex @@ -22,6 +22,7 @@ what you give them. Help stamp out software-hoarding! -------------------------------------------------------------------------*/ +B [0-1] D [0-9] L [a-zA-Z_$] H [a-fA-F0-9] @@ -199,6 +200,15 @@ _?"_asm" { count(); return(check_type()); } +0[bB]{B}+{IS}? { + if (!options.std_sdcc) + { + yyerror("binary (0b) constants are not allowed in ISO C"); + } + count(); + yylval.val = constVal(yytext); + return(CONSTANT); +} 0[xX]{H}+{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); } 0[0-7]*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); } [1-9]{D}*{IS}? { count(); yylval.val = constVal(yytext); return(CONSTANT); }