public void CloseScope(int offset)
{
// Make sure a scope is open
if (currentScope == null)
throw new Exception("You can not close a scope now, none are open.");
// Set the end offset for this scope and close it.
currentScope.OffsetEnd = offset;
currentScope = currentScope.ParentScope;
}