internal MatchAnalyzer Absorb(InterpreterState state, string cmd, Regex r) { var m = r.Match(Source); PropertyName = m.Groups["var"].Value; if (m.Groups["expr"].Success) { string expr = m.Groups["expr"].Value; Tuple<string, ANALFUNC> helper = AnalysisHelpers.FirstOrDefault(t => t.Item1 == cmd) ?? AnalysisHelpers.First(t => t.Item1.Contains(expr.Substring(0, 1))); RealizedObject = new WARPObject(helper.Item2(state, expr)); } return this; }
internal override void Execute(InterpreterState state, SourceCode source, BaseInterpreterStack stack) { dynamic result = PropertyNameAndExpression(stack); bool inPopMode = result.PropertyName == Constants.KeyWords.Pop; var pbee = Environment(state); Int64 cur = inPopMode ? stack.Pop<WARPObject>().AsNumeric() : pbee[result.PropertyName].As<WARPObject>().AsNumeric(); var obj = new WARPObject(FlexibleNumeralSystem.Encode(Command(cur, result.Expression), WARPObject.CurrentRadix)); if (result.PropertyName == Constants.KeyWords.Pop) pbee.Push(obj); else pbee[result.PropertyName] = obj; }