diff Implab/Formats/JSON/JSONScanner.cs @ 183:4f82e0f161c3 ref20160224

fixed DFA optimization, JSON is fully functional
author cin
date Fri, 25 Mar 2016 02:49:02 +0300
parents c32688129f14
children 7d07503621fe
line wrap: on
line diff
--- a/Implab/Formats/JSON/JSONScanner.cs	Thu Mar 24 18:52:10 2016 +0300
+++ b/Implab/Formats/JSON/JSONScanner.cs	Fri Mar 25 02:49:02 2016 +0300
@@ -46,7 +46,7 @@
         /// в строках обрабатываются экранированные символы, числа становтся типа double.</remarks>
         public bool ReadToken(out object tokenValue, out JsonTokenType tokenType) {
             JSONGrammar.TokenType[] tag;
-            if (m_jsonContext.Execute(m_scanner, out tag)) {
+            while (m_jsonContext.Execute(m_scanner, out tag)) {
                 switch (tag[0]) {
                     case JSONGrammar.TokenType.StringBound:
                         tokenValue = ReadString();
@@ -56,6 +56,8 @@
                         tokenValue = Double.Parse(m_scanner.GetTokenValue(), CultureInfo.InvariantCulture);
                         tokenType = JsonTokenType.Number;
                         break;
+                    case JSONGrammar.TokenType.Whitespace:
+                        continue;
                     default:
                         tokenType = (JsonTokenType)tag[0];
                         tokenValue = m_scanner.GetTokenValue();