public static object ResolveMethods(string Svalue, variables MainVars) { variables mv = new variables(); LineDefiner mld = new LineDefiner(mv); string file = Svalue.Split('(')[0]; string parameters = Svalue.Split('(')[1].TrimEnd(')'); string[] AllLines = File.ReadAllLines($"{file}.txt"); Regex trimmer = new Regex(@"\s\s+"); string s = trimmer.Replace(AllLines[0], " "); GetParameters(s, parameters, mv, MainVars); for (int i = 1; i < AllLines.Length; i++) { s = trimmer.Replace(AllLines[i], " "); s = s.TrimStart(' '); if (AllLines[i].StartsWith("return")) { s = s.Replace("return ", ""); return(mld.GetValue(s, ref i)); } mld.Define(AllLines[i], ref i); } return(""); }
static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.Unicode; string path = Console.ReadLine(); string[] AllLines = File.ReadAllLines(path); MainVars = new variables(); LineDefiner MainLD = new LineDefiner(MainVars); for (int i = 0; i < AllLines.Length; i++) { MainLD.Define(AllLines[i], ref i); } }