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

* Compiler directives {$...} are allowed in ARM inline assembler. It fixes tb0142.pp and tb0193.pp.

git-svn-id: trunk@5664 -
yury 18 жил өмнө
parent
commit
4092321ae9
2 өөрчлөгдсөн 15 нэмэгдсэн , 14 устгасан
  1. 1 11
      compiler/raatt.pas
  2. 14 3
      compiler/scanner.pas

+ 1 - 11
compiler/raatt.pas

@@ -189,20 +189,10 @@ unit raatt;
         while c in [' ',#9] do
          c:=current_scanner.asmgetchar;
         { get token pos }
-{$ifdef arm}
-        if not (c in [#10,#13,';']) then
-          current_scanner.gettokenpos;
-{$else arm}
         if not (c in [#10,#13,'{',';']) then
           current_scanner.gettokenpos;
-{$endif arm}
-
         { Local Label, Label, Directive, Prefix or Opcode }
-{$ifdef arm}
-        if firsttoken and not(c in [#10,#13,';']) then
-{$else arm}
         if firsttoken and not(c in [#10,#13,'{',';']) then
-{$endif arm}
          begin
            firsttoken:=FALSE;
            len:=0;
@@ -610,7 +600,7 @@ unit raatt;
                  c:=current_scanner.asmgetchar;
                  exit;
                end;
-
+               
              '}' :
                begin
                  actasmtoken:=AS_RSBRACKET;

+ 14 - 3
compiler/scanner.pas

@@ -3933,12 +3933,23 @@ exit_label:
            end;
          repeat
            case c of
-{$ifndef arm}
              // the { ... } is used in ARM assembler to define register sets,  so we can't used
-             // it as comment, either (* ... *), /* ... */ or // ... should be used instead
+             // it as comment, either (* ... *), /* ... */ or // ... should be used instead.
+             // But compiler directives {$...} are allowed in ARM assembler.
              '{' :
-               skipcomment;
+               begin
+{$ifdef arm}
+                 readchar;
+                 dec(inputpointer);
+                 if c<>'$' then
+                   begin
+                     asmgetchar:='{';
+                     exit;
+                   end
+                 else
 {$endif arm}
+                   skipcomment;
+               end;
              #10,#13 :
                begin
                  linebreak;