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

Refine error handling and debugger/diagnostics #19

Open
MatthewKosloski opened this issue Sep 18, 2021 · 0 comments
Open

Refine error handling and debugger/diagnostics #19

MatthewKosloski opened this issue Sep 18, 2021 · 0 comments
Labels
feature New feature or request

Comments

@MatthewKosloski
Copy link
Owner

I'm not too happy with how error handling and diagnostic messages are created/managed/displayed.

For example, there's this in X8664PCLinuxBackend:

debug("x86-64 program (output from Generator): %s\n", 
            x86Program.toString());

And this in Generator:

throw new Error("Cannot generate x86 instruction");

And finally this in the Grammar:

reporter.throwSyntaxError(peek(), ErrorMessages.ExpectedExpr,
            peek().rawText());

We should look at how existing compilers (e.g., TypeScript) handle such mechanisms and refine how we do it in the Torrey compiler so it's more consistent and the API is easy to understand.

@MatthewKosloski MatthewKosloski added the feature New feature or request label Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant