Modified contract support (simplified).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5321 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c0072eb5ed
commit
5f88de8fe7
1 changed files with 2 additions and 33 deletions
|
|
@ -371,26 +371,9 @@ void emit_action(Node *n, Wrapper *f) {
|
|||
|
||||
/* Emit contract code (if any) */
|
||||
if (Swig_contract_mode_get()) {
|
||||
|
||||
/* Preassertion */
|
||||
tm = Getattr(n, "feature:preassert");
|
||||
tm = Getattr(n, "contract:preassert");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
|
||||
/* Inherit_Preassertion */
|
||||
tm = Getattr(n, "feature:inherit_preassert");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
|
||||
/* Invariant -- EXPERIMENTAL */
|
||||
tm = Getattr(n, "feature:invariant");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Replaceid(tm, "SWIG_invariant", "SWIG_invariant_begin");
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
}
|
||||
|
|
@ -440,23 +423,9 @@ void emit_action(Node *n, Wrapper *f) {
|
|||
|
||||
/* Emit contract code (if any) */
|
||||
if (Swig_contract_mode_get()) {
|
||||
/* Invariant -- EXPERIMENTAL */
|
||||
tm = Getattr(n, "feature:invariant");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Replaceid(tm, "SWIG_invariant", "SWIG_invariant_end");
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
/* Postassertion */
|
||||
tm = Getattr(n, "feature:postassert");
|
||||
tm = Getattr(n, "contract:postassert");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
/* Inherit Postassertion */
|
||||
tm = Getattr(n, "feature:inherit_postassert");
|
||||
if (Len(tm)) {
|
||||
replace_contract_args(Getmeta(tm,"parms"), Getattr(n,"parms"),tm);
|
||||
Printv(f->code,tm,"\n",NIL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue