Fix enum conversion function to string.
authorManuele Conti <conti.ma@alice.it>
Sun, 02 Dec 2012 12:30:41 +0100
changeset 771 d0c5c63a0cbf
parent 770 adc632c96c50
child 772 30e5193cc19a
Fix enum conversion function to string.
stage1_2/create_enumtype_conversion_functions.cc
--- a/stage1_2/create_enumtype_conversion_functions.cc	Wed Nov 28 22:51:24 2012 +0100
+++ b/stage1_2/create_enumtype_conversion_functions.cc	Sun Dec 02 12:30:41 2012 +0100
@@ -196,12 +196,12 @@
   IN: <ENUM>;
   END_VAR
   IF IN = <ENUM.VALUE_1> THEN
-   <ENUM>_TO_STRING := '<ENUM.VALUE_1>';
+   <ENUM>_TO_STRING := '<ENUM>#<ENUM.VALUE_1>';
    RETURN;
   END_IF;
   ...
   IF IN = <ENUM.VALUE_N> THEN
-   <ENUM>_TO_STRING := '<ENUM.VALUE_N>';
+   <ENUM>_TO_STRING := '<ENUM>#<ENUM.VALUE_N>';
    RETURN;
   END_IF;
   ENO := FALSE;
@@ -219,7 +219,7 @@
     for (itr = enumerateValues.begin(); itr != enumerateValues.end(); ++itr) {
         std::string value = *itr;
         text += "IF IN = " + value + " THEN\n";
-        text += " " + functionName + " := '" + value + "';\n";
+        text += " " + functionName + " := '" + enumerateName + "#" + value + "';\n";
         text += " RETURN;\n";
         text += "END_IF;\n";
     }