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 ?? ""}'"); }
/// <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()})"); }
/// <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()})"); }