zsh-users
 help / color / mirror / code / Atom feed
* Is there some bash source that Zsh will not parse?
@ 2019-07-10 16:10 Sebastian Gniazdowski
  2019-07-10 22:47 ` Phil Pennock
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2019-07-10 16:10 UTC (permalink / raw)
  To: Zsh Users

Hello,
in the opposite direction, this is rather true, e.g. the globbing
flags aren't parsed correctly:

    echo $^fpath/$_comps[$1](N.)

bash: syntax error near unexpected token `('

I'm thinking about starting a Zshell-focused but supporting also dash
& bash linter and using lex.c seems a reasonable decision.
-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

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

* Re: Is there some bash source that Zsh will not parse?
  2019-07-10 16:10 Is there some bash source that Zsh will not parse? Sebastian Gniazdowski
@ 2019-07-10 22:47 ` Phil Pennock
  2019-07-11  0:46   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Pennock @ 2019-07-10 22:47 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh Users

On 2019-07-10 at 18:10 +0200, Sebastian Gniazdowski wrote:
> in the opposite direction, this is rather true, e.g. the globbing
> flags aren't parsed correctly:

Plenty, since Zsh has never until now aimed to be a complete superset of
Bash functionality; instead, we've added features to make it easier to
interoperate, eg making sure that command remote command-lines would
work.

Note in particular that where zsh has ${(flags)varname} for parameter
expansion flags, bash has ${varname@operator} syntax for expansion
transformations.  There's other stuff around indirect variables, case
modification expansions, and `shopt`, which all come to mind.  Almost
certainly a lot more.

If Zsh's goals are changing such that complete Bash compatibility is
required in bash mode (as opposed to "enough to get by") then it might
be worth trying to run the bash test suite against Zsh, with suitable
modifications to ensure Zsh is in the correct mode always.
That should prove ... educational.

-Phil

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

* Re: Is there some bash source that Zsh will not parse?
  2019-07-10 22:47 ` Phil Pennock
@ 2019-07-11  0:46   ` Sebastian Gniazdowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2019-07-11  0:46 UTC (permalink / raw)
  To: Phil Pennock; +Cc: Zsh Users

On Thu, 11 Jul 2019 at 00:47, Phil Pennock
<zsh-workers+phil.pennock@spodhuis.org> wrote:
>
> On 2019-07-10 at 18:10 +0200, Sebastian Gniazdowski wrote:
> > in the opposite direction, this is rather true, e.g. the globbing
> > flags aren't parsed correctly:
>
> ...
> Note in particular that where zsh has ${(flags)varname} for parameter
> expansion flags, bash has ${varname@operator} syntax for expansion
> transformations.  There's other stuff around indirect variables, case
> modification expansions, and `shopt`, which all come to mind.  Almost
> certainly a lot more.

Yes but i meant actually just the parser. I believe the contents of
${...} are taken as a whole by the parser to then be passed to
stringsubst() and the like, so that would be a "late"-parsing, which
i'm not interested in currently.

> If Zsh's goals are changing such that complete Bash compatibility is
> required in bash mode (as opposed to "enough to get by") then it might
> be worth trying to run the bash test suite against Zsh, with suitable
> modifications to ensure Zsh is in the correct mode always.
> That should prove ... educational.

Yeah, that would be interesting :)

> -Phil
-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

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

end of thread, other threads:[~2019-07-11  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 16:10 Is there some bash source that Zsh will not parse? Sebastian Gniazdowski
2019-07-10 22:47 ` Phil Pennock
2019-07-11  0:46   ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).