rev 213 - in trunk: include/prothon modules/File modules/Re modules/String modules/Tuple pr src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-03-30 13:45:10 -0500 (Tue, 30 Mar 2004)
New Revision: 213
Modified:
trunk/include/prothon/prothon.h
trunk/modules/File/File.c
trunk/modules/Re/Re.c
trunk/modules/String/String.c
trunk/modules/Tuple/Tuple.c
trunk/pr/scope.pr
trunk/src/builtins.c
trunk/src/lock.c
trunk/src/object.c
trunk/src/parser_routines.c
trunk/src/src.vcproj
trunk/src/sys.c
Log:
fixed spelling of immutable
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/include/prothon/prothon.h 2004-03-30 18:45:10 UTC (rev 213)
@@ -91,9 +91,9 @@
//#define DEBUG_THREADS
//#define DEBUG_MEM_MGR
//#define TRACE_PARSER
-//#define TRACE_INTERPRETER
+#define TRACE_INTERPRETER
//#define DUMP_MODULE_CODE
-#define DUMP_OBJECTS_AT_END
+//#define DUMP_OBJECTS_AT_END
//************************* BASIC TYPE DEFINITIONS ********************************
@@ -171,7 +171,7 @@
u8_t imm_data_len :4;
obj_type_t data_type :3;
obj_state_t state :3;
- u8_t unmutable :1;
+ u8_t immutable :1;
u8_t del_locked :1;
u8_t scanned :1;
u8_t has_attrs :1;
@@ -883,7 +883,7 @@
// does no harm to add extra matching calls). Also, the write_lock and write_unlock
// routines in DLLs handle disabling the read-locks before calling write_locks.
// See the routine read_unlock_write_lock in object.c.
-// Note: If object has unmutable bit set, then read_lock call is effectively a no-op
+// Note: If object has immutable bit set, then read_lock call is effectively a no-op
// and write-lock call will cause an exception.
void read_lock (isp ist, obj_p obj);
void read_unlock (isp ist, obj_p obj);
@@ -891,9 +891,9 @@
void write_unlock (isp ist, obj_p obj);
//************************** UNMUTABLE BIT ***********************************
-// Each object has a bit called unmutable. This bit is effectively a write-protect
+// Each object has a bit called immutable. This bit is effectively a write-protect
// bit for the object. When set the object cannot be modified. Any attempt
-// to write_lock the object with unmutable set will cause an exception. This bit
+// to write_lock the object with immutable set will cause an exception. This bit
// also speeds up processing since the read_lock becomes a no_op when this bit
// is set. This bit is set for many common data types such as Int, String, Etc.
void set_unmutable(obj_p obj);
Modified: trunk/modules/File/File.c
===================================================================
--- trunk/modules/File/File.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/modules/File/File.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -312,7 +312,7 @@
buf = obj_str->str;
}
buf[total_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->immutable = TRUE;
return str_obj;
}
@@ -390,7 +390,7 @@
obj_str->len = total_read;
}
buf[total_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->immutable = TRUE;
return str_obj;
}
@@ -474,7 +474,7 @@
obj_str->len = num_read;
}
buf[num_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->immutable = TRUE;
list_append(ist, list_obj, str_obj);
}
return list_obj;
Modified: trunk/modules/Re/Re.c
===================================================================
--- trunk/modules/Re/Re.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/modules/Re/Re.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -166,7 +166,7 @@
else list_append(ist, tuple_obj, new_string_n_obj(s+sp,ep-sp));
}
list_append(ist, res, tuple_obj);
- tuple_obj->unmutable = TRUE;
+ tuple_obj->immutable = TRUE;
}
}
pr_free(m);
@@ -539,7 +539,7 @@
res = new_tuple_obj(2);
list_append(ist, res, list_item(ist, self, 2*grp ));
list_append(ist, res, list_item(ist, self, 2*grp+1));
- res->unmutable = TRUE;
+ res->immutable = TRUE;
return res;
}
@@ -611,7 +611,7 @@
if (sp == -1) list_append(ist, res, OBJ(NONE));
else list_append(ist, res, new_string_n_obj(orig_s+sp, ep-sp));
}
- res->unmutable = TRUE;
+ res->immutable = TRUE;
return res;
}
}
@@ -628,7 +628,7 @@
if (sp == -1) list_append(ist, res, parms[1]);
else list_append(ist, res, new_string_n_obj(orig_s+sp, ep-sp));
}
- res->unmutable = TRUE;
+ res->immutable = TRUE;
return res;
}
Modified: trunk/modules/String/String.c
===================================================================
--- trunk/modules/String/String.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/modules/String/String.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -96,7 +96,7 @@
memcpy(&(obj_str->str[slen]), strch(other), olen);
obj_str->str[tlen] = 0;
}
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
@@ -130,7 +130,7 @@
memcpy(obj_str->str+i*len, strch(self), len);
obj_str->str[tlen] = 0;
}
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
Modified: trunk/modules/Tuple/Tuple.c
===================================================================
--- trunk/modules/Tuple/Tuple.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/modules/Tuple/Tuple.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -110,7 +110,7 @@
size = len*times;
if(times == 0) {
obj_p res = new_tuple_obj(0);
- res ->unmutable = TRUE;
+ res ->immutable = TRUE;
return res;
}
if(times == 1) return self;
Modified: trunk/pr/scope.pr
===================================================================
--- trunk/pr/scope.pr 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/pr/scope.pr 2004-03-30 18:45:10 UTC (rev 213)
@@ -1,3 +1,25 @@
+<<<<<<< .mine
+
+print
+print "This should print 1 2 3 4 5 6"
+print
+
+obj = Object()
+obj.x = 1
+Object.x = 2
+X = 3
+def obj.f1():
+ x = 4
+ def f2():
+ x = 5
+ print .x, ^x, X, &x, x, @x
+ return f2
+x=6
+with obj:
+ .f1()() # prints 1 2 3 4 5 6
+
+print
+=======
#!/usr/local/bin/prothon
print
@@ -18,3 +40,4 @@
obj.f()
print
+>>>>>>> .r210
Modified: trunk/src/builtins.c
===================================================================
--- trunk/src/builtins.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/builtins.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -688,7 +688,7 @@
DEF (Int, __gen__, NULL) {
obj_p gen_obj = new_int_obj(0);
- gen_obj->unmutable = FALSE;
+ gen_obj->immutable = FALSE;
gen_obj->attr_proto.proto = IntGen_OBJ;
set_attr(ist, gen_obj, SYM_LIMIT, self);
return gen_obj;
Modified: trunk/src/lock.c
===================================================================
--- trunk/src/lock.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/lock.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -90,7 +90,7 @@
//********************************* read_lock_try *****************************
int read_lock_try(isp ist, obj_p obj) {
if (!lock((obj)->wrlock)) return FALSE;
- if (obj->unmutable) {
+ if (obj->immutable) {
free_wrlock(obj);
return TRUE;
}
@@ -108,7 +108,7 @@
//********************************* read_lock *********************************
void read_lock(isp ist, obj_p obj) {
get_wrlock(obj, NO_WAIT);
- if (obj->unmutable) {
+ if (obj->immutable) {
free_wrlock(obj);
return;
}
@@ -129,7 +129,7 @@
void read_unlock(isp ist, obj_p obj) {
int write_ready_flag;
get_wrlock(obj, NO_WAIT);
- if (obj->unmutable) {
+ if (obj->immutable) {
free_wrlock(obj);
return;
}
@@ -147,8 +147,8 @@
//********************************* write_lock_try ****************************
int write_lock_try(isp ist, obj_p obj) {
if (!lock((obj)->wrlock)) return FALSE;
- if (obj->unmutable) {
- raise_exception(ist, OBJ(LOCK_EXC), "write_lock attempted on an unmutable object");
+ if (obj->immutable) {
+ raise_exception(ist, OBJ(LOCK_EXC), "write_lock attempted on an immutable object");
free_wrlock(obj);
return FALSE;
}
@@ -164,8 +164,8 @@
void write_lock(isp ist, obj_p obj) {
int sav_cnt = 0;
get_wrlock(obj, NO_WAIT);
- if (obj->unmutable) {
- raise_exception(ist, OBJ(LOCK_EXC), "write_lock attempted on an unmutable object");
+ if (obj->immutable) {
+ raise_exception(ist, OBJ(LOCK_EXC), "write_lock attempted on an immutable object");
// something should be done to stop code from actually modifying object XXX
free_wrlock(obj);
return;
@@ -192,7 +192,7 @@
//********************************* write_unlock ******************************
void write_unlock(isp ist, obj_p obj) {
int write_ready_flag;
- if (obj->unmutable) return;
+ if (obj->immutable) return;
assert(obj->wrlock);
obj->long_wrlock = FALSE;
obj->archived = FALSE;
Modified: trunk/src/object.c
===================================================================
--- trunk/src/object.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/object.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -326,14 +326,14 @@
//********************************* set_unmutable *****************************
void set_unmutable(obj_p obj){
get_wrlock(obj, NO_WAIT);
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
free_wrlock(obj);
}
//********************************* clr_unmutable *****************************
void clr_unmutable(obj_p obj){
get_wrlock(obj, NO_WAIT);
- obj->unmutable = FALSE;
+ obj->immutable = FALSE;
free_wrlock(obj);
}
@@ -793,7 +793,7 @@
obj->data_type = OBJ_TYPE_IMMDATA;
obj->imm_data_len = 8;
obj->data.i64 = num;
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
@@ -803,7 +803,7 @@
obj->data_type = OBJ_TYPE_IMMDATA;
obj->imm_data_len = 8;
obj->data.f64 = num;
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
@@ -826,7 +826,7 @@
obj_str->len = len;
strcpy(&(obj_str->str[0]), str);
}
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
@@ -847,7 +847,7 @@
memcpy(&(obj_str->str[0]), str, len);
obj_str->str[len] = 0;
}
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
return obj;
}
@@ -858,7 +858,7 @@
hash_obj->imm_data_len = 4;
hash_obj->data.i32[0] = num & HASH_MASK;
if (!(hash_obj->data.i32[0])) hash_obj->data.i32[0] = 1;
- hash_obj->unmutable = TRUE;
+ hash_obj->immutable = TRUE;
return hash_obj;
}
@@ -969,7 +969,7 @@
list_append_no_lock(slice_obj,ind3);
}
}
- slice_obj->unmutable = TRUE;
+ slice_obj->immutable = TRUE;
return slice_obj;
}
@@ -978,7 +978,7 @@
obj_p super_obj = new_object(OBJ(SUPER_PROTO));
super_obj->data_type = OBJ_TYPE_DATAPTR;
super_obj->data.ptr = symbol;
- super_obj->unmutable = TRUE;
+ super_obj->immutable = TRUE;
return super_obj;
}
Modified: trunk/src/parser_routines.c
===================================================================
--- trunk/src/parser_routines.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/parser_routines.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -1079,7 +1079,7 @@
memcpy(&(obj_str->str[0]), str, len);
obj_str->str[len] = 0;
}
- obj->unmutable = TRUE;
+ obj->immutable = TRUE;
p->code_data[0].bytecode.param = 2;
p->code_data[1].data = obj;
add_to_const_list(param, obj);
Modified: trunk/src/src.vcproj
===================================================================
--- trunk/src/src.vcproj 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/src.vcproj 2004-03-30 18:45:10 UTC (rev 213)
@@ -209,6 +209,9 @@
RelativePath="..\pr\hex.pr">
</File>
<File
+ RelativePath="..\pr\init.pr">
+ </File>
+ <File
RelativePath="init.pth">
</File>
<File
Modified: trunk/src/sys.c
===================================================================
--- trunk/src/sys.c 2004-03-30 17:33:25 UTC (rev 212)
+++ trunk/src/sys.c 2004-03-30 18:45:10 UTC (rev 213)
@@ -190,7 +190,7 @@
list_append(ist, vers_tuple, new_string_obj(PROTHON_VERSION_NUMBER));
list_append(ist, vers_tuple, new_string_obj(numonly(PROTHON_VERSION_BUILD, path)));
list_append(ist, vers_tuple, new_string_obj(PROTHON_VERSION_DATE));
- vers_tuple->unmutable = TRUE;
+ vers_tuple->immutable = TRUE;
set_attr(ist, sys_module, sym(ist, "version"), vers_tuple);
set_attr(ist, sys_module, sym(ist, "maxint"), new_int_obj(MAX_INT_VAL));
set_attr(ist, sys_module, sym(ist, "modules"), OBJ(MODULES));