diff options
author | Lior Goldberg <liorgol.dev@gmail.com> | 2016-06-19 22:37:29 +0300 |
---|---|---|
committer | Lior Goldberg <liorgol.dev@gmail.com> | 2016-06-22 23:13:28 +0300 |
commit | c363a93d6958ef98627c08e7f74dab30d228e523 (patch) | |
tree | 8c8c942b9152d29f678b4d93893a5a1d6e77c8c7 /Source | |
parent | 86fd5c98583936c4ea25caf341ec30d2379d05e7 (diff) | |
download | swig-c363a93d6958ef98627c08e7f74dab30d228e523.tar.gz |
Added support for type alias
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CParse/parser.y | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 51cd5b553..784187c28 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -2899,16 +2899,15 @@ c_declaration : c_decl { SWIG_WARN_NODE_END($$); } | USING idcolon EQUAL type plain_declarator SEMI { - $$ = new_node("using"); - Setattr($$,"name",$2); + /* Convert using statement to a typedef statement */ + $$ = new_node("cdecl"); SwigType_push($4,$5.type); - Setattr($$,"uname",$4); + Setattr($$,"type",$4); + Setattr($$,"storage","typedef"); + Setattr($$,"name",$2); + Setattr($$,"decl",""); + SetFlag($$,"typealias"); add_symbols($$); - SWIG_WARN_NODE_BEGIN($$); - Swig_warning(WARN_CPP11_ALIAS_DECLARATION, cparse_file, cparse_line, "The 'using' keyword in type aliasing is not fully supported yet.\n"); - SWIG_WARN_NODE_END($$); - - $$ = 0; /* TODO - ignored for now */ } | TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL type plain_declarator SEMI { $$ = new_node("using"); |