parse static method

Reference parse(
  1. String ref, {
  2. BibleLanguageEnum? language,
})

Parses a Bible reference string, automatically determining whether it's a single verse or range.

This method classifies range syntax first, avoiding ambiguity between an ending book name and the leading book token of a single verse.

Parameters:

  • ref: The Bible reference string to parse
  • language: Optional language for book name parsing. Defaults to auto-detection.

Returns: A VerseRef or VerseRangeRef instance

Throws: ParseVerseRefError if parsing fails

Example:

final verse = Reference.parse("John 3:16"); // VerseRef
final range = Reference.parse("John 3:16-17"); // VerseRangeRef

Implementation

static Reference parse(String ref, {BibleLanguageEnum? language}) {
  return _standardReferenceParser.parse(ref, language: language);
}