Ejemplo n.º 1
0
        public static string ToRelString(this Rel relation)
        {
            //UglyPatch
            var str = relation == Rel._None
                ? string.Empty
                : string.Join("-", Regex.Split(relation.ToString().Replace(",", ""), "(?<=[a-z])(?=[A-Z])")).ToLower();

            return(string.Join(" ", str.Split(' ').Where(x => !x.StartsWith("_"))));
        }
Ejemplo n.º 2
0
        public void TestRel()
        {
            var isLess = new Rel(new Token('<'), new Constant(10), new Constant(100));

            Assert.AreEqual("10 < 100", isLess.ToString());

            isLess.Jumping(42, 99);
            //output:
            //        if 10 < 100 goto L42
            //        goto L99
        }