1055{
1057 DString result;
1059
1061 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
1062 {
1064 {
1065 switch (tok.
value())
1066 {
1067 case TokenRetval::TK_COMMAND_AT:
1068
1069 case TokenRetval::TK_COMMAND_BS:
1071 {
1073 if (isJavaLink)
1074 {
1077 }
1078 goto endlink;
1079 default:
1082 break;
1083 }
1084 break;
1085 case TokenRetval::TK_SYMBOL:
1086 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Unsupported symbol '{}' found as part of a \\link",
1087 parser()->context.token->name);
1088 break;
1089 case TokenRetval::TK_HTMLTAG:
1090 if (
parser()->context.token->name!=
"see" || !isXmlLink)
1091 {
1092 warn_doc_error(
parser()->context.fileName,
parser()->tokenizer.getLineNr(),
"Unexpected xml/html command {} found as part of a \\link",
1093 parser()->context.token->name);
1094 }
1095 goto endlink;
1096 case TokenRetval::TK_LNKWORD:
1097 case TokenRetval::TK_WORD:
1098 if (isJavaLink)
1099 {
1101 size_t p = 0;
1102 if (w=="}")
1103 {
1104 goto endlink;
1105 }
1107 {
1110 if (l>1 && p<l-1)
1111 {
1112 result=w.
right(l-p-1);
1113 }
1114 goto endlink;
1115 }
1116 }
1118 break;
1119 default:
1121 break;
1122 }
1123 }
1125 }
1126 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1127 {
1129 parser()->tokenizer.getLineNr(),
1130 "Unexpected end of comment while inside link command");
1131 }
1132endlink:
1133
1135 {
1137 }
1138
1140 return result;
1141}
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