yast/yast-core

Losing comments for <locale>

dmajda opened this issue · 2 comments

Consider the following YCP code:

{
  textdomain "foo";

  string s = /* before */ _("bar");
}

When I run ycpc -cx on it with Y2PARSECOMMENTS=1, I get the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<ycp version="2.15.8.39280">
  <block kind="file">
    <symbols>
      <symbol global="1" category="filename" type="&lt;unspec&gt;" name="../testcases/units.ycp"/>
      <symbol category="variable" type="string" name="s"/>
    </symbols>
    <statements>
      <stmt><textdomain name="foo" comment_before=" &#xA;  "/></stmt>
      <stmt><assign name="s" comment_before=" &#xA;&#xA;   " comment_after="&#xA;"><locale domain="foo" text="bar"/></assign></stmt>
    </statements>
  </block>
</ycp>

The XML does not contain the /* before */ comment.

The minimal testcase comes form String.ycp.

@mvidner Could you have a look?

JFYI I verified the fix works with yast2-core-2.24.12-3.1.x86_64.