~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/Mono.Debugging/Mono.Debugging.Evaluation/ExpressionEvaluator.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
//
27
27
 
28
28
using System;
 
29
using System.Text;
 
30
using System.Globalization;
29
31
using System.Runtime.Serialization;
30
 
using System.Text;
 
32
 
31
33
using Mono.Debugging.Backend;
32
34
using Mono.Debugging.Client;
33
35
 
143
145
                                char c = text[i];
144
146
                                string txt;
145
147
                                switch (c) {
146
 
                                        case '"': txt = "\\\""; break;
147
 
                                        case '\0': txt = @"\0"; break;
148
 
                                        case '\\': txt = @"\\"; break;
149
 
                                        case '\a': txt = @"\a"; break;
150
 
                                        case '\b': txt = @"\b"; break;
151
 
                                        case '\f': txt = @"\f"; break;
152
 
                                        case '\v': txt = @"\v"; break;
153
 
                                        case '\n': txt = @"\n"; break;
154
 
                                        case '\r': txt = @"\r"; break;
155
 
                                        case '\t': txt = @"\t"; break;
156
 
                                        default:
 
148
                                case '"': txt = "\\\""; break;
 
149
                                case '\0': txt = @"\0"; break;
 
150
                                case '\\': txt = @"\\"; break;
 
151
                                case '\a': txt = @"\a"; break;
 
152
                                case '\b': txt = @"\b"; break;
 
153
                                case '\f': txt = @"\f"; break;
 
154
                                case '\v': txt = @"\v"; break;
 
155
                                case '\n': txt = @"\n"; break;
 
156
                                case '\r': txt = @"\r"; break;
 
157
                                case '\t': txt = @"\t"; break;
 
158
                                default:
 
159
                                        if (char.GetUnicodeCategory (c) == UnicodeCategory.OtherNotAssigned) {
 
160
                                                sb.AppendFormat ("\\u{0:x4}", (int) c);
 
161
                                        } else {
157
162
                                                sb.Append (c);
158
 
                                                continue;
 
163
                                        }
 
164
                                        continue;
159
165
                                }
160
166
                                sb.Append (txt);
161
167
                        }
183
189
        }
184
190
 
185
191
        [Serializable]
 
192
        public class EvaluatorAbortedException: EvaluatorException
 
193
        {
 
194
                protected EvaluatorAbortedException (SerializationInfo info, StreamingContext context)
 
195
                        : base (info, context)
 
196
                {
 
197
                }
 
198
 
 
199
                public EvaluatorAbortedException ()
 
200
                        : base ("Aborted.")
 
201
                {
 
202
                }
 
203
        }
 
204
 
 
205
        [Serializable]
186
206
        public class NotSupportedExpressionException: EvaluatorException
187
207
        {
188
208
                protected NotSupportedExpressionException (SerializationInfo info, StreamingContext context)
190
210
                {
191
211
                }
192
212
                
193
 
                public NotSupportedExpressionException ( )
 
213
                public NotSupportedExpressionException ()
194
214
                        : base ("Expression not supported.")
195
215
                {
196
216
                }