Private
Public Access
Formatting
This commit is contained in:
1 parent
e49732b1c5
commit
9414f818fd
1 file changed
+11
-7
+11
-7
@@ -121,20 +121,22 @@ 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
|
||||||
try {
|
if (!text.Contains("."))
|
||||||
return ValueFactory.CreateValue(text, "int");
|
try {
|
||||||
} catch (Exception e) { }
|
return ValueFactory.CreateValue(text, "int");
|
||||||
|
} catch (Exception e) { }
|
||||||
|
|
||||||
//Check if string is a double
|
//Check if string is a double
|
||||||
try {
|
else
|
||||||
return ValueFactory.CreateValue(text, "double");
|
try {
|
||||||
} catch (Exception e) { }
|
return ValueFactory.CreateValue(text, "double");
|
||||||
|
} catch (Exception e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if color
|
//Check if color
|
||||||
@@ -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");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user