On Mon, May 26, 2014 at 8:31 PM, Terence Parr <pa...@cs.usfca.edu> wrote:
> Very interesting. Thanks for the clarifications. I can see how a misspelled 
> keyword could be better handled at character level, unless of course you mean 
> it to be an identifier. My intuition is that token level error handling would 
> provide more opportunities for clarity and natural recovery but I have 
> nothing to back this up.  indicating which rules are like tokens would be a 
> good compromise maybe.

In Section 4 of http://arxiv.org/abs/1405.6646, on page 16,
there is a discussion about this. I think it is similar to your
idea. In a rule like:
   THEN <-  'then'  !IDRest Skip

When there is an error matching "theno" it seems that is
better to say "Error matching 'then'" than "Error matching 'o'".

Sérgio

_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to