Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Make typeset -p1 work in combination with -m.



Daniel Shahaf wrote on Thu, 19 Oct 2017 14:40 +0000:
> Peter Stephenson wrote on Wed, Oct 18, 2017 at 09:31:19 +0100:
> > On Tue, 17 Oct 2017 18:27:00 +0000
> > Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > > The PRINT_INCLUDEVALUE codepath will now pass
> > > PRINT_LINE|PRINT_TYPESET|PRINT_INCLUDEVALUE; is that correct?
> > 
> > Yes, as long as the resulting output makes sense the flag can be passed
> > through.
> 
> Ack.  I'll double check the output before pushing.

There's an unwanted output change:

before% typeset -m argv
argv=(  )

after% typeset -m argv
array argv

It persists even if I strip the PRINT_TYPESET bit at the PRINT_INCLUDEVALUE callsite.

Hopefully this rings a bell to someone?  It looks like some issue with the PRINT_* flags.

In the meantime here's a regression test.

Daniel

diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index 996af064f..3aea55d4c 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -794,6 +794,10 @@
 1:Mixed syntax with [key]=val not allowed for hash.
 ?(eval):1: bad [key]=value syntax for associative array
 
+  () { typeset -m argv }
+0:typeset -m of array, without pattern matching (regression)
+>argv=(  )
+
   local -a myarray
   typeset -p1 myarray
   myarray=("&" sand '""' "" plugh)



Messages sorted by: Reverse Date, Date, Thread, Author