Skip to content

Comments

parsingTree#33

Open
Andrw-404 wants to merge 3 commits intomainfrom
hw8-parsingTree
Open

parsingTree#33
Andrw-404 wants to merge 3 commits intomainfrom
hw8-parsingTree

Conversation

@Andrw-404
Copy link
Owner

No description provided.

Copy link

@yurii-litvinov yurii-litvinov left a comment

Choose a reason for hiding this comment

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

Да в целом всё хорошо, только чуть поправить error reporting


Node* createOperationNode(char operation, Node* left, Node* right) {
Node* newNode = malloc(sizeof(Node));
newNode->operation = operation;

Choose a reason for hiding this comment

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

Надо проверять результат malloc и сообщать вызывающему, если что-то пошло не так


skipSpace(file);
if (fgetc(file) != ')') {
exit(1);

Choose a reason for hiding this comment

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

Не используйте exit, используйте честный механизм обработки ошибок с кодами ошибок

return leftValue * rightValue;
case '/':
if (rightValue == 0) {
printf("Деление на ноль!\n");

Choose a reason for hiding this comment

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

Не общайтесь с пользователем вне main-а

Copy link

@yurii-litvinov yurii-litvinov left a comment

Choose a reason for hiding this comment

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

👍

}
}

bool verify(int* errorCode) {

Choose a reason for hiding this comment

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

Можно было более подходящее название, например, printError

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