Browse Source

* Better fix for case sensitive macro handling

daniel 21 years ago
parent
commit
d47da881ed
1 changed files with 8 additions and 5 deletions
  1. 8 5
      compiler/scanner.pas

+ 8 - 5
compiler/scanner.pas

@@ -334,8 +334,8 @@ implementation
           mac : tmacro;
           mac : tmacro;
           len : integer;
           len : integer;
         begin
         begin
-          hs := current_scanner.preproc_pattern;
-          mac:=tmacro(current_scanner.macros.search(hs));
+          readpreproc := current_scanner.preproc_pattern;
+          mac:=tmacro(current_scanner.macros.search(readpreproc));
           if assigned(mac) then
           if assigned(mac) then
           begin
           begin
             if mac.defined and assigned(mac.buftext) then
             if mac.defined and assigned(mac.buftext) then
@@ -349,9 +349,9 @@ implementation
                 len:=mac.buflen;
                 len:=mac.buflen;
               hs[0]:=char(len);
               hs[0]:=char(len);
               move(mac.buftext^,hs[1],len);
               move(mac.buftext^,hs[1],len);
+              readpreproc:=upcase(hs);
             end;
             end;
           end;
           end;
-          readpreproc := hs;
         end;
         end;
 
 
         function read_factor : string;
         function read_factor : string;
@@ -625,7 +625,7 @@ implementation
                            #26 :
                            #26 :
                              current_scanner.end_of_file;
                              current_scanner.end_of_file;
                          end;
                          end;
-                         macrobuffer^[macropos]:=upcase(c);
+                         macrobuffer^[macropos]:=c;
                          inc(macropos);
                          inc(macropos);
                          if macropos>maxmacrolen then
                          if macropos>maxmacrolen then
                           Message(scan_f_macro_buffer_overflow);
                           Message(scan_f_macro_buffer_overflow);
@@ -2916,7 +2916,10 @@ exit_label:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.68  2004-02-11 14:13:10  daniel
+  Revision 1.69  2004-02-11 14:46:59  daniel
+    * Better fix for case sensitive macro handling
+
+  Revision 1.68  2004/02/11 14:13:10  daniel
     * Compiler was partially case sensitive in macro expansion
     * Compiler was partially case sensitive in macro expansion
     * Multiple and/or preprocessor statements caused problems
     * Multiple and/or preprocessor statements caused problems