webmcp
diff framework/env/trace/_close_section.lua @ 0:9fdfb27f8e67
Version 1.0.0
author | jbe/bsw |
---|---|
date | Sun Oct 25 12:00:00 2009 +0100 (2009-10-25) |
parents | |
children | ca44dff90b4e |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/framework/env/trace/_close_section.lua Sun Oct 25 12:00:00 2009 +0100 1.3 @@ -0,0 +1,9 @@ 1.4 +function trace._close_section() 1.5 + local pos = #trace._stack 1.6 + local closed_section = trace._stack[pos] 1.7 + if not closed_section then 1.8 + error("All trace sections have been closed already.") 1.9 + end 1.10 + trace._stack[pos] = nil 1.11 + return closed_section 1.12 +end