Formatting

This commit is contained in:
Lukasz Baldyga committed 2020-11-27 21:03:00 +00:00
1 parent e49732b1c5
commit 9414f818fd
1 file changed
+5 -1
@@ -121,17 +121,19 @@ namespace Advanced_Software_Engineering.Verbs.Value {
} }
public static IValue ConvertToIValue(string text) { public static IValue ConvertToIValue(string text) {
text = SettingsAndHelperFunctions.Strip(text);
//No assignmnet //No assignmnet
if (!text.Contains("=")) { if (!text.Contains("=")) {
if (!text.Contains("#")) { if (!text.Contains("#")) {
//Check if string is a number //Check if string is a number
if (!text.Contains("."))
try { try {
return ValueFactory.CreateValue(text, "int"); return ValueFactory.CreateValue(text, "int");
} catch (Exception e) { } } catch (Exception e) { }
//Check if string is a double //Check if string is a double
else
try { try {
return ValueFactory.CreateValue(text, "double"); return ValueFactory.CreateValue(text, "double");
} catch (Exception e) { } } catch (Exception e) { }
@@ -142,6 +144,8 @@ namespace Advanced_Software_Engineering.Verbs.Value {
return ValueFactory.CreateValue(text, "color"); return ValueFactory.CreateValue(text, "color");
} catch (Exception e) { } } catch (Exception e) { }
} else { } else {
//Check if string is a bool TODO
//Check if string is an expression //Check if string is an expression
return ValueFactory.CreateValue(text, "expression"); return ValueFactory.CreateValue(text, "expression");
} }