homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients eric.araujo, eric.smith, niemeyer, robodan
Date 2011年11月26日.15:25:00
SpamBayes Score 6.3837824e-15
Marked as misclassified No
Message-id <1322321101.44.0.549991421257.issue1521950@psf.upfronthosting.co.za>
In-reply-to
Content
> I was just looking for a reference where I didn't have to sift through tons of documentation.
Sure :) That’s why I suggest using dash for quick tests and rely on the work of other people who did read the POSIX spec. I’ll have to check it too before committing a patch.
> shlex uses a series of character strings to drive it's parsing: whitespace, escape, quotes.
> Add another one: control = '();<>|&'. If it is unset (by default?), then the behavior is as
> before.
So we would need to add a Shlex subclass to the module to provide the new behavior. I think I prefer a new argument, because we can just extend the existing class and functions instead of adding subtly differing duplicates.
> If it is set, then shlex will output any character in control as a separate token.
Unless it is part of a quoted segment, right? (See #7611 for 'foo#bar' vs. 'foo #bar').
> There might be a shell specific script (or maybe it's left to the user)
> that decides that certain tokens can be recombined:
Seems to much complexity. I really prefer if we agree on one command parsing behavior (POSIX, i.e. dash) and improve shlex to support that. People wanting zsh rules can write their own subclass.
> '&&', '||', '|&', '>>', etc.
Wouldn’t it be more correct to consider them different tokens? I don’t have a format training in CS or programming, so I’m not sure that my definition is correct at all, but in my mind a token is a unit, and thus & and && are two different things.
History
Date User Action Args
2011年11月26日 15:25:01eric.araujosetrecipients: + eric.araujo, niemeyer, eric.smith, robodan
2011年11月26日 15:25:01eric.araujosetmessageid: <1322321101.44.0.549991421257.issue1521950@psf.upfronthosting.co.za>
2011年11月26日 15:25:00eric.araujolinkissue1521950 messages
2011年11月26日 15:25:00eric.araujocreate

AltStyle によって変換されたページ (->オリジナル) /