Additions to %types so that a user can specify the code to go into the casting / conversion function
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10222 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
560b18eb3f
commit
629aae375c
5 changed files with 76 additions and 13 deletions
|
|
@ -1804,10 +1804,6 @@ except_directive : EXCEPT LPAREN ID RPAREN LBRACE {
|
|||
}
|
||||
;
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
%fragment(name,location) { ... }
|
||||
------------------------------------------------------------ */
|
||||
|
||||
/* fragment keyword arguments */
|
||||
stringtype : string LBRACE parm RBRACE {
|
||||
$$ = NewHash();
|
||||
|
|
@ -1825,6 +1821,14 @@ fname : string {
|
|||
}
|
||||
;
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
%fragment(name, section) %{ ... %}
|
||||
%fragment("name" {type}, "section") %{ ... %}
|
||||
%fragment("name", "section", fragment="fragment1", fragment="fragment2") %{ ... %}
|
||||
Also as above but using { ... }
|
||||
%fragment("name");
|
||||
------------------------------------------------------------ */
|
||||
|
||||
fragment_directive: FRAGMENT LPAREN fname COMMA kwargs RPAREN HBLOCK {
|
||||
Hash *p = $5;
|
||||
$$ = new_node("fragment");
|
||||
|
|
@ -2502,11 +2506,14 @@ typemap_parm : type typemap_parameter_declarator {
|
|||
|
||||
/* ------------------------------------------------------------
|
||||
%types(parmlist);
|
||||
%types(parmlist) %{ ... %}
|
||||
------------------------------------------------------------ */
|
||||
|
||||
types_directive : TYPES LPAREN parms RPAREN SEMI {
|
||||
types_directive : TYPES LPAREN parms RPAREN stringbracesemi {
|
||||
$$ = new_node("types");
|
||||
Setattr($$,"parms",$3);
|
||||
if ($5)
|
||||
Setattr($$,"convcode",NewString($5));
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue