Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        public static Brace ParseCreate(WordScanner word, ParsedDocument parsedDocument)
        {
            Brace brace = new Brace();

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

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