rev 563 - in trunk: . include/prothon pr/test src
SVN User <[email protected]> Wed, 02 Jun 2004 21:15:58 -0400
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-06-02 21:15:55 -0400 (Wed, 02 Jun 2004)
New Revision: 563
Modified:
trunk/STATUS.txt
trunk/include/prothon/prothon.h
trunk/pr/test/test.pr
trunk/src/builtins-int.c
trunk/src/init.pth
trunk/src/object.h
trunk/src/parser.h
trunk/src/parser_routines.c
trunk/src/prothon.y
trunk/src/src.vcproj
Log:
long ints work with simple tests
Modified: trunk/STATUS.txt
===================================================================
--- trunk/STATUS.txt 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/STATUS.txt 2004-06-03 01:15:55 UTC (rev 563)
@@ -1,11 +1,9 @@
----------------------- TO-DO (highest priority first) ------------------------
---- switch integers to longs?
---- check for OverflowError in math routines
---- implement bigints
-
--- put in skeleton code for + _"abc"
+--- GNU message catalog _"abc" strings
+--- change all strings to resource file
--- add resolution order combining prototypes and scope chains
@@ -13,22 +11,14 @@
--- getAttr(name), setAttr(name, value), delAttr(name)
---- Auto-function scheme
-
--- Strings -> 24-bit ords
---- resolve binary vs. strings vs. unicode
+--- resolve binary vs. strings vs. unicode----- code in binary string (all binary data in binary string?)
+----- new integrated binary obj_malloc?
---- code in binary string (all binary data in binary string?)
---- new integrated binary obj_malloc?
-
---- GNU message catalog _"abc" strings
---- change all strings to resource file
-
--- import (string variable)
--- Swig and/or other (what GTK port used?) backend
-
--- Traceback objects (stack trace of an exception), exceptions should show function names
--- Fix error reporting mess, hide fake file names
@@ -37,6 +27,7 @@
--- add conditional expression "if C then x else y"
--- Auto-documenter app
+--- add static checking like interfaces to doc tool
--- networking code -- web access demonstration of security
--- security flaw - modules can access each other by name
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/include/prothon/prothon.h 2004-06-03 01:15:55 UTC (rev 563)
@@ -251,6 +251,16 @@
typedef pr_thread_t* pr_thread_p;
+typedef u16_t digit;
+
+typedef struct {
+ u32_t size;
+ i32_t dsize;
+ digit digit[];
+} long_t;
+
+typedef long_t* long_p;
+
//************************* MALLOC FUNCTIONS **********************************
// These behave identical to the standard OS functions, but on segments smaller
// than 64 bytes are much faster than most OS implementations. See prmalloc.c.
Modified: trunk/pr/test/test.pr
===================================================================
--- trunk/pr/test/test.pr 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/pr/test/test.pr 2004-06-03 01:15:55 UTC (rev 563)
@@ -1,7 +1,43 @@
#!/usr/bin/env prothon
-def sel(q, a, b):
- return (q and a) or ((not q) and b)
-
-print sel(True, 1, 2)
-print sel(False, 1, 2)
+
+def err(n):
+ print 'error', n
+ Sys.exit(1)
+/*
+x = 1
+if x != 1: err(0)
+
+for i in 200:
+ x *= 2
+
+y = 2**200
+
+if x != y:
+ print 'x:',x
+ print 'y:',y
+ err(1)
+if x != 1606938044258990275541962092341162602522202993782792835301376:
+ err(2)
+
+for i in 200:
+ x //=2
+
+if x != 1: err(3)
+
+
+x = 254373265453637
+if -(823 * 2134 + 3184536 - 42312 % 311) | 19234567 & 149578376456 != -4915202:
+ err(4)
+*/
+print -(8211442569234385238487474353 * 212847346352034947352764 + 31842289378376456945234123236
+ - 44872283873746635434256223262312 % 3387611
+ ) | 192328437462345263464564567 & 1495728438374645645346368376456
+
+y = 1002003004005006007008009000100200300400500600700800900
+print """
+--- All tests passed ---
+
+The following should match:
+1002003004005006007008009000100200300400500600700800900"""
+print y
\ No newline at end of file
Modified: trunk/src/builtins-int.c
===================================================================
--- trunk/src/builtins-int.c 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/builtins-int.c 2004-06-03 01:15:55 UTC (rev 563)
@@ -82,7 +82,6 @@
#define MAX64 0x3fffffffffffffff
#define MIN64 -MAX64
-typedef u16_t digit;
typedef u32_t wdigit;
#define BASE_TWODIGITS_TYPE long
typedef unsigned BASE_TWODIGITS_TYPE twodigits;
@@ -92,14 +91,7 @@
#define BASE ((digit)1 << SHIFT)
#define MASK ((int)(BASE - 1))
-typedef struct {
- u32_t size;
- i32_t dsize;
- digit digit[];
-} long_t;
-
typedef digit* digit_p;
-typedef long_t* long_p;
#define long_size(obj) (((long_p)((obj)->data.ptr))->size)
#define long_dsize(obj) (((long_p)((obj)->data.ptr))->dsize)
@@ -149,14 +141,23 @@
//********************************* new_int_long_obj **************************
obj_p new_int_long_obj(isp ist, long_p longp){
+ int len = sizeof(long_t) + abs(longp->dsize) * sizeof(digit);
obj_p obj = NEW_OBJ(OBJ(INT_PROTO));
obj->data_type = DATA_TYPE_DATAPTR;
- obj->data.ptr = pr_malloc(longp->size * sizeof(digit));
- memcpy(obj->data.ptr, longp, longp->size * sizeof(digit));
+ obj->data.ptr = pr_malloc(len);
+ memcpy(obj->data.ptr, longp, len);
+ long_size(obj) = abs(longp->dsize);
obj->immutable = TRUE;
return obj;
}
+int int_is_zero(obj_p obj) {
+ if (obj->data_type == DATA_TYPE_IMMDATA)
+ return (obj->data.i64 == 0);
+ else
+ return (long_dsize(obj) == 0);
+}
+
/* Normalize (remove leading zeros from) a int object.
Doesn't attempt to free the storage--in most cases, due to the nature
of the algorithms used, this could save at most be one word anyway. */
@@ -177,6 +178,7 @@
long_p new_longp_non_init(u32_t size) {
long_p longp = pr_malloc(sizeof(long_t) + size * sizeof(digit));
longp->size = size;
+ longp->dsize = size;
return longp;
}
@@ -302,15 +304,13 @@
return -1;
}
-size_t
-_PyLong_NumBits(long_p vv)
+size_t _PyLong_NumBits(long_p vv)
{
long_p v = (long_p)vv;
size_t result = 0;
int ndigits;
assert(v != NULL);
- assert(PyLong_Check(v));
ndigits = abs(v->dsize);
assert(ndigits == 0 || v->digit[ndigits - 1] != 0);
if (ndigits > 0) {
@@ -407,7 +407,7 @@
}
-#define CONVERT_BINOP(v, w, a, b) *a=v; *b=w;
+#define CONVERT_BINOP(v, w, a, b) *a = long_normalize(v); *b = long_normalize(w);
/* x[0:m] and y[0:n] are digit vectors, LSD first, m >= n required. x[0:n]
* is modified in place, by adding y to it. Carries are propagated as far as
@@ -437,8 +437,7 @@
* is modified in place, by subtracting y from it. Borrows are propagated as
* far as x[m-1], and the remaining borrow (0 or 1) is returned.
*/
-static digit
-v_isub(digit *x, int m, digit *y, int n)
+static digit v_isub(digit *x, int m, digit *y, int n)
{
int i;
digit borrow = 0;
@@ -461,16 +460,14 @@
/* Multiply by a single digit, ignoring the sign. */
-static long_p
-mul1(long_p a, wdigit n)
+static long_p mul1(long_p a, wdigit n)
{
return muladd1(a, n, (digit)0);
}
/* Multiply by a single digit and add a single digit, ignoring the sign. */
-static long_p
-muladd1(long_p a, wdigit n, wdigit extra)
+static long_p muladd1(long_p a, wdigit n, wdigit extra)
{
int size_a = abs(a->dsize);
long_p z = new_longp_non_init(size_a+1);
@@ -494,8 +491,7 @@
long_format, but that should be done with great care since longs are
immutable. */
-static digit
-inplace_divrem1(digit *pout, digit *pin, int dsize, digit n)
+static digit inplace_divrem1(digit *pout, digit *pin, int dsize, digit n)
{
twodigits rem = 0;
@@ -515,8 +511,7 @@
(as function result) and the remainder (through *prem).
The sign of a is ignored; n should not be zero. */
-static long_p
-divrem1(long_p a, digit n, digit *prem)
+static long_p divrem1(long_p a, digit n, digit *prem)
{
const int dsize = abs(a->dsize);
long_p z;
@@ -579,7 +574,7 @@
do {
char cdigit = (char)(accum & (base - 1));
cdigit += (cdigit < 10) ? '0' : 'A'-10;
- assert(p > PyString_AS_STRING(str));
+ assert(p > pr_strptr(str));
*--p = cdigit;
accumbits -= basebits;
accum >>= basebits;
@@ -631,7 +626,7 @@
do {
digit nextrem = (digit)(rem / base);
char c = (char)(rem - nextrem * base);
- assert(p > PyString_AS_STRING(str));
+ assert(p > pr_strptr(str));
c += (c < 10) ? '0' : 'A'-10;
*--p = c;
rem = nextrem;
@@ -756,8 +751,7 @@
return long_normalize(z);
}
-long_p
-PyLong_FromString(char *str, char **pend, int base)
+long_p PyLong_FromString(char *str, char **pend, int base)
{
int sign = 1;
char *start, *orig_str = str;
@@ -834,8 +828,7 @@
}
#ifdef Py_USING_UNICODE
-long_p
-PyLong_FromUnicode(Py_UNICODE *u, int length, int base)
+long_p PyLong_FromUnicode(Py_UNICODE *u, int length, int base)
{
long_p result;
char *buffer = PyMem_MALLOC(length+1);
@@ -862,8 +855,7 @@
/* Long division with remainder, top-level routine */
-static int
-long_divrem(long_p a, long_p b,
+static int long_divrem(long_p a, long_p b,
long_p *pdiv, long_p *prem)
{
int size_a = abs(a->dsize), size_b = abs(b->dsize);
@@ -909,8 +901,7 @@
/* Unsigned long division with remainder -- the algorithm */
-static long_p
-x_divrem(long_p v1, long_p w1, long_p *prem)
+static long_p x_divrem(long_p v1, long_p w1, long_p *prem)
{
int size_v = abs(v1->dsize), size_w = abs(w1->dsize);
digit d = (digit) ((twodigits)BASE / (w1->digit[size_w-1] + 1));
@@ -926,7 +917,6 @@
}
assert(size_v >= size_w && size_w > 1); /* Assert checks by div() */
- assert(v->ob_refcnt == 1); /* Since v will be used as accumulator! */
assert(size_w == abs(w->dsize)); /* That's how d was calculated */
size_v = abs(v->dsize);
@@ -1184,17 +1174,13 @@
if (z == NULL)
return NULL;
- memset(z->digit, 0, z->dsize * sizeof(digit));
+ memset(z->digit, 0, z->size * sizeof(digit));
for (i = 0; i < size_a; ++i) {
twodigits carry = 0;
twodigits f = a->digit[i];
int j;
digit *pz = z->digit + i;
- SIGCHECK({
- pr_free(z);
- return NULL;
- })
for (j = 0; j < size_b; ++j) {
carry += *pz + b->digit[j] * f;
*pz++ = (digit) (carry & MASK);
@@ -1217,8 +1203,7 @@
the return values are >= 0.
Returns 0 on success, -1 on failure.
*/
-static int
-kmul_split(long_p n, int dsize, long_p *high, long_p *low)
+static int kmul_split(long_p n, int dsize, long_p *high, long_p *low)
{
long_p hi, lo;
int size_lo, size_hi;
@@ -1248,8 +1233,7 @@
* absolute value of the product (or NULL if error).
* See Knuth Vol. 2 Chapter 4.3.3 (Pp. 294-295).
*/
-static long_p
-k_mul(long_p a, long_p b)
+static long_p k_mul(long_p a, long_p b)
{
int asize = abs(a->dsize);
int bsize = abs(b->dsize);
@@ -1458,8 +1442,7 @@
* at a time, then move on, never bactracking except for the helpful
* single-width slice overlap between successive partial sums).
*/
-static long_p
-k_lopsided_mul(long_p a, long_p b)
+static long_p k_lopsided_mul(long_p a, long_p b)
{
const int asize = abs(a->dsize);
int bsize = abs(b->dsize);
@@ -1513,7 +1496,7 @@
}
static long_p long_mul(long_p v, long_p w) {
- long_p a=v, b=w, z;
+ long_p a=copy_longp(v), b=copy_longp(w), z;
z = k_mul(a, b);
/* Negate if exactly one of the inputs is negative. */
@@ -1539,9 +1522,7 @@
have different signs. We then subtract one from the 'div'
part of the outcome to keep the invariant intact. */
-static int
-l_divmod(long_p v, long_p w,
- long_p *pdiv, long_p *pmod)
+static int l_divmod(long_p v, long_p w, long_p *pdiv, long_p *pmod)
{
long_p div, mod;
@@ -1592,8 +1573,7 @@
return (long_p) div;
}
-static long_p
-long_classic_div(long_p v, long_p w)
+static long_p long_classic_div(long_p v, long_p w)
{
long_p a, b, div, mod;
@@ -1692,11 +1672,11 @@
if (bi & 1) {
temp = (long_p)long_mul(z, a);
- pr_free(z);
if (c && temp!=NULL) {
if (l_divmod(temp,(long_p)c,
&div,&mod) < 0) {
pr_free(temp);
+ pr_free(z);
z = NULL;
goto error;
}
@@ -1704,6 +1684,7 @@
pr_free(temp);
temp = mod;
}
+ pr_free(z);
z = temp;
if (z == NULL)
break;
@@ -1712,11 +1693,11 @@
if (bi == 0 && i+1 == size_b)
break;
temp = (long_p)long_mul(a, a);
- pr_free(a);
if (c && temp!=NULL) {
if (l_divmod(temp, (long_p)c, &div,
&mod) < 0) {
pr_free(temp);
+ pr_free(z);
z = NULL;
goto error;
}
@@ -1724,9 +1705,10 @@
pr_free(temp);
temp = mod;
}
+ //pr_free(a);
a = temp;
if (a == NULL) {
- pr_free(z);
+ //pr_free(z);
z = NULL;
break;
}
@@ -1736,7 +1718,7 @@
}
if (c && z!=NULL) {
if (l_divmod(z, (long_p)c, &div, &mod) < 0) {
- pr_free(z);
+ //pr_free(z);
z = NULL;
}
else {
@@ -1749,7 +1731,7 @@
Py_XDECREF(a);
pr_free(b);
pr_free(c);
- return (long_p)z;
+ return (long_p) z;
}
static long_p long_invert(long_p v)
@@ -1830,8 +1812,7 @@
}
-static long_p
-long_lshift(long_p v, long_p w)
+static long_p long_lshift(long_p v, long_p w)
{
/* This version due to Tim Peters */
long_p a, b;
@@ -1887,9 +1868,7 @@
/* Bitwise and/xor/or operations */
-static long_p long_bitwise(long_p a,
- int op, /* '&', '|', '^' */
- long_p b)
+static long_p long_bitwise(long_p a, int op, /* '&', '|', '^' */ long_p b)
{
digit maska, maskb; /* 0 or MASK */
int negz;
@@ -2187,8 +2166,8 @@
oiv = int_imm_value(other);
if ( self->data_type == DATA_TYPE_IMMDATA &&
other->data_type == DATA_TYPE_IMMDATA &&
- siv < MAX64 || oiv < MAX64 &&
- siv > MIN64 || oiv > MIN64 )
+ (siv < MAX64 || oiv < MAX64) &&
+ (siv > MIN64 || oiv > MIN64) )
return NEW_INT(siv+oiv);
else {
long_p a, b;
@@ -2621,6 +2600,11 @@
return res;
}
+DEF(Int, cDataLen_, NULL) {
+ BIN_CONTENT_CHK(Int);
+ return NEW_INT(sizeof(long_t) + long_size(self) * sizeof(digit));
+}
+
MAIN_MODULE_INIT(Int)
{
SYM_LIMIT = sym(ist, "limit");
@@ -2650,6 +2634,7 @@
MODULE_ADD_SYM(Int, rShift_);
MODULE_ADD_SYM(Int, lShift_);
MODULE_ADD_SYM(Int, iter_);
+ MODULE_ADD_SYM(Int, cDataLen_);
MODULE_SUB_INIT(IntGen);
MODULE_ADD_SYM(IntGen, next);
Modified: trunk/src/init.pth
===================================================================
--- trunk/src/init.pth 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/init.pth 2004-06-03 01:15:55 UTC (rev 563)
@@ -14,5 +14,5 @@
# this is executed before Main1 as module PthMod1
-import Re,File
+#import Re,File
Modified: trunk/src/object.h
===================================================================
--- trunk/src/object.h 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/object.h 2004-06-03 01:15:55 UTC (rev 563)
@@ -142,6 +142,10 @@
obj_p new_attrdict_obj(isp ist, obj_p obj);
obj_p new_float_obj(isp ist, double num);
obj_p new_hash_obj(isp ist, i32_t num);
+obj_p new_int_obj(isp ist, i64_t num);
+obj_p new_int_long_obj(isp ist, long_p longp);
+long_p PyLong_FromString(char *str, char **pend, int base);
+int int_is_zero(obj_p obj);
void dict2attrs(isp ist, obj_p dict, obj_p obj);
void list2protos(isp ist, obj_p list, obj_p obj);
Modified: trunk/src/parser.h
===================================================================
--- trunk/src/parser.h 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/parser.h 2004-06-03 01:15:55 UTC (rev 563)
@@ -119,17 +119,20 @@
#define OR_FLAG 0
#define AND_FLAG 1
+
#define NEW_LIST_ 0
#define NEW_TUPLE_ 1
+
#define NEW_REAL 0
#define NEW_IMAG 1
+
#define NEW_STRN 0
#define NEW_LONG 1
+
#define DEF_FLG 0
-#define GEN_FLG 2
-#define WTH_FLG 3
+#define GEN_FLG 1
+#define WTH_FLG 2
-
clist_p append_import_param(void* param, clist_p list, clist_p iparam);
clist_p append_label_to_import_path(void* param, clist_p list, obj_p label);
clist_p append_list(void* param, clist_p list, code_p item);
@@ -167,13 +170,13 @@
code_p expr_to_param(void* param, code_p expr);
code_p expr_to_slice(void* param, code_p expr);
code_p expr_to_sparm(void* param, code_p p1);
-code_p float_to_obj(void* param, double num, int imag_flag);
+code_p float_to_obj(void* param, double num, obj_p int_obj, int imag_flag);
code_p expr_for_lcc_to_listcomp(void* param, code_p expr, clist_p forlst, clist_p lcc);
code_p for_lcc_body_else(void* param, clist_p locals, code_p body, code_p els);
code_p from_path_import_params(void* param, clist_p path, clist_p iparms);
code_p if_expr_body_elif_else(void* param, clist_p ifex_list, code_p body, clist_p elif, code_p els);
code_p import_params(void* param, clist_p iparms);
-code_p int_to_obj(void* param, i64_t num);
+code_p int_to_obj(void* param, obj_p num);
code_p label_eq_expr_to_formparm(void* param, obj_p label, code_p expr);
code_p label_eq_expr_to_param(void* param, obj_p label, code_p expr);
code_p label_to_attrref(void* param, obj_p label);
Modified: trunk/src/parser_routines.c
===================================================================
--- trunk/src/parser_routines.c 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/parser_routines.c 2004-06-03 01:15:55 UTC (rev 563)
@@ -1464,23 +1464,20 @@
code_p star_star_dict_to_param(void* param, code_p expr){
return debug_retrn(__LINE__, word_expr_to_param(param, PARAM_STAR_STAR, expr));
}
-code_p int_to_obj(void* param, i64_t num){
- code_p res;
- obj_p obj = new_object(IST, OBJ(INT_PROTO));
- obj->data_type = DATA_TYPE_IMMDATA;
- obj->imm_data_len = 8;
- obj->data.i64 = num;
- res = new_code(param, 2, 1, 1, OP_PUSH);
+code_p int_to_obj(void* param, obj_p num) {
+ code_p res = new_code(param, 2, 1, 1, OP_PUSH);
res->code_data[0].bytecode.param = 2;
- res->code_data[1].data = obj;
- add_to_const_list(param, obj);
+ res->code_data[1].data = num;
return debug_retrn(__LINE__, res);
}
-code_p float_to_obj(void* param, double num, int imag_flag){
+code_p float_to_obj(void* param, double num, obj_p int_obj, int imag_flag) {
code_p res;
obj_p proto = (imag_flag == NEW_IMAG? OBJ(IMAG_PROTO) : OBJ(FLOAT_PROTO));
obj_p obj = new_object(IST, proto);
- *((double*) obj_malloc(IST, proto, obj, sizeof(double))) = num;
+ if (int_obj)
+ *((double*) obj_malloc(IST, proto, obj, sizeof(double))) = (double) int2i64t(IST, int_obj);
+ else
+ *((double*) obj_malloc(IST, proto, obj, sizeof(double))) = num;
res = new_code(param, 2, 1, 1, OP_PUSH);
res->code_data[0].bytecode.param = 2;
res->code_data[1].data = obj;
Modified: trunk/src/prothon.y
===================================================================
--- trunk/src/prothon.y 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/prothon.y 2004-06-03 01:15:55 UTC (rev 563)
@@ -89,7 +89,7 @@
%pure_parser
%union {
- u64_t int_type;
+ obj_p int_type;
double float_type;
obj_p str_type;
code_p code_type;
@@ -547,10 +547,10 @@
SELF { $$ = self_to_obj(yylex_param); }
| CALLER { $$ = caller_to_obj(yylex_param); }
| INT_ { $$ = int_to_obj(yylex_param, $1); }
- | FLOAT_ { $$ = float_to_obj(yylex_param, $1, NEW_REAL); }
- | INT_IMAG { $$ = float_to_obj(yylex_param, (double) $1, NEW_IMAG); }
- | FLOAT_IMAG { $$ = float_to_obj(yylex_param, $1, NEW_IMAG); }
- | STRING { $$ = string_to_obj(yylex_param, $1, NEW_STRN); }
+ | FLOAT_ { $$ = float_to_obj(yylex_param, $1, NULL, NEW_REAL); }
+ | INT_IMAG { $$ = float_to_obj(yylex_param, 0.0, $1, NEW_IMAG); }
+ | FLOAT_IMAG { $$ = float_to_obj(yylex_param, $1, NULL, NEW_IMAG); }
+ | STRING { $$ = string_to_obj(yylex_param, $1); }
| '`' LABEL %prec '`' { $$ = rquote_lbl_to_obj(yylex_param, $2); }
| target_param { $$ = tgtparm_to_obj(yylex_param, $1); }
| '{' brace_params '}' { $$ = new_dict(yylex_param, $2); }
@@ -1215,17 +1215,22 @@
else if (*p >= 'A' && *p <= 'F')
val = val * 16 + *p - 'A' + 10;
}
- lvalp->int_type = val;
+ lvalp->int_type = new_int_obj((((parse_state*) yylex_param)->ist), val);
} else {
u64_t val = 0;
for (p=str_ptr+1; *p; p++) {
val = val * 8 + *p - '0';
}
- lvalp->int_type = val;
+ lvalp->int_type = new_int_obj((((parse_state*) yylex_param)->ist), val);
}
- } else
- lvalp->int_type = apr_atoi64(str_ptr);
- if (nonzero_flag && lvalp->int_type == 0){
+ } else {
+ if (strlen(str_ptr) < 16)
+ lvalp->int_type = new_int_obj((((parse_state*) yylex_param)->ist), apr_atoi64(str_ptr));
+ else
+ lvalp->int_type = new_int_long_obj( (((parse_state*) yylex_param)->ist),
+ PyLong_FromString(str_ptr, NULL, 10) );
+ }
+ if (nonzero_flag && int_is_zero(lvalp->int_type)){
printf("Lexical error: invalid integer number format\n");
return ERR;
}
Modified: trunk/src/src.vcproj
===================================================================
--- trunk/src/src.vcproj 2004-05-30 21:00:47 UTC (rev 562)
+++ trunk/src/src.vcproj 2004-06-03 01:15:55 UTC (rev 563)
@@ -245,9 +245,6 @@
<File
RelativePath="..\include\prothon\prothon_dll.h">
</File>
- <File
- RelativePath="thread.h">
- </File>
</Filter>
<Filter
Name="Resource Files"
@@ -264,6 +261,9 @@
<File
RelativePath="..\pr\test\test.pr">
</File>
+ <File
+ RelativePath="thread.h">
+ </File>
</Filter>
</Files>
<Globals>