nitdbg: Added function to create a bool instance with its value
authorLucas BAJOLET <r4pass@r4pass-ubu-laptophp.(none)>
Fri, 22 Feb 2013 19:48:54 +0000 (14:48 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Tue, 19 Mar 2013 18:04:50 +0000 (14:04 -0400)
Signed-off-by: Lucas BAJOLET <r4pass@hotmail.com>

src/debugger.nit

index af3f467..159a849 100644 (file)
@@ -752,6 +752,19 @@ class Debugger
                end
        end
 
+       # Returns a new bool instance with value 'value'
+       fun get_bool(value: String): nullable Instance
+       do
+               if value.to_lower == "true" then
+                       return self.true_instance
+               else if value.to_lower == "false" then
+                       return self.false_instance
+               else
+                       print "Invalid value, a boolean must be set at \"true\" or \"false\""
+                       return null
+               end
+       end
+
        #######################################################################
        ##                     Command listing function                      ##
        #######################################################################