Skip to content

Commit d5e8f64

Browse files
committed
refactor: invalid commands emit error messages
1 parent a567f80 commit d5e8f64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/AST/ParseJavadoc.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,11 @@ convertCopydoc(unsigned id)
619619
case CommandTraits::KCI_copydetails:
620620
return doc::Parts::description;
621621
default:
622+
{
623+
report::error("error: unsupported CommandTrait id <{}>", id);
622624
MRDOCS_UNREACHABLE();
623625
}
626+
}
624627
}
625628

626629
static
@@ -640,6 +643,7 @@ convertStyle(InlineCommandRenderKind kind)
640643
return doc::Style::none;
641644
default:
642645
// unknown RenderKind
646+
report::error("error: unsupported InlineCommandRenderKind <{}>", static_cast<int>(kind));
643647
MRDOCS_UNREACHABLE();
644648
}
645649
}
@@ -657,6 +661,7 @@ convertDirection(ParamCommandPassDirection kind)
657661
case ParamCommandPassDirection::InOut:
658662
return doc::ParamDirection::inout;
659663
default:
664+
report::error("error: unsupported ParamCommandPassDirection <{}>", static_cast<int>(kind));
660665
MRDOCS_UNREACHABLE();
661666
}
662667
}
@@ -1240,9 +1245,10 @@ visitBlockCommandComment(
12401245
case CommandTraits::KCI_copybrief:
12411246
case CommandTraits::KCI_copydetails:
12421247
case CommandTraits::KCI_copydoc:
1248+
report::error("error: inline command {} should be handled elsewhere", cmd->Name);
12431249
MRDOCS_UNREACHABLE();
1244-
12451250
default:
1251+
report::error("error: unsupported block command {}", cmd->Name);
12461252
MRDOCS_UNREACHABLE();
12471253
}
12481254
}

0 commit comments

Comments
 (0)