// Clone the CSharpIndentEngine - useful if a consumer of this class wants
        // to test things w/o changing the real indent engine state
        public object Clone()
        {
            CSharpIndentEngine engine = new CSharpIndentEngine(policy, textPolicy);

            engine.stack   = (IndentStack)stack.Clone();
            engine.linebuf = new StringBuilder(linebuf.ToString(), linebuf.Capacity);

            engine.keyword   = keyword;
            engine.curIndent = curIndent;

            engine.needsReindent = needsReindent;
            engine.popVerbatim   = popVerbatim;
            engine.canBeLabel    = canBeLabel;
            engine.isEscaped     = isEscaped;

            engine.firstNonLwsp = firstNonLwsp;
            engine.lastNonLwsp  = lastNonLwsp;
            engine.wordStart    = wordStart;

            engine.prc = prc;
            engine.pc  = pc;
            engine.rc  = rc;

            engine.curLineNr = curLineNr;
            engine.cursor    = cursor;

            return(engine);
        }
예제 #2
0
            public IndentStack(CSharpIndentEngine engine, int capacity)
            {
                this.engine = engine;
                if (capacity < INITIAL_CAPACITY)
                {
                    capacity = INITIAL_CAPACITY;
                }

                this.stack = new Node [capacity];
                this.size  = 0;
            }
			public IndentStack (CSharpIndentEngine engine, int capacity)
			{
				this.engine = engine;
				if (capacity < INITIAL_CAPACITY)
					capacity = INITIAL_CAPACITY;
				
				this.stack = new Node [capacity];
				this.size = 0;
			}
			public IndentStack (CSharpIndentEngine engine) : this (engine, INITIAL_CAPACITY)
			{
			}
예제 #5
0
 public IndentStack(CSharpIndentEngine engine) : this(engine, INITIAL_CAPACITY)
 {
 }
		// Clone the CSharpIndentEngine - useful if a consumer of this class wants
		// to test things w/o changing the real indent engine state
		public object Clone ()
		{
			CSharpIndentEngine engine = new CSharpIndentEngine (policy, textPolicy);
			
			engine.stack = (IndentStack) stack.Clone ();
			engine.linebuf = new StringBuilder (linebuf.ToString (), linebuf.Capacity);
			
			engine.keyword = keyword;
			engine.curIndent = curIndent;
			
			engine.needsReindent = needsReindent;
			engine.popVerbatim = popVerbatim;
			engine.canBeLabel = canBeLabel;
			engine.isEscaped = isEscaped;
			
			engine.firstNonLwsp = firstNonLwsp;
			engine.lastNonLwsp = lastNonLwsp;
			engine.wordStart = wordStart;
			
			engine.prc = prc;
			engine.pc = pc;
			engine.rc = rc;
			
			engine.curLineNr = curLineNr;
			engine.cursor = cursor;
			
			return engine;
		}