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) {
text = SettingsAndHelperFunctions.Strip(text);
//No assignmnet
if (!text.Contains("=")) {
if (!text.Contains("#")) {
//Check if string is a number
if (!text.Contains("."))
try {
return ValueFactory.CreateValue(text, "int");
} catch (Exception e) { }
//Check if string is a double
else
try {
return ValueFactory.CreateValue(text, "double");
} catch (Exception e) { }
@@ -142,6 +144,8 @@ namespace Advanced_Software_Engineering.Verbs.Value {
return ValueFactory.CreateValue(text, "color");
} catch (Exception e) { }
} else {
//Check if string is a bool TODO
//Check if string is an expression
return ValueFactory.CreateValue(text, "expression");
}