浏览代码

* merged fix for bug #1229

peter 25 年之前
父节点
当前提交
bbe34f11f1
共有 3 个文件被更改,包括 29 次插入3 次删除
  1. 10 1
      compiler/i386/ra386att.pas
  2. 8 1
      compiler/i386/ra386int.pas
  3. 11 1
      compiler/scanner.pas

+ 10 - 1
compiler/i386/ra386att.pas

@@ -577,6 +577,7 @@ begin
 
        '''' : { char }
          begin
+           current_scanner^.in_asm_string:=true;
            actasmpattern:='';
            repeat
              c:=current_scanner^.asmgetchar;
@@ -584,6 +585,7 @@ begin
                '\' :
                  begin
                    { copy also the next char so \" is parsed correctly }
+                   actasmpattern:=actasmpattern+c;
                    c:=current_scanner^.asmgetchar;
                    actasmpattern:=actasmpattern+c;
                  end;
@@ -600,11 +602,13 @@ begin
            until false;
            actasmpattern:=EscapeToPascal(actasmpattern);
            actasmtoken:=AS_STRING;
+           current_scanner^.in_asm_string:=false;
            exit;
          end;
 
        '"' : { string }
          begin
+           current_scanner^.in_asm_string:=true;
            actasmpattern:='';
            repeat
              c:=current_scanner^.asmgetchar;
@@ -612,6 +616,7 @@ begin
                '\' :
                  begin
                    { copy also the next char so \" is parsed correctly }
+                   actasmpattern:=actasmpattern+c;
                    c:=current_scanner^.asmgetchar;
                    actasmpattern:=actasmpattern+c;
                  end;
@@ -628,6 +633,7 @@ begin
            until false;
            actasmpattern:=EscapeToPascal(actasmpattern);
            actasmtoken:=AS_STRING;
+           current_scanner^.in_asm_string:=false;
            exit;
          end;
 
@@ -2114,7 +2120,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  2000-11-29 00:30:50  florian
+  Revision 1.4  2000-11-30 20:27:51  peter
+    * merged fix for bug 1229
+
+  Revision 1.3  2000/11/29 00:30:50  florian
     * unused units removed from uses clause
     * some changes for widestrings
 

+ 8 - 1
compiler/i386/ra386int.pas

@@ -391,6 +391,7 @@ begin
        '''' : { string or character }
          begin
            actasmpattern:='';
+           current_scanner^.in_asm_string:=true;
            repeat
              if c = '''' then
               begin
@@ -432,12 +433,14 @@ begin
              else
               break; { end if }
            until false;
+           current_scanner^.in_asm_string:=false;
            actasmtoken:=AS_STRING;
            exit;
          end;
 
        '"' : { string or character }
          begin
+           current_scanner^.in_asm_string:=true;
            actasmpattern:='';
            repeat
              if c = '"' then
@@ -480,6 +483,7 @@ begin
              else
               break; { end if }
            until false;
+           current_scanner^.in_asm_string:=false;
            actasmtoken:=AS_STRING;
            exit;
          end;
@@ -1916,7 +1920,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  2000-11-29 00:30:51  florian
+  Revision 1.4  2000-11-30 20:27:51  peter
+    * merged fix for bug 1229
+
+  Revision 1.3  2000/11/29 00:30:51  florian
     * unused units removed from uses clause
     * some changes for widestrings
 

+ 11 - 1
compiler/scanner.pas

@@ -90,6 +90,7 @@ interface
           preprocstack   : ppreprocstack;
           invalid        : boolean; { flag if sourcefiles have been destroyed ! }
           macros         : pdictionary;
+          in_asm_string  : boolean;
 
           constructor init(const fn:string);
           destructor done;
@@ -326,6 +327,7 @@ implementation
         lastasmgetchar:=#0;
         ignoredirectives.init;
         invalid:=false;
+        in_asm_string:=false;
         new(macros,init);
       { load block }
         if not openinputfile then
@@ -1881,6 +1883,11 @@ exit_label:
           end
          else
           readchar;
+         if in_asm_string then
+           begin
+             asmgetchar:=c;
+             exit;
+           end;
          case c of
           '{' : begin
                   skipcomment;
@@ -1925,7 +1932,10 @@ exit_label:
 end.
 {
   $Log$
-  Revision 1.8  2000-11-29 00:30:40  florian
+  Revision 1.9  2000-11-30 20:27:51  peter
+    * merged fix for bug 1229
+
+  Revision 1.8  2000/11/29 00:30:40  florian
     * unused units removed from uses clause
     * some changes for widestrings