示例#1
0
文件: Parser.cs 项目: Mofsy/jinxbot
        void declaration(out Declaration dec)
        {
            dec = new Declaration();
            Expression exp = null;
            string ident = null;

            identity(out ident);
            dec.Name = ident;
            Expect(42);
            expr(out exp);
            dec.Expression = exp;
            if (la.kind == 43)
            {
                Get();
                dec.Important = true;
            }
        }
示例#2
0
        static string Render(Declaration dec)
        {
            StringBuilder txt = new StringBuilder();

            txt.AppendFormat("{0}: <span class=\"expression\">{1}</span>{2}", dec.Name, Render(dec.Expression), dec.Important ? " !important" : "");

            return txt.ToString();
        }