Пример #1
0
        public static IArgument ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            if (word.Text == "\n" || word.Text == ";")
            {
                return(null);
            }
            switch (word.Text)
            {
            case "[":     //  bracket
                Bracket bracket = Bracket.ParseCreate(word, parsedDocument);
                return(bracket);

            case "{":     // brace
                Brace brace = Brace.ParseCreate(word, parsedDocument);
                return(brace);

            case "\"":     // quote
                Quote quote = Quote.ParseCreate(word, parsedDocument);
                return(quote);

            default:
                Text text = Text.ParseCreate(word, parsedDocument);
                return(text);
            }
        }
Пример #2
0
        public static Bracket ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Bracket bracket = new Bracket();

            word.Color(CodeDrawStyle.ColorType.Keyword);
            word.MoveNext();

            while (!word.Eof)
            {
                if (word.Text == "]")
                {
                    word.Color(CodeDrawStyle.ColorType.Keyword);
                    word.MoveNext();
                    break;
                }
                word.MoveNext();
            }
            return(bracket);
        }