Page 1 of 1

PB 5.20 LTS (Linux & Win): apparent bug in the macro parser

Posted: Sat Nov 02, 2013 7:26 pm
by BorisTheOld
It appears as if the macro processor, in some situations, is terminating it's scanning too early. It's not satisfying itself that there are no more macro substitutions to be processed.

This code compiles:

Code: Select all

Macro typInt32
  i
EndMacro

x.typInt32   ; x.i
And this code compiles:

Code: Select all

Macro typInt32
  i
EndMacro

Macro Field (DataName, DataType)
  DataName.DataType
EndMacro

Field(x, typInt32)   ; x.i
But this code causes the compiler to complain about a missing structure named, "typInt32".

Code: Select all

Macro typInt32
  i
EndMacro

Macro Field (DataName, DataType)
  DataName.typ#DataType
EndMacro

Field(x, Int32)   ; structure not found: typint32

Re: PB 5.20 LTS (Linux & Win): apparent bug in the macro par

Posted: Sun Nov 03, 2013 3:08 pm
by Fred
That's right, such constructs are not supported by the macro preprocessor. Moved to feature request.

Re: PB 5.20 LTS (Linux & Win): apparent bug in the macro par

Posted: Sun Nov 03, 2013 8:24 pm
by BorisTheOld
Thanks.

I assume that a macro parameter is parsed against other macros until no more changes occur, then its text is substituted into the macro body. Rather than first substituting the parameters into the macro body, then parsing the macro body until no more changes occur.