public void RegisterParameters(ParsingData parser) { Constructors = new Constructor[ConstructorNodes.Length]; for (int i = 0; i < Constructors.Length; i++) { if (ConstructorNodes[i].Name != Name) { throw SyntaxErrorException.ConstructorName(ConstructorNodes[i].Location); } Constructors[i] = new Constructor(parser, ConstructorNodes[i]); } }
public void RegisterParameters(ParsingData parser) { if (ConstructorNodes.Length != 0) { Constructors = new Constructor[ConstructorNodes.Length]; for (int i = 0; i < Constructors.Length; i++) { if (ConstructorNodes[i].Name != Name) { throw SyntaxErrorException.ConstructorName(ConstructorNodes[i].Location); } Constructors[i] = new Constructor(parser, ConstructorNodes[i]); } } else { Constructors = new Constructor[] { new Constructor(AccessLevel.Public, new Parameter[0], null) }; } }