Still errors with macros

Create issue
Issue #3 resolved
Sixdsn created an issue

Hi again,

your last version is working fine for the bug i add but i still have some issue like the other one. in the file that i attach, the method GetCellIndexes isnt found right.

i know its because of : ""NS_DECL_QUERYFRAME_TARGET(nsITableCellLayout) but i wasnt able to ignore it the right way.

thanks again

Comments (9)

  1. senex repo owner

    Its having trouble with the following macro


    It keys off of semi colons. It might be helpful to run the parser with the debug enabled. You can do by adding the following lines before parsing happens:

    CppHeaderParser.debug = 1
    CppHeaderParser.debug_trace = 1

    This can give you an idea of how it views your code

  2. Sixdsn reporter


    even if i set

    CppHeaderParser.debug = 1
    CppHeaderParser.debug_trace = 1

    i cant get debug intel. i tried to call directly debug_print and trace_print but it doesnt work, i print the values of CppHeaderParser.debug CppHeaderParser.debug_trace in my loop and it's set to 1. i can call error_print and warning print, but not the debug functions

    the only way to get it working is to set them directly in and to launch the

    i will see what debug shows


  3. Sixdsn reporter

    whitout any ignore field i got this:

    [2152] Evaluating stack ['NS_DECL_QUERYFRAME_TARGET', '(', 'nsITableCellLayout', ')', 'NS_IMETHOD', 'GetCellIndexes', '(', 'int32_t', '&', 'aRowIndex', ',', 'int32_t', '&', 'aColIndex', ')', '=', '0']

    with "NS_DECL_QUERYFRAME_TARGET" in the ignore list i have:

    [2152] Evaluating stack ['(', 'nsITableCellLayout', ')', 'NS_IMETHOD', 'GetCellIndexes', '(', 'int32_t', '&', 'aRowIndex', ',', 'int32_t', '&', 'aColIndex', ')', '=', '0']

    bu as it splits the macro name, the braces and the value in the braces, i can't get a good solution to avoid it to be included in the method...

    there is no way to have a list of expressions completly ignored? maybe on the top of the lex parser?


  4. Sixdsn reporter

    or maybe it could be easier to add in addition with the ignore keyword list a list of keyword list to ignore where each list is a est of keywords following each other to ignore so we could have to_ignore_list[0] = [ "NS_DECL_QUERYFRAME_TARGET", "(", "nsITableCellLayout", ")" ]

    do you see what i mean?

    thanks again

  5. senex repo owner

    I am thinking of how to best handle this. My thought is to support ignoring #define functions in the ignore list where "NS_DECL_QUERYFRAME_TARGET()" would expand to basically ignore "NS_DECL_QUERYFRAME_TARGET(.*)". This would support sub parenthetical expressions too. I might try this tonight.

  6. Sixdsn reporter

    Yep it might be a good solution too btw i guess i found something last night: when i add "NS_DECL_QUERYFRAME_TARGET" and "NS_DECL_QUERYFRAME" to ignore list, only "NS_DECL_QUERYFRAME" was ignored so i had a portion with "_TARGET" not ignored in code. could you see if it happens to you to?


    Class A
    NS_IMETHOD void Six();

    gives: _TARGET(blahblah) NS_IMETHOD void Six();

  7. senex repo owner

    This issue has been resolved as of 105:66ca6dc92022

    To ignore #define magic functions just enter something like this before you parse


    and the right thing will happen.

  8. Log in to comment