void OpenGroup(bool value) { count++; Join(); BitStack.Push(ref groupOperators); BitStack.SetCurrent(ref groupOperators, value); BitStack.Push(ref groupUsage); buffer.Append('('); }
public void Condition(string condition, params string[] others) { Join(); BitStack.SetCurrent(ref groupUsage, true); buffer.Append(condition); if (others != null) { foreach (var other in others) { buffer.Append(other); } } lastGoodClose = buffer.Length; }
public void Pop() { count--; if (BitStack.Pop(ref groupUsage)) { buffer.Append(')'); lastGoodClose = buffer.Length; if (count > 0) { BitStack.SetCurrent(ref groupUsage, true); } } else if (lastGoodClose > 0) { buffer.Length = lastGoodClose; } else { buffer.Length--; } BitStack.Pop(ref groupOperators); }