Author Topic: macro processing seems to be inconsistent  (Read 10338 times)

Offline gammac

  • Jr. Member
  • *
  • Posts: 71
  • Country: 00
macro processing seems to be inconsistent
« on: November 23, 2014, 07:07:05 PM »
Hi!

Why are %1 and %2 resolved at declaration of the inner macro and %?? and %00 at declaration of the outer macro? Is there a work around that %?? and %00 are even resolved at declaration of the inner macro?

Code: [Select]
%macro mkmacro 1
%define str 12
%macro %1 2
%warning '%??' = %??
%warning '%00' = %00
%warning 'str' = str
%warning '%1' = %1
%warning '%2' = %2
%endmacro
%endmacro

lbl_1 mkmacro mymac

lbl_2 mymac 42, 66

output:

Code: [Select]
warning: (mymac:2) '%??' = mkmacro
warning: (mymac:3) '%00' = lbl_1
warning: (mymac:4) 'str' = 12
warning: (mymac:5) '%1' = 42
warning: (mymac:6) '%2' = 66
Please comment your code! It helps to help you.