From ef260c34518ae6565f3f082ce76a14ed3a58c2e5 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 13 Jan 2006 18:04:59 +0000 Subject: [PATCH] add the ismember and hasvalue attributes and the corresponing %rename predicates git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8414 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/swig.swg | 3 ++- SWIG/Source/CParse/parser.y | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SWIG/Lib/swig.swg b/SWIG/Lib/swig.swg index 07b3a18f7..a3adfbf3b 100644 --- a/SWIG/Lib/swig.swg +++ b/SWIG/Lib/swig.swg @@ -246,6 +246,7 @@ static int NAME(TYPE x) { %define %isfunction match$kind="function" %enddef %define %isvariable match$kind="variable" %enddef %define %isimmutable "match$feature:immutable"="1" %enddef +%define %hasvalue match$hasvalue="1" %enddef %define %isstatic match$storage="static" %enddef %define %isfriend match$storage="friend" %enddef @@ -254,7 +255,7 @@ static int NAME(TYPE x) { %define %isexplicit match$storage="explicit" %enddef %define %isextern match$storage="extern" %enddef -%define %ismember match$parentNode$nodeType="class" %enddef +%define %ismember match$ismember="1" %enddef %define %isglobal notmatch$parentNode$nodeType="class" %enddef %define %innamespace match$parentNode$nodeType="namespace" %enddef diff --git a/SWIG/Source/CParse/parser.y b/SWIG/Source/CParse/parser.y index e89ce988d..95834f5a1 100644 --- a/SWIG/Source/CParse/parser.y +++ b/SWIG/Source/CParse/parser.y @@ -322,7 +322,7 @@ static void add_symbols(Node *n) { } set_parentNode(n,current_class); - Setattr(n,"memberof",current_class); + Setattr(n,"ismember","1"); } } if (!isfriend && inclass) { @@ -364,6 +364,9 @@ static void add_symbols(Node *n) { } else { SwigType *type = Getattr(n, k_type); Setattr(n,k_kind,"variable"); + if (Getattr(n,k_value)) { + Setattr(n,"hasvalue","1"); + } if (type && !SwigType_ismutable(type)) { SetFlag(n,"feature:immutable"); }