Ejemplo n.º 1
0
        public override void Visit(Literal literal)
        {
            if (TrimFloatSuffix && literal.Value is float)
                literal.Text = literal.Text.Trim('f', 'F', 'l', 'L');

            base.Visit(literal);
        }
Ejemplo n.º 2
0
        public virtual void Visit(Literal literal)
        {
            if (literal == null)
            {
                return;
            }

            var isStringLiteral = literal.Value is string && !literal.Text.StartsWith("\"");
            if (isStringLiteral)
            {
                Write("\"");
            }
            if (literal.SubLiterals != null && literal.SubLiterals.Count > 0)
            {
                foreach (var subLiteral in literal.SubLiterals) Write(subLiteral.Text);
            }
            else Write(literal.Text);
            if (isStringLiteral)
            {
                Write("\"");
            }
        }
Ejemplo n.º 3
0
 public LiteralIdentifier(Literal valueName)
     : base(valueName.ToString())
 {
     Value = valueName;
 }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public bool Equals(Literal other)
 {
     if (ReferenceEquals(null, other))
     {
         return false;
     }
     if (ReferenceEquals(this, other))
     {
         return true;
     }
     return Equals(other.value, value);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LiteralExpression"/> class.
 /// </summary>
 /// <param name="value">
 /// The value.
 /// </param>
 public LiteralExpression(object value)
 {
     Literal = new Literal(value);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LiteralExpression"/> class.
 /// </summary>
 /// <param name="literal">
 /// The literal.
 /// </param>
 public LiteralExpression(Literal literal)
 {
     Literal = literal;
 }