I'm not really sure if this is a bug but is very extrange for me.
foo@bar = 0
; This doesn't work (wrongly report "a1.a2 doesn't exists" without replacing a1 and a2 with their actual names)
macro matchTest arg
{
forward
ok = 0
match a1 =@ a2, arg
\{
if ~defined a1 # @ # a2
display `a1, ".", `a2, " doesn't exists"
err
end if
a1 = 1 ; Here preprocesor changes this by "foo = 1"
a2 = 2 ; Here preprocesor changes this by "bar = 1"
ok = 1 ; Indicates arg match as an argument
\}
if ~ok
display "Invalid argument"
err
end if
}
matchTest foo @ bar
; This works
match a1 =@ a2, foo @ bar
{
if ~defined a1 # @ # a2
display `a1, ".", `a2, " doesn't exists"
err
end if
a1 = 1
a2 = 2
ok = 1 ; Indicates arg match as an argument
}
;This works too
macro testArg a1, a2
{
if ~defined a1 # @ # a2
display `a1, ".", `a2, " doesn't exists"
err
end if
}
macro matchTest arg
{
forward
ok = 0
match a1 =@ a2, arg
\{
testArg a1, a2
a1 = 1
a2 = 2
ok = 1 ; Indicates arg match as an argument
\}
if ~ok
display "Invalid argument"
err
end if
}
matchTest foo @ bar
Preprocesing:
foo@bar=0
;macro matchTest arg
;{
; forward
; ok=0
; match a1=@ a2,arg
; \{
; if~defined a1#@#a2
; display`a1,'.',`a2,' doesn''t exists'
; err
; end if
;
; a1=1
; a2=2
;
; ok=1
; \}
; if~ok
; display 'Invalid argument'
; err
; end if
;}
;matchTest foo @ bar
ok=0
;match a1=@ a2,foo @ bar
;{
; if~defined a1@a2
; display 'a1','.','a2',' doesn''t exists'
; err
; end if
;
; a1=1
; a2=2
;
; ok=1
;}
if~defined a1@a2
display 'a1','.','a2',' doesn''t exists'
err
end if
foo=1
bar=2
ok=1
if~ok
display 'Invalid argument'
err
end if
;match a1=@ a2,foo @ bar
;{
; if~defined a1#@#a2
; display`a1,'.',`a2,' doesn''t exists'
; err
; end if
;
; a1=1
; a2=2
;
; ok=1
;}
if~defined foo@bar
display 'foo','.','bar',' doesn''t exists'
err
end if
foo=1
bar=2
ok=1
;macro testArg a1,a2
;{
; if~defined a1#@#a2
; display`a1,'.',`a2,' doesn''t exists'
; err
; end if
;}
;macro matchTest arg
;{
; forward
; ok=0
; match a1=@ a2,arg
; \{
; testArg a1,a2
;
; a1=1
; a2=2
;
; ok=1
; \}
; if~ok
; display 'Invalid argument'
; err
; end if
;}
;matchTest foo @ bar
ok=0
;match a1=@ a2,foo @ bar
;{
; testArg a1,a2
;
; a1=1
; a2=2
;
; ok=1
;}
;testArg foo,bar
if~defined foo@bar
display 'foo','.','bar',' doesn''t exists'
err
end if
foo=1
bar=2
ok=1
if~ok
display 'Invalid argument'
err
end if
Note that only the first match testing methods doesn't replace a1 and a2 but the others works fine.
Regards,
LocoDelAssembly
PS: Thanks for the preprocesing tool, is very usefull!!!