zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: Peter Stephenson <pws@cambridgesiliconradio.com>
Cc: Zsh hackers list <zsh-workers@sunsite.auc.dk>
Subject: Re: PATCH: octal in arithmetic expressions
Date: Mon, 15 May 2000 14:44:20 -0400	[thread overview]
Message-ID: <20000515144420.B31551@scowler.net> (raw)
In-Reply-To: <0FUM00JQE5MJSH@la-la.cambridgesiliconradio.com>; from pws@cambridgesiliconradio.com on Mon, May 15, 2000 at 07:20:44PM +0100

> It should be settable with some option such as
> MATH_MODE_MESSES_UP_CONVERSIONS_FROM_STRING_TO_INTEGER... well, all right,
> OCTAL_ZEROES.  As ksh doesn't do this it probably shouldn't be set for

Okay.

Index: Doc/Zsh/options.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
retrieving revision 1.4
diff -u -r1.4 options.yo
--- Doc/Zsh/options.yo	2000/05/11 00:01:03	1.4
+++ Doc/Zsh/options.yo	2000/05/15 18:43:45
@@ -777,6 +777,12 @@
 If numeric filenames are matched by a filename generation pattern,
 sort the filenames numerically rather than lexicographically.
 )
+pindex(OCTAL_ZEROES)
+cindex(octal, arithmetic expressions)
+item(tt(OCTAL_ZEROES) <S>)(
+Interpret any integer constant beginning with a 0 and not
+as octal, per IEEE Std 1003.2-1992 (ISO 9945-2:1993).
+)
 pindex(OVERSTRIKE)
 cindex(editor, overstrike mode)
 cindex(overstrike mode, of editor)
Index: Src/math.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/math.c,v
retrieving revision 1.3
diff -u -r1.3 math.c
--- Src/math.c	2000/05/15 17:54:59	1.3
+++ Src/math.c	2000/05/15 18:43:45
@@ -357,7 +357,8 @@
 		yyval.u.l = zstrtol(++ptr, &ptr, lastbase = 16);
 		return NUM;
 	    }
-	    else if (idigit(*ptr) && (memchr(ptr, '.', strlen(ptr)) == NULL)) {
+	    else if (isset(OCTALZEROES) &&
+		    (memchr(ptr, '.', strlen(ptr)) == NULL)) {
 	        yyval.u.l = zstrtol(ptr, &ptr, lastbase = 8);
 	        return NUM;
 	    }
Index: Src/options.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/options.c,v
retrieving revision 1.3
diff -u -r1.3 options.c
--- Src/options.c	2000/05/08 15:56:37	1.3
+++ Src/options.c	2000/05/15 18:43:45
@@ -162,6 +162,7 @@
 {NULL, "notify",	      OPT_ZSH,			 NOTIFY},
 {NULL, "nullglob",	      OPT_EMULATE,		 NULLGLOB},
 {NULL, "numericglobsort",     OPT_EMULATE,		 NUMERICGLOBSORT},
+{NULL, "octalzeroes",         OPT_EMULATE|OPT_SH,	 OCTALZEROES},
 {NULL, "overstrike",	      0,			 OVERSTRIKE},
 {NULL, "pathdirs",	      OPT_EMULATE,		 PATHDIRS},
 {NULL, "posixbuiltins",	      OPT_EMULATE|OPT_BOURNE,	 POSIXBUILTINS},
Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.8
diff -u -r1.8 zsh.h
--- Src/zsh.h	2000/05/08 15:56:37	1.8
+++ Src/zsh.h	2000/05/15 18:43:45
@@ -1395,6 +1395,7 @@
     NOTIFY,
     NULLGLOB,
     NUMERICGLOBSORT,
+    OCTALZEROES,
     OVERSTRIKE,
     PATHDIRS,
     POSIXBUILTINS,


      reply	other threads:[~2000-05-15 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-15 17:51 Clint Adams
2000-05-15 18:20 ` Peter Stephenson
2000-05-15 18:44   ` Clint Adams [this message]

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=20000515144420.B31551@scowler.net \
    --to=schizo@debian.org \
    --cc=pws@cambridgesiliconradio.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).