prequel/error/parse_error

Types

TODO: document these errors and when each one makes sense with a little example

pub type ParseError {
  WrongEntityName(
    hint: Option(String),
    enclosing_definition: Option(Span),
    before_wrong_name: Span,
    wrong_name: String,
    wrong_name_span: Span,
    after_what: String,
  )
  MoreThanOneHierarchy(
    hint: Option(String),
    enclosing_entity: Span,
    first_hierarchy_span: Span,
    other_hierarchy_span: Span,
  )
  PossibleCircleLollipopTypo(
    hint: Option(String),
    enclosing_definition: Span,
    typo_span: Span,
  )
  PossibleStarLollipopTypo(
    hint: Option(String),
    enclosing_definition: Span,
    typo_span: Span,
  )
  PossibleArrowLollipopTypo(
    hint: Option(String),
    enclosing_definition: Span,
    typo_span: Span,
  )
  WrongOrderOfHierarchyQualifiers(
    hint: Option(String),
    enclosing_entity: Span,
    qualifiers_span: Span,
    first_qualifier: String,
    second_qualifier: String,
  )
  UnqualifiedHierarchy(
    hint: Option(String),
    enclosing_entity: Span,
    hierarchy_span: Span,
  )
  UnexpectedTokenInEntityBody(
    hint: Option(String),
    enclosing_entity: Span,
    token_span: Span,
  )
  WrongAttributeName(
    hint: Option(String),
    enclosing_definition: Span,
    lollipop_span: Span,
    wrong_name: String,
    wrong_name_span: Span,
  )
  WrongCardinalityAnnotation(
    hint: Option(String),
    enclosing_definition: Span,
    before_wrong_cardinality: Span,
    wrong_cardinality: String,
    wrong_cardinality_span: Span,
  )
  WrongKeyName(
    hint: Option(String),
    enclosing_entity: Span,
    lollipop_span: Span,
    wrong_key: String,
    wrong_key_span: Span,
  )
  TypeAnnotationOnComposedKey(
    hint: Option(String),
    enclosing_entity: Span,
    keywords_span: Span,
    colon_span: Span,
  )
  MissingCardinalityAnnotation(
    hint: Option(String),
    enclosing_definition: Span,
    before_span: Span,
  )
  WrongRelationshipName(
    hint: Option(String),
    enclosing_definition: Option(Span),
    before_wrong_name: Span,
    wrong_name: String,
    wrong_name_span: Span,
  )
  KeyInsideRelationship(
    hint: Option(String),
    enclosing_relationship: Span,
    lollipop_span: Span,
  )
  UnexpectedTokenInBinaryRelationship(
    hint: Option(String),
    enclosing_relationship: Span,
    token_span: Span,
  )
  WrongHierarchyOverlapping(
    hint: Option(String),
    enclosing_entity: Span,
    before_wrong_overlapping: Span,
    wrong_overlapping: String,
    wrong_overlapping_span: Span,
  )
  MissingHierarchyKeyword(
    hint: Option(String),
    enclosing_entity: Span,
    qualifiers_span: Span,
  )
  EmptyHierarchy(
    hint: Option(String),
    enclosing_entity: Span,
    hierarchy_span: Span,
  )
  UnexpectedTokenInHierarchyBody(
    hint: Option(String),
    enclosing_hierarchy: Span,
    token_span: Span,
  )
  RelationshipBodyWithNoEntities(
    hint: Option(String),
    relationship_span: Span,
  )
  RelationshipBodyWithJustOneEntity(
    hint: Option(String),
    relationship_span: Span,
    relationship_name: String,
    entity_span: Span,
  )
  UnexpectedTokenInRelationshipBody(
    hint: Option(String),
    enclosing_relationship: Span,
    token_span: Span,
  )
  UnexpectedTokenInTopLevel(
    hint: Option(String),
    token_span: Span,
  )
  WrongLetterInUnboundedCardinality(
    hint: Option(String),
    enclosing_definition: Span,
    wrong_letter_span: Span,
  )
  IncompleteCardinality(
    hint: Option(String),
    enclosing_definition: Span,
    cardinality_span: Span,
    missing: String,
  )
  UnexpectedEndOfFile(
    hint: Option(String),
    enclosing_definition: Option(Span),
    context_span: Span,
    context: String,
  )
  InternalError(
    hint: Option(String),
    enclosing_definition: Option(Span),
    context_span: Span,
    context: String,
  )
  IncompleteComposedKey(
    hint: Option(String),
    composed_key_span: Span,
    enclosing_entity: Span,
    wrong_key: String,
    wrong_key_span: Span,
  )
}

Constructors

  • WrongEntityName(
      hint: Option(String),
      enclosing_definition: Option(Span),
      before_wrong_name: Span,
      wrong_name: String,
      wrong_name_span: Span,
      after_what: String,
    )
  • MoreThanOneHierarchy(
      hint: Option(String),
      enclosing_entity: Span,
      first_hierarchy_span: Span,
      other_hierarchy_span: Span,
    )
  • PossibleCircleLollipopTypo(
      hint: Option(String),
      enclosing_definition: Span,
      typo_span: Span,
    )
  • PossibleStarLollipopTypo(
      hint: Option(String),
      enclosing_definition: Span,
      typo_span: Span,
    )
  • PossibleArrowLollipopTypo(
      hint: Option(String),
      enclosing_definition: Span,
      typo_span: Span,
    )
  • WrongOrderOfHierarchyQualifiers(
      hint: Option(String),
      enclosing_entity: Span,
      qualifiers_span: Span,
      first_qualifier: String,
      second_qualifier: String,
    )
  • UnqualifiedHierarchy(
      hint: Option(String),
      enclosing_entity: Span,
      hierarchy_span: Span,
    )
  • UnexpectedTokenInEntityBody(
      hint: Option(String),
      enclosing_entity: Span,
      token_span: Span,
    )
  • WrongAttributeName(
      hint: Option(String),
      enclosing_definition: Span,
      lollipop_span: Span,
      wrong_name: String,
      wrong_name_span: Span,
    )
  • WrongCardinalityAnnotation(
      hint: Option(String),
      enclosing_definition: Span,
      before_wrong_cardinality: Span,
      wrong_cardinality: String,
      wrong_cardinality_span: Span,
    )
  • WrongKeyName(
      hint: Option(String),
      enclosing_entity: Span,
      lollipop_span: Span,
      wrong_key: String,
      wrong_key_span: Span,
    )
  • TypeAnnotationOnComposedKey(
      hint: Option(String),
      enclosing_entity: Span,
      keywords_span: Span,
      colon_span: Span,
    )
  • MissingCardinalityAnnotation(
      hint: Option(String),
      enclosing_definition: Span,
      before_span: Span,
    )
  • WrongRelationshipName(
      hint: Option(String),
      enclosing_definition: Option(Span),
      before_wrong_name: Span,
      wrong_name: String,
      wrong_name_span: Span,
    )
  • KeyInsideRelationship(
      hint: Option(String),
      enclosing_relationship: Span,
      lollipop_span: Span,
    )
  • UnexpectedTokenInBinaryRelationship(
      hint: Option(String),
      enclosing_relationship: Span,
      token_span: Span,
    )
  • WrongHierarchyOverlapping(
      hint: Option(String),
      enclosing_entity: Span,
      before_wrong_overlapping: Span,
      wrong_overlapping: String,
      wrong_overlapping_span: Span,
    )
  • MissingHierarchyKeyword(
      hint: Option(String),
      enclosing_entity: Span,
      qualifiers_span: Span,
    )
  • EmptyHierarchy(
      hint: Option(String),
      enclosing_entity: Span,
      hierarchy_span: Span,
    )
  • UnexpectedTokenInHierarchyBody(
      hint: Option(String),
      enclosing_hierarchy: Span,
      token_span: Span,
    )
  • RelationshipBodyWithNoEntities(
      hint: Option(String),
      relationship_span: Span,
    )
  • RelationshipBodyWithJustOneEntity(
      hint: Option(String),
      relationship_span: Span,
      relationship_name: String,
      entity_span: Span,
    )
  • UnexpectedTokenInRelationshipBody(
      hint: Option(String),
      enclosing_relationship: Span,
      token_span: Span,
    )
  • UnexpectedTokenInTopLevel(hint: Option(String), token_span: Span)
  • WrongLetterInUnboundedCardinality(
      hint: Option(String),
      enclosing_definition: Span,
      wrong_letter_span: Span,
    )
  • IncompleteCardinality(
      hint: Option(String),
      enclosing_definition: Span,
      cardinality_span: Span,
      missing: String,
    )
  • UnexpectedEndOfFile(
      hint: Option(String),
      enclosing_definition: Option(Span),
      context_span: Span,
      context: String,
    )
  • InternalError(
      hint: Option(String),
      enclosing_definition: Option(Span),
      context_span: Span,
      context: String,
    )
  • IncompleteComposedKey(
      hint: Option(String),
      composed_key_span: Span,
      enclosing_entity: Span,
      wrong_key: String,
      wrong_key_span: Span,
    )

Functions

pub fn to_report(error: ParseError, file_name: String, source_code: String) -> Report
Search Document