Skip to content

Commit

Permalink
refactor: invalid commands emit error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed May 29, 2024
1 parent a567f80 commit d5e8f64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/AST/ParseJavadoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,11 @@ convertCopydoc(unsigned id)
case CommandTraits::KCI_copydetails:
return doc::Parts::description;
default:
{
report::error("error: unsupported CommandTrait id <{}>", id);
MRDOCS_UNREACHABLE();
}
}
}

static
Expand All @@ -640,6 +643,7 @@ convertStyle(InlineCommandRenderKind kind)
return doc::Style::none;
default:
// unknown RenderKind
report::error("error: unsupported InlineCommandRenderKind <{}>", static_cast<int>(kind));
MRDOCS_UNREACHABLE();
}
}
Expand All @@ -657,6 +661,7 @@ convertDirection(ParamCommandPassDirection kind)
case ParamCommandPassDirection::InOut:
return doc::ParamDirection::inout;
default:
report::error("error: unsupported ParamCommandPassDirection <{}>", static_cast<int>(kind));
MRDOCS_UNREACHABLE();
}
}
Expand Down Expand Up @@ -1240,9 +1245,10 @@ visitBlockCommandComment(
case CommandTraits::KCI_copybrief:
case CommandTraits::KCI_copydetails:
case CommandTraits::KCI_copydoc:
report::error("error: inline command {} should be handled elsewhere", cmd->Name);
MRDOCS_UNREACHABLE();

default:
report::error("error: unsupported block command {}", cmd->Name);
MRDOCS_UNREACHABLE();
}
}
Expand Down

0 comments on commit d5e8f64

Please sign in to comment.