Set ENO to false when conversion function fails.
authorManuele Conti <conti.ma@alice.it>
Fri, 23 Nov 2012 11:38:57 +0100
changeset 754 36f91a5e4fc8
parent 753 5c389814f496
child 755 7b90dd17f0ba
Set ENO to false when conversion function fails.
stage1_2/create_enumtype_conversion_functions.cc
--- a/stage1_2/create_enumtype_conversion_functions.cc	Fri Nov 23 14:11:57 2012 +0100
+++ b/stage1_2/create_enumtype_conversion_functions.cc	Fri Nov 23 11:38:57 2012 +0100
@@ -157,6 +157,7 @@
    STRING_TO_<ENUM> := <ENUM.VALUE_N>;
    RETURN;
   END_IF;
+  ENO := FALSE;
   END_FUNCTION
 
   Note: if you change code below remember to update this comment.
@@ -172,9 +173,10 @@
        std::string value = *itr;
        text += "IF IN = '" + value + "' THEN\n";
        text += " " + functionName + " := " + value + ";\n";
-       text += " RETURN;\n";
+       text += " RETURN;\n"; 
        text += "END_IF;\n";
     }
+    text += "ENO := FALSE;\n";
     text += "END_FUNCTION\n\n";
 }
 
@@ -196,6 +198,7 @@
    <ENUM>_TO_STRING := '<ENUM.VALUE_N>';
    RETURN;
   END_IF;
+  ENO := FALSE;
   END_FUNCTION
 
   Note: if you change code below remember to update this comment.
@@ -214,6 +217,7 @@
         text += " RETURN;\n";
         text += "END_IF;\n";
     }
+    text += "ENO := FALSE;\n";
     text += "END_FUNCTION\n\n";
 }
 
@@ -235,6 +239,7 @@
    <INTEGER>_TO_<ENUM> := <ENUM.VALUE_N>;
    RETURN;
   END_IF;
+  ENO := FALSE;
   END_FUNCTION
 
   Note: if you change code below remember to update this comment.
@@ -260,6 +265,7 @@
         text += "END_IF;\n";
         count++;
     }
+    text += "ENO := FALSE;\n";
     text += "END_FUNCTION\n\n";
 }
 
@@ -281,6 +287,7 @@
    <ENUM>_TO_<INTEGER> := N;
    RETURN;
   END_IF;
+  ENO := FALSE;
   END_FUNCTION
 
   Note: if you change code below remember to update this comment.
@@ -306,6 +313,7 @@
         text += "END_IF;\n";
         count++;
     }
+    text += "ENO := FALSE;\n";
     text += "END_FUNCTION\n\n";
 }