1049{
1051 DString result;
1053
1055 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
1056 {
1058 {
1059 switch (tok.
value())
1060 {
1061 case TokenRetval::TK_COMMAND_AT:
1062
1063 case TokenRetval::TK_COMMAND_BS:
1065 {
1067 if (isJavaLink)
1068 {
1071 }
1072 goto endlink;
1073 default:
1076 break;
1077 }
1078 break;
1079 case TokenRetval::TK_SYMBOL:
1080 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Unsupported symbol '{}' found as part of a \\link",
1081 parser()->context.token->name);
1082 break;
1083 case TokenRetval::TK_HTMLTAG:
1084 if (
parser()->context.token->name!=
"see" || !isXmlLink)
1085 {
1086 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Unexpected xml/html command {} found as part of a \\link",
1087 parser()->context.token->name);
1088 }
1089 goto endlink;
1090 case TokenRetval::TK_LNKWORD:
1091 case TokenRetval::TK_WORD:
1092 if (isJavaLink)
1093 {
1095 size_t p = 0;
1096 if (w=="}")
1097 {
1098 goto endlink;
1099 }
1101 {
1104 if (l>1 && p<l-1)
1105 {
1106 result=w.
right(l-p-1);
1107 }
1108 goto endlink;
1109 }
1110 }
1112 break;
1113 default:
1115 break;
1116 }
1117 }
1119 }
1120 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1121 {
1123 parser()->tokenizer.getLineNr(),
1124 "Unexpected end of comment while inside link command");
1125 }
1126endlink:
1127
1129 {
1131 }
1132
1134 return result;
1135}
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
DString right(size_t len) const
size_t find(char c, size_t pos=0) const
DString left(size_t len) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DocNodeVariant * thisVariant()
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children, size_t numberOfElementsToClose=0)
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
bool is_any_of(ARGS... args) const
char command_to_char() const
const Mapper< CommandType > * cmdMapper