コード例 #1
0
        /// <summary>
        /// Converts to string.
        /// </summary>
        /// <returns>
        /// A <see cref="string" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            switch (Kind)
            {
            case ConstKind.Int:
            case ConstKind.Float:
            case ConstKind.Class:
                return(ConstValue.ToString());

            case ConstKind.Fun:
                return($"_fun {ConstValue}");

            case ConstKind.Str:
                return($"\"{ConstValue}\"");
            }
            return("Constant");
        }