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

Better compiler error messages #4

Open
Cthaeeh opened this issue Apr 20, 2019 · 1 comment
Open

Better compiler error messages #4

Cthaeeh opened this issue Apr 20, 2019 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Cthaeeh
Copy link

Cthaeeh commented Apr 20, 2019

Hi,
I don't know if its possible but maybe this can be somehow handled better:

If I have a grammar rule like so:

cppcmb_def(expr) = pc::pass
                   | (expr & match<Token::PLUS> & primary) [BinaryExpr::make]
                   | (expr & match<Token::MINUS> & primary) [BinaryExpr::make]
                   | primary
                   %= pc::as_memo_d;

And the method looks like this:

class BinaryExpr: public Expr {
       static ExprPtr  make(ExprPtr left_ ,ExprPtr right_ , Token op_ )
}

Can we have better error messages, that indicate what was wrong?

@LPeter1997 LPeter1997 added the good first issue Good for newcomers label Apr 21, 2019
@LPeter1997
Copy link
Owner

Hi!
Thank you for your input. I'm aware of this issue and I'm trying to find a way to improve errors - with partial success so far.
I'm sure you are aware of how to actually reorder your parameters to fix your issue:

(expr & match<Token::PLUS> & primary) [pc::select<0, 2, 1>] [BinaryExpr::make]

Improved error messages are very important and I'd like to improve them as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants