add insensitive kws

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8174 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-02 04:36:56 +00:00
commit 447f7454e5

View file

@ -3,8 +3,16 @@
// when used as class methods. // when used as class methods.
// //
#define PHPKW(x) %namewarn("314:" `x` " is a php keyword",rename="_%s") "::" `x` #define PHPKW(x) %namewarn("314:" `x` " is a php keyword, renamed as c_"`x`,sourcefmt="%(lower)s", rename="c_%s") `x`
#define PHPBN(x) %namewarn("321:" `x` " conflicts with a built-in name in php") "::" `x`
%define PHPCN(x)
%namewarn("314:" `x` " is a php reserved class name, class renamed as c_"`x`,match="class",rename="c_%s") `x`;
%namewarn("314:" `x` " is a php reserved class name, constructor renamed as c_"`x`,match="constructor",rename="c_%s") `x`;
%enddef
#define PHPBN1(x) %namewarn("321:" `x` " conflicts with a built-in name in php",sourcefmt="%(lower)s") "::" `x`
#define PHPBN2(x) %namewarn("321:" `x` " conflicts with a built-in name in php") "::" `x`
/* /*
From From
@ -61,17 +69,30 @@ PHPKW(var);
PHPKW(while); PHPKW(while);
PHPKW(xor); PHPKW(xor);
/* we catalog these as built-in names since they conflicts, but PHP still runs */ /* we catalog these as built-in names since they conflict, but PHP still runs */
PHPBN(E_ALL);
PHPBN(E_ERROR); /* Type 1: case insensitive */
PHPBN(E_PARSE); PHPBN1(__sleep);
PHPBN(E_WARNING); PHPBN1(__wakeup);
PHPBN(FALSE); PHPBN1(not);
PHPBN(PHP_OS); PHPBN1(virtual);
PHPBN(PHP_VERSION); PHPBN1(TRUE);
PHPBN(TRUE); PHPBN1(FALSE);
PHPBN(__sleep); PHPBN1(__FILE__);
PHPBN(__wakeup); PHPBN1(__LINE__);
/* Type 2: case sensitive */
PHPBN2(E_ALL);
PHPBN2(E_ERROR);
PHPBN2(E_PARSE);
PHPBN2(E_WARNING);
PHPBN2(PHP_OS);
PHPBN2(PHP_VERSION);
PHPBN2(NULL);
/* Class names not allowed */
PHPCN(stdClass);
#undef PHPKW #undef PHPKW
#undef PHPBN #undef PHPBN