Inheritance: PathSegment
        private static string ProcessRoot(Root node)
        {
            if (node.Text != "") //windows root
                return Regex.Escape(node.Text);

            if (!string.IsNullOrEmpty(node.Text)) // CWD
                return Regex.Escape(node.Text);

            return string.Empty;
        }
Esempio n. 2
0
        private Root ParseRoot()
        {
            if (this._currentToken.Kind == TokenKind.PathSeperator)
                return new Root(); //dont eat it so we can leave it for the segments

            if (this._currentToken.Kind == TokenKind.WindowsRoot)
            {
                var root = new Root(this._currentToken.Spelling);
                this.Accept(TokenKind.WindowsRoot);
                return root;
            }

            return new Root();
        }