Browse Source

+ support of octal literals

florian 2 years ago
parent
commit
5691f2a2c0
2 changed files with 10 additions and 0 deletions
  1. 5 0
      utils/h2pas/scan.l
  2. 5 0
      utils/h2pas/scan.pas

+ 5 - 0
utils/h2pas/scan.l

@@ -619,6 +619,11 @@ D [0-9]
                           skip_until_eol;
 {D}+[Uu]?[Ll]?[Ll]?     if NotInCPlusBlock then
                         begin
+                           if yytext[1]='0' then
+                             begin
+                                delete(yytext,1,1);
+                                yytext:='&'+yytext;
+                             end;
                            while yytext[length(yytext)] in ['L','U','l','u'] do
                              Delete(yytext,length(yytext),1);
                            return(NUMBER);

+ 5 - 0
utils/h2pas/scan.pas

@@ -634,6 +634,11 @@ begin
   7:
                         if NotInCPlusBlock then
                         begin
+                           if yytext[1]='0' then
+                             begin
+                                delete(yytext,1,1);
+                                yytext:='&'+yytext;
+                             end;
                            while yytext[length(yytext)] in ['L','U','l','u'] do
                              Delete(yytext,length(yytext),1);
                            return(NUMBER);