C# 'out' or 'ref' removal improvements in director typemaps.

- Add support to DOH Replace for not replacing inside C comments
- Fix removing 'out' or 'ref' when these are present in C comments
  in cstype typemaps.

Closes #1628
This commit is contained in:
William S Fulton 2019-11-26 19:39:28 +00:00
commit 18b2dcd222
5 changed files with 126 additions and 13 deletions

View file

@ -4064,7 +4064,7 @@ public:
/* Get the C# parameter type */
if ((tm = Getattr(p, "tmap:cstype"))) {
substituteClassname(pt, tm);
int flags = DOH_REPLACE_FIRST | DOH_REPLACE_ID_BEGIN;
int flags = DOH_REPLACE_FIRST | DOH_REPLACE_ID_BEGIN | DOH_REPLACE_NOCOMMENT;
if (Replace(tm, "ref ", "", flags) || Replace(tm, "ref\t", "", flags)) {
Printf(proxy_method_types, "typeof(%s).MakeByRefType()", tm);
} else if (Replace(tm, "out ", "", flags) || Replace(tm, "out\t", "", flags)) {