private ExceptionMember Resolve(ExceptionMember member) { return(member.DecomposeWithResult( @const => { var t = Resolve(@const.Type, @const.ExtendedAttributes); return ExceptionMember.Const(@const.Name, t.Item1, @const.Value, t.Item2.Select(Resolve)); }, field => { var t = Resolve(field.Type, field.ExtendedAttributes); return ExceptionMember.Field(field.Name, t.Item1, t.Item2.Select(Resolve)); } )); }
public static string Format(ExceptionMember member) { var f = new WebIDLFormatter(); f.Visit(member); return(f._sb.ToString()); }
private void Visit(ExceptionMember member) { member.Decompose( @const => { Visit(@const.ExtendedAttributes, ExtendedAttributeMode.Member); _sb.Append("const "); Visit(@const.Type); _sb.Append(" " + @const.Name + " = "); Visit(@const.Value); }, field => { Visit(field.ExtendedAttributes, ExtendedAttributeMode.Member); Visit(field.Type); _sb.Append(" " + field.Name); } ); _sb.AppendLine(";"); }
public static string Format(ExceptionMember member) { var f = new WebIDLFormatter(); f.Visit(member); return f._sb.ToString(); }