Indents used for conditional compilation directives: //#if, //#else, //#elif, //#ifdef, //#ifndef.
コード例 #1
0
        private void PushIndent(IndentType type, int skip)
        {
            ScriptIndentation indent = new ScriptIndentation();

            indent.Type   = type;
            indent.Script = _scriptStack.Peek();
            indent.Skip   = (skip != 0) ? 1 : 0;

            _skip += indent.Skip;
            _indentStack.Push(indent);
        }
コード例 #2
0
        private void PopIndent(out IndentType type, out int skip)
        {
            type = 0;
            skip = 0;

            if (_indentStack.Count == 0)
            {
                return;
            }

            ScriptIndentation indent = _indentStack.Peek();

            // must be an indent from the current script
            if (indent.Script != _scriptStack.Peek())
            {
                return;
            }

            type = indent.Type;
            skip = indent.Skip;

            _indentStack.Pop();
            _skip -= indent.Skip;
        }
コード例 #3
0
		private void PushIndent(IndentType type, int skip)
		{
			ScriptIndentation indent = new ScriptIndentation();
			indent.Type = type;
			indent.Script = _scriptStack.Peek();
			indent.Skip = (skip != 0) ? 1 : 0;

			_skip += indent.Skip;
			_indentStack.Push(indent);
		}