Skip to content

Homework #2#2

Open
mashfeii wants to merge 5 commits intomasterfrom
hm-2
Open

Homework #2#2
mashfeii wants to merge 5 commits intomasterfrom
hm-2

Conversation

@mashfeii
Copy link
Copy Markdown
Owner

The most interesting is pretty output in main by make run

Copy link
Copy Markdown
Collaborator

@tarasovxx tarasovxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом работы выполнена отлично!

stringCallback = callback;
}
void TokenParser::parse(const std::string& str) {
size_t token_start = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Коллбэки startCallback и endCallback должны вызываться в начале и в конце метода parse соответственно, а не в середине.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Блин! Я это заметил уже после сдачи как-то, да забыл исправить, ошибка глупейшая, видимо, в великолепном виме не те кнопочки натыкал 🙂

};

for (size_t i = 1; i != str.size() + 1; ++i) {
if (is_sep(str[i - 1]) && !is_sep(str[i])) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Инициализация переменных token_start, token_end и token_digits может быть перемещена внутрь цикла, чтобы избежать их повторного использования в каждой итерации.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кстати, а какой подход лучше: переменная создаётся внутри цикла или созданная снаружи, которая меняет значение?

stringCallback = callback;
}
void TokenParser::parse(const std::string& str) {
size_t token_start = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Метод parse должен корректно обрабатывать пустую строку

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants