private string GetTypeString(ITree parameterType) { if (parameterType != null && parameterType.Type == GoLexer.ELLIP && parameterType.ChildCount == 1) { return("..." + GetTypeString(parameterType.GetChild(0))); } return(GoTypeFormatter.FormatType(parameterType)); }
public static string FormatType(ITree typeTree) { if (typeTree == null) { return("<null>"); } try { CommonTreeNodeStream input = new CommonTreeNodeStream(typeTree); GoTypeFormatter formatter = new GoTypeFormatter(input); return(formatter.type()); } catch (Exception e) when(!ErrorHandler.IsCriticalException(e)) { return("?"); } }
public static string FormatType(ITree typeTree) { if (typeTree == null) return "<null>"; try { CommonTreeNodeStream input = new CommonTreeNodeStream(typeTree); GoTypeFormatter formatter = new GoTypeFormatter(input); return formatter.type(); } catch (Exception e) { if (ErrorHandler.IsCriticalException(e)) throw; return "?"; } }