Example #1
0
        public static LiteralNode Create(ContextNode context, IConvertible value, SequencePoint point)
        {
            var type = MetadataHelpers.GetBuiltInTypeReference(context.Parser.Assembly, value.GetType());

            if (type == null)
            {
                Errors.ReportAndThrow(ErrorCode.TypeMismatch, point, "Cannot create literal of type {0} with value {1}",
                                      value.GetType().FullName, value);
            }

            return(new LiteralNode(value, type, point));
        }