changeset 140:f973c5df9972 v2

fixes
author cin
date Fri, 20 Feb 2015 15:58:34 +0300
parents 041b77711262
children 0fa293bb1351
files Implab/Diagnostics/Extensions.cs Implab/JSON/JSONParser.cs
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Implab/Diagnostics/Extensions.cs	Wed Feb 18 18:02:02 2015 +0300
+++ b/Implab/Diagnostics/Extensions.cs	Fri Feb 20 15:58:34 2015 +0300
@@ -19,7 +19,7 @@
                 },
                 reason => {
                     TraceContext.Instance.EnterLogicalOperation(op,true);
-                    TraceLog.TraceInformation("promise cancelled {0}", reason.Message);
+                    TraceLog.TraceInformation("promise cancelled {0}", reason == null ? "<no-reason>" : reason.Message);
                     TraceLog.EndLogicalOperation();
                     TraceContext.Instance.Leave();
                 }
--- a/Implab/JSON/JSONParser.cs	Wed Feb 18 18:02:02 2015 +0300
+++ b/Implab/JSON/JSONParser.cs	Fri Feb 20 15:58:34 2015 +0300
@@ -46,10 +46,11 @@
         static readonly DFAStateDescriptior[] _arrayDFA;
 
         static JSONParser() {
-            var jsonExpression = Token.New(JsonTokenType.BeginObject, JsonTokenType.BeginArray).Tag(0);
+
 
             var valueExpression = Token.New(JsonTokenType.BeginArray, JsonTokenType.BeginObject, JsonTokenType.Literal, JsonTokenType.Number, JsonTokenType.String);
             var memberExpression = Token.New(JsonTokenType.String).Cat(Token.New(JsonTokenType.NameSeparator)).Cat(valueExpression);
+
             var objectExpression = memberExpression
                 .Cat(
                     Token.New(JsonTokenType.ValueSeparator)
@@ -69,6 +70,8 @@
                 .Cat(Token.New(JsonTokenType.EndArray))
                 .Tag(0);
 
+            var jsonExpression = valueExpression.Tag(0);
+
             _jsonDFA = BuildDFA(jsonExpression).States;
             _objectDFA = BuildDFA(objectExpression).States;
             _arrayDFA = BuildDFA(arrayExpression).States;