rev 748 - in trunk: . src

SVN User <[email protected]> Sat, 17 Jul 2004 04:33:58 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-07-17 04:33:55 -0400 (Sat, 17 Jul 2004)
New Revision: 748

Modified:
   trunk/STATUS.txt
   trunk/src/builtins-int.c
Log:
fixed problems with 1o777

Modified: trunk/STATUS.txt
===================================================================
--- trunk/STATUS.txt	2004-07-17 07:42:10 UTC (rev 747)
+++ trunk/STATUS.txt	2004-07-17 08:33:55 UTC (rev 748)
@@ -1,6 +1,11 @@
 
 ----------------------- TO-DO  FOR 1.0 ALPHA release -----------------------
 
+--- this seq crashes lexer in console
+O>> "{0:#o}".fmt(-1)
+1o777777
+O>> "{0:#X}".fmt(-15643650786985697674865478654765)
+
 --- "import as" broken
 --- bug: prints ... after 15 items in a list
 

Modified: trunk/src/builtins-int.c
===================================================================
--- trunk/src/builtins-int.c	2004-07-17 07:42:10 UTC (rev 747)
+++ trunk/src/builtins-int.c	2004-07-17 08:33:55 UTC (rev 748)
@@ -2194,6 +2194,10 @@
 			one = (long_p)new_longp(1);
 			num = (long_p)long_add(num, one);
 			pr_free(one);
+			if (num->dsize == 0) {
+				num->dsize = -1;
+				num->digit[0] = 0;
+			}
 			for (i = 0; i < -num->dsize; i++)
 				num->digit[i] ^= 0xffff;
 		} else 
@@ -2237,6 +2241,16 @@
 			self_len++;
 		}
 	}
+	if (hd1_flag && hex_flag && self_ptr->b0 != (u8_t) 'f') {
+		self_ptr--;
+		self_len++;
+		self_ptr->b0 = (u8_t) 'f';
+	}
+	if (hd1_flag && heX_flag && self_ptr->b0 != (u8_t) 'F') {
+		self_ptr--;
+		self_len++;
+		self_ptr->b0 = (u8_t) 'F';
+	}
 	if (pos_flag) blnk_flag = FALSE;
 	if (!oct_flag && !hex_flag && !heX_flag) hdr_flag = FALSE;
 	if (prec_p)