Ejemplo n.º 1
0
        private System.Drawing.Color ApplyFormatting(ref string Token, Vocab TheSyntax, bool AllowNewLines)
        {
            Color DaCol = Color.Black;

            //Global Replace
            if (TheSyntax.Items.ContainsKey(Token))
            {
                //we do a ting then apply
                DaCol = DockerSyntax.Items[Token].Color;
            }

            //prefixes
            foreach (KeyValuePair <string, Color> kvp in TheSyntax.Prefixes)
            {
                int Len = kvp.Key.Length;
                if (Token.Length > Len)
                {
                    if ((Token.Substring(0, Len)) == kvp.Key)
                    {
                        // Do the whole token
                        DaCol = kvp.Value;

                        //silly rules
                        if (kvp.Key == "--")
                        {
                            if (AllowNewLines)
                            {
                                Token = "\r\n" + Token;
                            }
                        }

                        break; //We foudn summat, no need to ncontinues
                    }
                }
            }

            return(DaCol);
        }
Ejemplo n.º 2
0
        private void initVocab()
        {
            string DaLingPath = System.Environment.CurrentDirectory + "\\Language.json";

            DockerSyntax = new Vocab(DaLingPath);
        }