Ejemplo n.º 1
0
 private static Expression ParseNumber(ref Token token, TokensQueue queue)
 {
     var inner = new NumberExpression(token.NumberValue);
     if (!queue.Empty) {
         var preview = queue.Peek();
         if (preview.Type == TokenType.Literal || preview.Type == TokenType.Percentage) {
             var unitToken = queue.Read();
             var unit = ParseUnit(ref unitToken);
             return new UnitExpression(inner, unit);
         }
     }
     return inner;
 }
Ejemplo n.º 2
0
 public static void AreEqual(NumberExpression expected, NumberExpression actual, string message = "")
 {
     Assert.AreEqual(expected.Value, actual.Value, message + "/Value");
 }