+ for TP7 compatibility, allow the '&', '$' and '?' characters in the x86 intel

syntax inline asm reader

git-svn-id: trunk@38167 -
This commit is contained in:
nickysn 2018-02-08 16:54:33 +00:00
parent 1709fa61a4
commit 391f85f828
3 changed files with 28 additions and 2 deletions

1
.gitattributes vendored
View File

@ -13641,6 +13641,7 @@ tests/test/tudots.dot.prog.pp svneol=native#text/pascal
tests/test/tudots.pp svneol=native#text/pascal
tests/test/tudots.prog.pp svneol=native#text/pascal
tests/test/tudots.test.pp svneol=native#text/pascal
tests/test/tuglylabels1.pp svneol=native#text/plain
tests/test/tunaligned1.pp svneol=native#text/plain
tests/test/tunistr1.pp svneol=native#text/plain
tests/test/tunistr2.pp svneol=native#text/plain

View File

@ -275,7 +275,9 @@ Unit Rax86int;
begin
firsttoken:=FALSE;
len:=0;
while c in ['A'..'Z','a'..'z','0'..'9','_','@'] do
while (c in ['A'..'Z','a'..'z','0'..'9','_','@']) or
{ TP7 also allows $&? characters in local labels }
(forcelabel and (c in ['$','&','?'])) do
begin
{ if there is an at_sign, then this must absolutely be a label }
if c = '@' then
@ -328,7 +330,7 @@ Unit Rax86int;
begin
actasmpattern:=c;
c:=current_scanner.asmgetchar;
while c in ['A'..'Z','a'..'z','0'..'9','_','@'] do
while c in ['A'..'Z','a'..'z','0'..'9','_','@','$','&','?'] do
begin
actasmpattern:=actasmpattern + c;
c:=current_scanner.asmgetchar;

View File

@ -0,0 +1,23 @@
{ %NORUN }
{ %CPU=i8086,i386,x86_64 }
program tuglylabels1;
{ This test is TP7 compatible }
{$ifdef FPC}
{$asmmode intel}
{$endif FPC}
{ allowed characters in a local label:
@$&_?abcdefghijklmnopqrstuvwxyz0123456789 }
begin
asm
@:
jmp @
@@:
jmp @@
@$&_?@9:
jmp @$&_?@9
end;
end.