Beispiel #1
0
        public override string ToString()
        {
            string tokenTypeString = (Type + "                                                      ").Substring(0, 16);
            string location        = $"{FromLine.ToString()}:{FromCol.ToString()}-{ToLine.ToString()}:{ToCol.ToString()}";

            location = (location + "                                                      ").Substring(0, 10);

            return($"{tokenTypeString}  - {location} - '{this.Text ?? ""}'");
        }
Beispiel #2
0
        /// <summary>
        /// Formats the location according to script preferences
        /// </summary>
        /// <param name="script">The script.</param>
        public string FormatLocation(Script script)
        {
            if (IsClrLocation)
            {
                return("[clr]");
            }

            if (FromLine == ToLine)
            {
                if (FromChar == ToChar)
                {
                    return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()})");
                }

                return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()}-{ToChar.ToString()})");
            }

            return($"(Line {FromLine.ToString()}, Position {FromChar.ToString()}-{ToLine.ToString()},{ToChar.ToString()})");
        }
Beispiel #3
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return($"{(IsStepStop ? "*" : " ")} ({FromLine.ToString()}, {FromChar.ToString()}) -> ({ToLine.ToString()}, {ToChar.ToString()})");
 }