# HG changeset patch # User cin # Date 2014-06-22 00:14:02 # Node ID 62b440d46313099dffc61de8ebaba7d78613f06c # Parent 90069a2ec20aa8630765d546d6e2073b59ef0e39 Added Skip method to JSON parser to skip contents of the current node 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; } }