kierenj / 0x10c-DevKit

0x10c DevKit
http://0x10c-devkit.com/
39 stars 4 forks source link

Confusing Error Message With Bad Macro Calls #136

Closed CannibalVox closed 12 years ago

CannibalVox commented 12 years ago

Hello, the following bad code sends an incorrect number of params to a macro:

#macro macro1(param) {
    SET A, param
}

macro1()

Rather than give a helpful error message about this fact, I receive the following error:

Internal compiler exception on pass Pass2ExpandMacros: Index was out of range. Must be non-negative and less than the size of the collection.

Would it be possible to modify this error message to provide info about the incorrect param count?

kierenj commented 12 years ago

Indeed there are a few sneaky parts of the code left which aren't giving decent messages yet. Thanks for that, will fix

kierenj commented 12 years ago

Implemented for next release! Example for the above code:

Macro parameter count mismatch (macro macro1 takes 1 parameters, not 0)

CannibalVox commented 12 years ago

Thanks a ton!