jp-embedded / scxmlcc

The SCXML state machine to C++ compiler
GNU General Public License v3.0
138 stars 34 forks source link

Incorrect processing of <script> content #88

Closed sstiller closed 5 years ago

sstiller commented 5 years ago

The text inside <script> ... </script> is modified resulting in uncompilable code. Example:

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="script">
    <state id="State_1">
        <onentry>
            <script>auto str = new std::string(&quot;Hello&quot;);
str-&gt;append(&quot; world&quot;);
std::cout &lt;&lt; *str &lt;&lt; '\n';
delete str;</script>
        </onentry>
    </state>
    <script>#include &lt;iostream&gt;</script>
</scxml>

In the generated code, the text str-&gt;append is replaced by str_>append instead of str->append

jp-embedded commented 5 years ago

fixed in #89