ads2gas_apple.pl: Reduce differences to ads2gas.pl
Avoid substitution of substrings by using \b to make sure the substituted strings are at word boundaries. This is an adaption of the corresponding changes to ads2gas.pl from 7ebcaeb0fa. Change-Id: I52160e8ba0373d4779d5fc3b0c384ca5c51c7b13
This commit is contained in:
parent
303c17ea29
commit
45c4533cc1
@ -75,16 +75,16 @@ while (<STDIN>)
|
|||||||
s/:SHR:/ >> /g;
|
s/:SHR:/ >> /g;
|
||||||
|
|
||||||
# Convert ELSE to .else
|
# Convert ELSE to .else
|
||||||
s/ELSE/.else/g;
|
s/\bELSE\b/.else/g;
|
||||||
|
|
||||||
# Convert ENDIF to .endif
|
# Convert ENDIF to .endif
|
||||||
s/ENDIF/.endif/g;
|
s/\bENDIF\b/.endif/g;
|
||||||
|
|
||||||
# Convert ELSEIF to .elseif
|
# Convert ELSEIF to .elseif
|
||||||
s/ELSEIF/.elseif/g;
|
s/\bELSEIF\b/.elseif/g;
|
||||||
|
|
||||||
# Convert LTORG to .ltorg
|
# Convert LTORG to .ltorg
|
||||||
s/LTORG/.ltorg/g;
|
s/\bLTORG\b/.ltorg/g;
|
||||||
|
|
||||||
# Convert IF :DEF:to .if
|
# Convert IF :DEF:to .if
|
||||||
# gcc doesn't have the ability to do a conditional
|
# gcc doesn't have the ability to do a conditional
|
||||||
@ -164,7 +164,7 @@ while (<STDIN>)
|
|||||||
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
|
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
|
||||||
|
|
||||||
# ALIGN directive
|
# ALIGN directive
|
||||||
s/ALIGN/.balign/g;
|
s/\bALIGN\b/.balign/g;
|
||||||
|
|
||||||
# Strip ARM
|
# Strip ARM
|
||||||
s/\sARM/@ ARM/g;
|
s/\sARM/@ ARM/g;
|
||||||
@ -184,7 +184,7 @@ while (<STDIN>)
|
|||||||
s/(.*)EQU(.*)/.set $1, $2/;
|
s/(.*)EQU(.*)/.set $1, $2/;
|
||||||
|
|
||||||
# Begin macro definition
|
# Begin macro definition
|
||||||
if (/MACRO/)
|
if (/\bMACRO\b/)
|
||||||
{
|
{
|
||||||
# Process next line down, which will be the macro definition
|
# Process next line down, which will be the macro definition
|
||||||
$_ = <STDIN>;
|
$_ = <STDIN>;
|
||||||
@ -215,7 +215,7 @@ while (<STDIN>)
|
|||||||
|
|
||||||
# For macros, use \ to reference formal params
|
# For macros, use \ to reference formal params
|
||||||
# s/\$/\\/g; # End macro definition
|
# s/\$/\\/g; # End macro definition
|
||||||
s/MEND/.endm/; # No need to tell it where to stop assembling
|
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
|
||||||
next if /^\s*END\s*$/;
|
next if /^\s*END\s*$/;
|
||||||
|
|
||||||
# Clang used by Chromium differs slightly from clang in XCode in what it
|
# Clang used by Chromium differs slightly from clang in XCode in what it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user