diff --git a/Implab/JSON/JSONParser.cs b/Implab/JSON/JSONParser.cs --- a/Implab/JSON/JSONParser.cs +++ b/Implab/JSON/JSONParser.cs @@ -250,6 +250,15 @@ namespace Implab.JSON { ~JSONParser() { Dispose(false); } + + public void Skip() { + var level = Level-1; + + Debug.Assert(level >= 0); + + while (Level != level) + Read(); + } } } diff --git a/Implab/Parsing/DFAutomaton.cs b/Implab/Parsing/DFAutomaton.cs --- a/Implab/Parsing/DFAutomaton.cs +++ b/Implab/Parsing/DFAutomaton.cs @@ -20,7 +20,7 @@ namespace Implab.Parsing { protected ContextFrame m_context; Stack m_contextStack = new Stack(); - public int Level { + protected int Level { get { return m_contextStack.Count; } }