public Specification Read() { int number = 0; string line = null; while ((line = _reader.ReadLine()) != null) { number++; try { var indention = line.LeadingSpaces(); parseLine(indention, line.Trim()); } catch (Exception e) { var message = $"Reading the markdown file '{_spec.Filename}' errored out on line {number}{Environment.NewLine}{e.ToString()}"; _spec.AddError(new SpecError { location = new string[] { "Specification" }, message = message }); _spec.Children.Insert(0, new Comment { Text = message }); break; } } return(_spec); }