private void PushIndent(IndentType type, int skip) { ScriptIndentation indent = new ScriptIndentation(); indent.Type = type; indent.Script = _scriptStack.Peek(); indent.Skip = (skip != 0) ? 1 : 0; _skip += indent.Skip; _indentStack.Push(indent); }
private void PopIndent(out IndentType type, out int skip) { type = 0; skip = 0; if (_indentStack.Count == 0) { return; } ScriptIndentation indent = _indentStack.Peek(); // must be an indent from the current script if (indent.Script != _scriptStack.Peek()) { return; } type = indent.Type; skip = indent.Skip; _indentStack.Pop(); _skip -= indent.Skip; }