zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: namespaces limitation
Date: Tue, 23 May 2023 10:10:46 -0700	[thread overview]
Message-ID: <CAH+w=7ZZRQiboQYwgnZwpkger+i2pnyP3Y55gC4vnwkVnfUJCg@mail.gmail.com> (raw)
In-Reply-To: <9849-1684455235.063540@_q24.9gsR.Efjj>

On Thu, May 18, 2023 at 5:14 PM Oliver Kiddle <opk@zsh.org> wrote:
>
> I came across the following when using the new namespaces:
>
>   integer .var.d=0
>   (( .var.d++ ))
>   zsh: bad floating point constant

There are three (mainly) places where I elected not to dive straight
in to changing the meaning of "identifier" ...
1) math variables
2) math function names
3) word completions

#3 is tricky (as in zle_tricky) because itype_end() is often being
used to determine whether a character is valid in an identifier, not
whether an entire word is an identifier; it would probably be wrong or
break some other constraint to skip across "." in that context.

#2 is ... well, function naming in general is a bit hard to deal with.
For example, out of math context, you can name a function pretty much
anything (using dots, slashes, hyphens, plus signs) but if you want to
use the function with the (+CMD) glob qualifier, the name has to be
strictly an identifier (alphanum and underscore).

#1 (and likely also #2) requires changing the math lexer, which I
didn't want to risk breaking until the rest had been thoroughly
tested.  E.g., --

> And should this be allowed or should it complain about the 3 part not
> being an identifier?
>
>   integer .3=67

Yes, the first character of a namespace identifier should probably be
an alphabetic.  Or an underscore?  That might really complicate math
lexing, given that we allow underscores in numeric constants.


  reply	other threads:[~2023-05-23 17:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  0:13 Oliver Kiddle
2023-05-23 17:10 ` Bart Schaefer [this message]
2023-05-24 16:41   ` Oliver Kiddle
2023-05-25 22:09     ` Bart Schaefer
2023-05-25 23:13       ` Bart Schaefer
2023-06-22 17:49       ` [PATCH] " Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7ZZRQiboQYwgnZwpkger+i2pnyP3Y55gC4vnwkVnfUJCg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).