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

skipping assignment and function statements; Interactive comments



I just added a skip command to zshdb (and committed to github), but it
seems that assignment statements and function definitions are not
really skipped.

Consider this example which is slightly modified from the regession
test that was put in when it was implimented:

  setopt localtraps localoptions debugbeforecmd
  trap '(( LINENO == 4 )) && setopt errexit' DEBUG
  x=three
  x=four  # Statement is supposed to be skipped
  print $LINENO five
  print x is $x

The output I get is:

  5 five
  x is four

And if the statement were a function definition, e.g.
  x() { return 4; }
I think x would get defined as a funciton

- - -
In tracking something else down I read this in zshoptions under
INTERACTIVE_COMMENTS:

   "Allow comments even in interactive shells".

I find this phrasing a little weird as it It seems to imply that one
never would want to write a comments, but sometimes one has to break
down and do it in an interactive shell. :-)

Perhaps the word "even" should be removed.



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