adventuregamestudio/ags — pull request #154 by gurok (2014-05-04 09:41:30+00:00)
Title: Allow methods with global names

Previously, you weren't able to define a struct member function that shared a name with an already defined global variable (e.g. AbortGame). This patch forces the tokeniser to rename struct member functions even if the base name was used previously as a function. Also, if a renamed struct member function already existed, "sym.add" would return -1, causing the parser to break with a syntax error (Invalid syntax near 'int') instead of the real error ('MyStruct::XXX' is already defined). To fix this problem, the tokeniser now attempts to find an existing renamed function before adding a renamed symbol entry.