Author: Stan Eisenstat
Subject: Re: [Cs323] Escaped = follow-up
Date: Sunday, 27 Sep 2020, 19:02:58
> Message Posted By: Unknown
>
> If the escape character \ removes any special meaning, is this output expected?
>
> $ text\=text
> parsley: null command
>
> I would have expected the output to be:
> CMD (Depth = 0): SIMPLE, argv[0] = text=text
As stated in the specification,
Aside: The grammar is ambiguous in the sense that in the input
% A=B
parsley could treat the TEXT token A=B as an argument in a valid command or
as a local in an invalid one. Similarly, for the input
% A=B C=D E
it could treat A=B and C=D as locals, or treat A=B as a local and C=D as an
argument, or treat A=B and C=D as arguments; all of which result in valid
commands. To resolve the ambiguity we will assume that a TEXT token of the
form NAME=VALUE is always treated as a [local] if it can be.
Thus test\=text is treated as a local, which means that
the command does not contain any arguments; i.e., it is a
null command.
--Stan-
PREV
INDEX
NEXT