Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance error message verbosity #38

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

Lai-YT
Copy link
Collaborator

@Lai-YT Lai-YT commented Sep 15, 2023

What's the Problem?

To reproduce the issue, first, create a test file under the project root using the following command:

touch test.c
cat << EOF > test.c
int main() {
  return -1 * 2;
}
EOF

Next, compile the test file with VitaminC.
As of now, we don't yet support unary -, resulting in the "syntax error" message:

./vitaminc < test.c
# syntax error

As you can see, this error message lacks detail and doesn't provide insights into the actual error.

This pull request introduces an improvement by enhancing the error message verbosity:

./vitaminc < test.c
# syntax error, unexpected '-', expecting NUM or ID or '('

With this change, the error message is now more informative and helps in diagnosing the issue.

@Lai-YT Lai-YT requested a review from leewei05 September 15, 2023 06:46
@Lai-YT Lai-YT self-assigned this Sep 15, 2023
@Lai-YT Lai-YT changed the title Enable verbose error messages Enhance error message verbosity Sep 15, 2023
Copy link
Contributor

@leewei05 leewei05 left a comment

Choose a reason for hiding this comment

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

LGTM! 🎸

@leewei05 leewei05 merged commit cedac9b into fruits-lab:main Sep 15, 2023
2 checks passed
@Lai-YT Lai-YT deleted the enable-verbose-error-messages branch September 15, 2023 15:29
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