@@ -19,7 +19,7 | |||||
19 | }, |
|
19 | }, | |
20 | reason => { |
|
20 | reason => { | |
21 | TraceContext.Instance.EnterLogicalOperation(op,true); |
|
21 | TraceContext.Instance.EnterLogicalOperation(op,true); | |
22 | TraceLog.TraceInformation("promise cancelled {0}", reason.Message); |
|
22 | TraceLog.TraceInformation("promise cancelled {0}", reason == null ? "<no-reason>" : reason.Message); | |
23 | TraceLog.EndLogicalOperation(); |
|
23 | TraceLog.EndLogicalOperation(); | |
24 | TraceContext.Instance.Leave(); |
|
24 | TraceContext.Instance.Leave(); | |
25 | } |
|
25 | } |
@@ -46,10 +46,11 namespace Implab.JSON { | |||||
46 | static readonly DFAStateDescriptior[] _arrayDFA; |
|
46 | static readonly DFAStateDescriptior[] _arrayDFA; | |
47 |
|
47 | |||
48 | static JSONParser() { |
|
48 | static JSONParser() { | |
49 | var jsonExpression = Token.New(JsonTokenType.BeginObject, JsonTokenType.BeginArray).Tag(0); |
|
49 | ||
50 |
|
50 | |||
51 | var valueExpression = Token.New(JsonTokenType.BeginArray, JsonTokenType.BeginObject, JsonTokenType.Literal, JsonTokenType.Number, JsonTokenType.String); |
|
51 | var valueExpression = Token.New(JsonTokenType.BeginArray, JsonTokenType.BeginObject, JsonTokenType.Literal, JsonTokenType.Number, JsonTokenType.String); | |
52 | var memberExpression = Token.New(JsonTokenType.String).Cat(Token.New(JsonTokenType.NameSeparator)).Cat(valueExpression); |
|
52 | var memberExpression = Token.New(JsonTokenType.String).Cat(Token.New(JsonTokenType.NameSeparator)).Cat(valueExpression); | |
|
53 | ||||
53 | var objectExpression = memberExpression |
|
54 | var objectExpression = memberExpression | |
54 | .Cat( |
|
55 | .Cat( | |
55 | Token.New(JsonTokenType.ValueSeparator) |
|
56 | Token.New(JsonTokenType.ValueSeparator) | |
@@ -69,6 +70,8 namespace Implab.JSON { | |||||
69 | .Cat(Token.New(JsonTokenType.EndArray)) |
|
70 | .Cat(Token.New(JsonTokenType.EndArray)) | |
70 | .Tag(0); |
|
71 | .Tag(0); | |
71 |
|
72 | |||
|
73 | var jsonExpression = valueExpression.Tag(0); | |||
|
74 | ||||
72 | _jsonDFA = BuildDFA(jsonExpression).States; |
|
75 | _jsonDFA = BuildDFA(jsonExpression).States; | |
73 | _objectDFA = BuildDFA(objectExpression).States; |
|
76 | _objectDFA = BuildDFA(objectExpression).States; | |
74 | _arrayDFA = BuildDFA(arrayExpression).States; |
|
77 | _arrayDFA = BuildDFA(arrayExpression).States; |
General Comments 0
You need to be logged in to leave comments.
Login now