bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#72131: 29.3; peg.el: syntax class character for symbol is '_', not '


From: Helmut Eller
Subject: bug#72131: 29.3; peg.el: syntax class character for symbol is '_', not 's'
Date: Tue, 16 Jul 2024 15:00:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Tue, Jul 16 2024, Eli Zaretskii wrote:

>> From: Jeff Trull <edaskel@att.net>
>> Date: Mon, 15 Jul 2024 15:26:02 -0700
>> 
>> (require 'peg)
>> (with-temp-buffer
>>   (save-excursion (insert "_"))
>>   (peg-parse (syntax-class symbol)))
>> 
>> results in the message
>> "No merge-error method for: (syntax-class symbol)".
>> 
>> The root cause seems to be line 703 of peg.el where the syntax class
>> characters are defined. peg uses "s" for symbols instead of
>> "_". Correcting this results in a successful parse in the given code.
>
> Stefan and Helmut, any comments or suggestions?

Yes, looks like "_" would the correct.  A method like

 (cl-defmethod peg--merge-error (merged (_ (eql syntax-class)) x)
   (cl-adjoin `(syntax-class ,x) merged :test #'equal))

is also missing and error messages like

  peg-signal-failure: Parse error at %d (expecting %S): 1, ("abc")

don't look right either.

The first thing to do would be to write a test.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]