Example #1
0
		public void Push()
		{
			var oldBuf = Buf;
			_stack.Add (Buf);
			Buf = new JsEmitBuffer();
			Buf.EmitContext = this;
			Buf.IndentLevel = oldBuf.IndentLevel; 
		}
Example #2
0
		public void Stash(string id)
		{
			var oldBuf = Buf;
			_stash[id] = Buf;
			Buf = new JsEmitBuffer();
			Buf.EmitContext = this;
			Buf.IndentLevel = oldBuf.IndentLevel; 
		}
Example #3
0
		public JsEmitBuffer Pop()
		{
			var ret = Buf;
			Buf = _stack[_stack.Count - 1];
			_stack.RemoveAt(_stack.Count - 1);
			return ret;
		}
Example #4
0
		public JsEmitContext(ModuleContainer module)
		{
			Module = module;
			Buf = new JsEmitBuffer();
			Buf.EmitContext = this;
		}
Example #5
0
		public void Restore(string id)
		{
			Buf = _stash[id];
		}