2
0
Эх сурвалжийг харах

compiler: better handling of '$','%','&' in macros

git-svn-id: trunk@25462 -
paul 12 жил өмнө
parent
commit
cac09f9df1
1 өөрчлөгдсөн 16 нэмэгдсэн , 11 устгасан
  1. 16 11
      compiler/scanner.pas

+ 16 - 11
compiler/scanner.pas

@@ -201,7 +201,6 @@ interface
           procedure readnumber;
           function  readid:string;
           function  readval:longint;
-          function  readval_asstring:string;
           function  readcomment:string;
           function  readquotedstring:string;
           function  readstate:char;
@@ -3834,13 +3833,6 @@ type
       end;
 
 
-    function tscannerfile.readval_asstring:string;
-      begin
-        readnumber;
-        readval_asstring:=pattern;
-      end;
-
-
     function tscannerfile.readcomment:string;
       var
         i : longint;
@@ -5102,10 +5094,23 @@ exit_label:
                  readpreproc:=_INTCONST;
                current_scanner.preproc_pattern:=pattern;
              end;
-           '$','%','&' :
+           '$','%':
              begin
-               current_scanner.preproc_pattern:=readval_asstring;
-               readpreproc:=_ID;
+               readnumber;
+               current_scanner.preproc_pattern:=pattern;
+               readpreproc:=_INTCONST;
+             end;
+           '&' :
+             begin
+                readnumber;
+                if length(pattern)=1 then
+                  begin
+                    readstring;
+                    readpreproc:=_ID;
+                  end
+                else
+                  readpreproc:=_INTCONST;
+               current_scanner.preproc_pattern:=pattern;
              end;
            '.' :
              begin