Exemplo n.º 1
0
        private void Evaluate(String content, Boolean showOutput)
        {
            try
            {
                var result = _interactivity.Run(_engine, content);

                if (showOutput)
                {
                    var output = default(String);

                    if (result != null)
                    {
                        output = Stringify.This(result);
                    }

                    _interactivity.Info(output);
                    _engine.Scope["ans"] = result;
                }
            }
            catch (ParseException ex)
            {
                _interactivity.Display(ex.Error, content);
            }
            catch (Exception ex)
            {
                _interactivity.Error(ex.Message);
            }

            _interactivity.Write(Environment.NewLine);
        }