unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Lisp parser broken
@ 2003-02-18 15:01 Andreas Schwab
  2003-02-18 15:50 ` Juanma Barranquero
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andreas Schwab @ 2003-02-18 15:01 UTC (permalink / raw)
  Cc: emacs-devel

The latest changes in the lisp parser cause cc-vars.el to be misparsed, in
particular the body of the defmacro defcustom-c-stylevar.  Previously the
expression `(a `(` a)) was parsed as (\` (a (\` (\` a)))), now it is
parsed as (\` (a (\` ( (\` a))))).  Note that there is a symbol with an
empty name after the fourth open paren.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:01 Lisp parser broken Andreas Schwab
@ 2003-02-18 15:50 ` Juanma Barranquero
  2003-02-18 15:56   ` Andreas Schwab
  2003-02-18 19:36   ` Stefan Monnier
  2003-02-18 17:11 ` Kim F. Storm
  2003-02-19  7:17 ` Richard Stallman
  2 siblings, 2 replies; 9+ messages in thread
From: Juanma Barranquero @ 2003-02-18 15:50 UTC (permalink / raw)
  Cc: Kim F.Storm

On Tue, 18 Feb 2003 16:01:45 +0100, Andreas Schwab <schwab@suse.de> wrote:

> The latest changes in the lisp parser cause cc-vars.el to be misparsed, in
> particular the body of the defmacro defcustom-c-stylevar.  Previously the
> expression `(a `(` a)) was parsed as (\` (a (\` (\` a)))), now it is
> parsed as (\` (a (\` ( (\` a))))).  Note that there is a symbol with an
> empty name after the fourth open paren.

I've checked in patches, including one for cc-vars.el, that allow Emacs
to bootstrap. Not sure mine's the right fix for `defcustom-c-stylevar',
though.


                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:50 ` Juanma Barranquero
@ 2003-02-18 15:56   ` Andreas Schwab
  2003-02-18 16:22     ` Juanma Barranquero
  2003-02-18 19:36   ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2003-02-18 15:56 UTC (permalink / raw)
  Cc: Kim F.Storm

Juanma Barranquero <lektu@terra.es> writes:

|> On Tue, 18 Feb 2003 16:01:45 +0100, Andreas Schwab <schwab@suse.de> wrote:
|> 
|> > The latest changes in the lisp parser cause cc-vars.el to be misparsed, in
|> > particular the body of the defmacro defcustom-c-stylevar.  Previously the
|> > expression `(a `(` a)) was parsed as (\` (a (\` (\` a)))), now it is
|> > parsed as (\` (a (\` ( (\` a))))).  Note that there is a symbol with an
|> > empty name after the fourth open paren.
|> 
|> I've checked in patches, including one for cc-vars.el, that allow Emacs
|> to bootstrap. Not sure mine's the right fix for `defcustom-c-stylevar',
|> though.

I still think the bug is in the parser.  The symbol with the empty name
must not be there.  I'll check in the following change shortly if nobody
comes up with a better fix:

2003-02-18  Andreas Schwab  <schwab@suse.de>

	* lread.c (read1): Don't forbid "`" and "," in a symbol.

--- src/lread.c.~1.307.~	2003-02-18 13:07:17.000000000 +0100
+++ src/lread.c	2003-02-18 16:08:19.000000000 +0100
@@ -2458,8 +2458,7 @@ read1 (readcharfun, pch, first_in_list)
 	  char *end = read_buffer + read_buffer_size;
 
 	  while (c > 040
-		 && !index ("\"'`;()[]#", c)
-		 && !(new_backquote_flag && c == ','))
+		 && !index ("\"';()[]#", c))
 	    {
 	      if (end - p < MAX_MULTIBYTE_LENGTH)
 		{

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:56   ` Andreas Schwab
@ 2003-02-18 16:22     ` Juanma Barranquero
  0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2003-02-18 16:22 UTC (permalink / raw)
  Cc: Kim F.Storm

On Tue, 18 Feb 2003 16:56:29 +0100, Andreas Schwab <schwab@suse.de> wrote:

> I'll check in the following change shortly if nobody
> comes up with a better fix:

I have no opinion wrt your fix, but if you install it, revert the tiny
change to cc-vars.el. As I've said, I did it only to make Emacs
bootstrappable again.


                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:01 Lisp parser broken Andreas Schwab
  2003-02-18 15:50 ` Juanma Barranquero
@ 2003-02-18 17:11 ` Kim F. Storm
  2003-02-19  7:17 ` Richard Stallman
  2 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2003-02-18 17:11 UTC (permalink / raw)
  Cc: emacs-devel

Andreas Schwab <schwab@suse.de> writes:

> The latest changes in the lisp parser cause cc-vars.el to be misparsed, in
> particular the body of the defmacro defcustom-c-stylevar.  Previously the
> expression `(a `(` a)) was parsed as (\` (a (\` (\` a)))), now it is
> parsed as (\` (a (\` ( (\` a))))).  Note that there is a symbol with an
> empty name after the fourth open paren.
> 

Thank you for tracking this down.
It is fixed now.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:50 ` Juanma Barranquero
  2003-02-18 15:56   ` Andreas Schwab
@ 2003-02-18 19:36   ` Stefan Monnier
  2003-02-18 23:49     ` Kim F. Storm
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2003-02-18 19:36 UTC (permalink / raw)
  Cc: Kim F.Storm


With the current CVS trunk, I still have trouble with ? syntax:

ELISP> '(?\ ?\-)
*** Read error ***  Invalid read syntax: "?"
ELISP> '(? ?\-)
*** Read error ***  Invalid read syntax: "?"
ELISP> 

Such forms are used everywhere, so we have to allow them in
order not to break backward compatibility.


	Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 19:36   ` Stefan Monnier
@ 2003-02-18 23:49     ` Kim F. Storm
  0 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2003-02-18 23:49 UTC (permalink / raw)
  Cc: emacs-devel

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> With the current CVS trunk, I still have trouble with ? syntax:
> 
> ELISP> '(?\ ?\-)
> *** Read error ***  Invalid read syntax: "?"
> ELISP> '(? ?\-)
> *** Read error ***  Invalid read syntax: "?"
> ELISP> 
> 
> Such forms are used everywhere, so we have to allow them in
> order not to break backward compatibility.

Sorry.  I tested the non-trivial cases, and forgot about
the trivial ones.  Fixed now.

Lesson: This is an good candidate for regression testing.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-18 15:01 Lisp parser broken Andreas Schwab
  2003-02-18 15:50 ` Juanma Barranquero
  2003-02-18 17:11 ` Kim F. Storm
@ 2003-02-19  7:17 ` Richard Stallman
  2003-02-19  9:30   ` Kim F. Storm
  2 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2003-02-19  7:17 UTC (permalink / raw)
  Cc: storm

I encouraged fixing some absurdities in the handling of backquote ad
comma, but it looks like part of the absurdities may be needed for
handling of the old-style syntax where these were treated as symbol
names.

It is probably best to undo the change for now
and then think about it some more.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Lisp parser broken
  2003-02-19  7:17 ` Richard Stallman
@ 2003-02-19  9:30   ` Kim F. Storm
  0 siblings, 0 replies; 9+ messages in thread
From: Kim F. Storm @ 2003-02-19  9:30 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I encouraged fixing some absurdities in the handling of backquote ad
> comma, but it looks like part of the absurdities may be needed for
> handling of the old-style syntax where these were treated as symbol
> names.
> 
> It is probably best to undo the change for now
> and then think about it some more.

I think I have corrected the parser to take those absurdities into
account; at least it parses all the existing lisp files ok now.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-02-19  9:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-18 15:01 Lisp parser broken Andreas Schwab
2003-02-18 15:50 ` Juanma Barranquero
2003-02-18 15:56   ` Andreas Schwab
2003-02-18 16:22     ` Juanma Barranquero
2003-02-18 19:36   ` Stefan Monnier
2003-02-18 23:49     ` Kim F. Storm
2003-02-18 17:11 ` Kim F. Storm
2003-02-19  7:17 ` Richard Stallman
2003-02-19  9:30   ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).