public static void DeclarePrivateVarible(string line) { string[] args = line.Replace("(private)", "").StringSplit(" = "); args[1] = EggCodeParser.ParseInput(args[1]).ToString(); EggCodeTypeVarible var = new EggCodeTypeVarible(args[0], args[1]); if (CurrentlyRunning.FindVarible(args[0]) == null) { CurrentlyRunning.privateVaribles.Add(var); } else { CurrentlyRunning.privateVaribles[CurrentlyRunning.FindVaribleIndex(args[0])] = var; } }
public static object ParseInput(string input) { if (input.StartsWith("\"")) { return(input.Between("\"", "\"")); } else if (input.StartsWith("input")) { Console.Write(ParseInput(input.AdvancedBetween('(', ')'))); return(Console.ReadLine()); } else if (input.StartsWith("math")) { return(EggCodeCommands.Math(input)); } //if no other input method is found try to return a private varible but if there is no private varible try to return a global one else { try { try { return(CurrentlyRunning.FindVarible(input).value); } catch { return(EggCodeTypeVarible.FindVarible(input).value); } } catch { return(input); } } }