🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #444

function foo { echo foo; } doesn't parse right

#444
From: Ray Nickson
Date: Sun, 06 Aug 1989 23:21
17 lines
1223 bytes
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.

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.  I wonder whether some minor attention
could result in a significantly cleaner, easier to understand lexer
and parser.

-rgn
--
Ray Nickson, Dept. Comp. Sci., Victoria University of Wellington, New Zealand.
nickson@comp.vuw.ac.nz       ...!uunet!vuwcomp!nickson      + 64 4 721000x8593
Technical Details
Message-ID: <8908062321.AA26483@comp.vuw.ac.nz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!comp.vuw.ac.nz!nickson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!comp.vuw.ac.nz!nickson
From: nickson@comp.vuw.ac.nz (Ray Nickson)
Newsgroups: gnu.bash.bug
Subject: function foo { echo foo; } doesn't parse right
Message-ID: <8908062321.AA26483@comp.vuw.ac.nz>
Date: 6 Aug 89 23:21:10 GMT
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 17