rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  bug in rc?
@ 1993-04-16 22:43 Byron Rakitzis
  0 siblings, 0 replies; 3+ messages in thread
From: Byron Rakitzis @ 1993-04-16 22:43 UTC (permalink / raw)
  To: quanstro, rc

"if" in the first position denotes the if keyword. In any other
position it is passed on as an argument.

this is true in sh as well:

$ echo fi
fi
$ fi echo
syntax error: `fi' unexpected
$ 

although the rules for sh parsing are probably harder to deduce..



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

* Re:  bug in rc?
@ 1993-04-16 22:45 Paul Haahr
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Haahr @ 1993-04-16 22:45 UTC (permalink / raw)
  To: quanstro; +Cc: rc

because otherwise yacc gives conflicts.  if you really want to do that,
use
	'if'^if

this has to do with the way the first, word, and comword productions
are used.  it's sensible and hasn't caused anyone problems until now.

it also dates back to Tom Duff's plan 9 rc, so Byron can just say
he did it for purposes of compatibility.  :-)


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

* bug in rc?
@ 1993-04-16 22:27 Erik Quanstrom
  0 siblings, 0 replies; 3+ messages in thread
From: Erik Quanstrom @ 1993-04-16 22:27 UTC (permalink / raw)
  To: rc

; if^if 
syntax error
; if^bar
syntax error
; bar^if
barif not found


So why are the first two syntax errors?


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

end of thread, other threads:[~1993-04-16 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-16 22:43 bug in rc? Byron Rakitzis
  -- strict thread matches above, loose matches on Subject: below --
1993-04-16 22:45 Paul Haahr
1993-04-16 22:27 Erik Quanstrom

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 NNTP newsgroup(s).