Article View: gnu.bash.bug
Article #447function foo { echo foo; } doesn't parse right
From: Brian Fox
Date: Tue, 08 Aug 1989 02:16
Date: Tue, 08 Aug 1989 02:16
29 lines
1630 bytes
1630 bytes
Date: Mon, 07 Aug 89 11:21:10 +1200
From: Ray Nickson <nickson@comp.vuw.ac.nz>
help function appears to claim that the above syntax is a legitimate
function definition, but bash (1.02, gcc-compiled, BSD on an HP300,
not that it matters) claims that there is a `syntax error near `{''.
The problem appears to be that although the yacc parser has a separate
production for this case, the lexer never allows it to see a `{'
unless it occurs immediately after a `()' pair.
Thanks, fixed.
An (unrelated) bug which doesn't cause any problems is in
`reserved_word_acceptable'; this is declared to take an argument,
which it completely ignores.
That was preparation for the future, and the future took place after
1.02 but before 1.03.
I wonder whether some minor attention could result in a significantly
cleaner, easier to understand lexer and parser.
If you would like to write a "significantly cleaner, easier to
understand" parser, by all means, please do! I would be glad to
include/use any code which I find to be clean, especially if it is
cleaner than what is already in use.
Brian
Technical Details
Message-ID:
<8908080216.AA06838@aurel.caltech.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfoxReferences:
<8908062321.AA26483@comp.vuw.ac.nz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox
From: bfox@AUREL.CALTECH.EDU (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: function foo { echo foo; } doesn't parse right
Message-ID: <8908080216.AA06838@aurel.caltech.edu>
Date: 8 Aug 89 02:16:28 GMT
References: <8908062321.AA26483@comp.vuw.ac.nz>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@aurel.caltech.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 29