Skip to content

Commit

Permalink
10.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ab25cq committed Mar 31, 2019
1 parent a062cb2 commit e0584ab
Show file tree
Hide file tree
Showing 25 changed files with 283 additions and 62 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

version 10.3.2

normal block local variable bug.

The case of `for(i:=0; i<5; i++) {}`, the i variable is inner block scope.

for it in {1,2,3} { it.toString().println(); } can be ruunned.

version 10.3.1

new Editor sample.
Expand Down
12 changes: 8 additions & 4 deletions Fundamental.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class String

self.buffer = char[size]();

for(i := 0; i<len; i++) {
i:=0;
for(i= 0; i<len; i++) {
self.buffer[i] = str.buffer[i];
}
self.buffer[i] = '\0';
Expand Down Expand Up @@ -166,7 +167,8 @@ class String
len := str.length();

if(self.len+len+1 < self.size) {
for(i:=self.len; i<self.len + len; i++) {
i:=0;
for(i=self.len; i<self.len + len; i++) {
self.buffer[i] = str.buffer[i-self.len];
}
self.buffer[i] = '\0';
Expand All @@ -177,7 +179,8 @@ class String
new_size := (self.len + len + 1) * 2;
new_buffer := char[new_size];

for(i:int = 0; i<self.len; i++) {
i:=0;
for(i=0; i<self.len; i++) {
new_buffer[i] = self.buffer[i];
}
for(i=self.len; i<self.len + len; i++) {
Expand Down Expand Up @@ -206,7 +209,8 @@ class String
new_size := (self.len + len + 1) * 2;
new_buffer := char[new_size];

for(i := 0; i<self.len; i++) {
i := 0;
for(i=0; i<self.len; i++) {
new_buffer[i] = self.buffer[i];
}
new_buffer[i] = c;
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ test:
PWD=`pwd` ./cclover2 code/KotlinTest.clcl
PWD=`pwd` ./cclover2 code/MethodGenericsTest.clcl
PWD=`pwd` ./cclover2 code/MethodBlock.clcl
PWD=`pwd` ./cclover2 code/ForBlock.clcl
PWD=`pwd` ./cclover2 code/ReturnTest.clcl
PWD=`pwd` ./cclover2 code/ResultTypeTest.clcl
PWD=`pwd` ./cclover2 code/IsTest.clcl
Expand Down Expand Up @@ -870,4 +871,3 @@ js-test:
PWD=`pwd` ./cclover2 code/js.jscl
PWD=`pwd` ./cclover2 code/js.ojscl
PWD=`pwd` $(NODEJS) code/js.js

24 changes: 16 additions & 8 deletions String.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ inherit String
len := str.length();

if(self.len+len + 1 < self.size) {
for(i :=self.len -1; i>=index; i--) {
i:=0;
for(i=self.len -1; i>=index; i--) {
self.buffer[i+len] = self.buffer[i];
}
for(i = 0; i<len; i++) {
Expand All @@ -233,7 +234,8 @@ inherit String
new_size:int = (self.len + len + 1) * 2 + 1;
new_buffer:char[] = char[new_size];

for(i := 0; i<index; i++) {
i := 0;
for(i=0; i<index; i++) {
new_buffer[i] = self.buffer[i];
}
for(i=index; i<self.len; i++) {
Expand Down Expand Up @@ -269,7 +271,8 @@ inherit String
}

if(index >= 0 && index < self.len) {
for(i := index; i<self.len-1; i++) {
i := 0;
for(i=index; i<self.len-1; i++) {
self.buffer[i] = self.buffer[i+1];
}
self.buffer[i] = '\0';
Expand Down Expand Up @@ -303,7 +306,8 @@ inherit String
}

if(index < index2 && index < self.len && index2 <= self.len) {
for(i:= index; i<self.len-(index2-index); i++) {
i := 0;
for(i=index; i<self.len-(index2-index); i++) {
self.buffer[i] = self.buffer[i+index2-index];
}
self.buffer[i] = '\0';
Expand Down Expand Up @@ -338,7 +342,8 @@ inherit String

result: String = String(end-start+1);

for(i:int = 0; i<end-start; i++) {
i := 0;
for(i=0; i<end-start; i++) {
result.buffer[i] = self.chars(i+start);
}
result.buffer[i] = '\0';
Expand Down Expand Up @@ -419,7 +424,8 @@ inherit String
len:int = str.length();

for(i:=0; i<self.len; i++) {
for(j:=0; j<str.len; j++) {
j:=0;
for(j=0; j<str.len; j++) {
if(self.buffer[i+j] != str.buffer[j])
{
break;
Expand All @@ -444,7 +450,8 @@ inherit String
len := str.length();

for(i:=self.len-len; i>=0; i--) {
for(j:=0; j<len; j++) {
j:=0;
for(j=0; j<len; j++) {
if(self.buffer[i+j] != str.buffer[j])
{
break;
Expand Down Expand Up @@ -583,7 +590,8 @@ inherit String
def reverse(): String {
result:String = String(self.size);

for(i:int = 0; i<self.len; i++) {
i := 0;
for(i=0; i<self.len; i++) {
result.buffer[i] = self.buffer[self.len-i-1];
}
result.buffer[i] = '\0';
Expand Down
4 changes: 4 additions & 0 deletions a
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for(it:=list.head; it != null; it = it.next)
{
item := it.item;
}
7 changes: 6 additions & 1 deletion a.cl
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
ClassA.method();
for(i:=0; i<5; i++) {
println("AAA");
}
for(i:=0; i<5; i++) {
println("AAA");
}
2 changes: 0 additions & 2 deletions app-sample/vicl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Vi Clone by Clover2.

This is under constructing. I recommended that you use this for Clover2 test sources.

require Clover2 version 10.2.1 later

* Install

```
Expand Down
8 changes: 4 additions & 4 deletions app-sample/vicl/config.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ ./configure --prefix=/data/data/com.termux/files/home --with-jit
$ ./configure --prefix=/data/data/com.termux/files/home

## --------- ##
## Platform. ##
## --------- ##

hostname = localhost
uname -m = aarch64
uname -r = 3.18.20-perf-ga132542
uname -r = 4.14.83-perf-gf5aaf38
uname -s = Linux
uname -v = #1 SMP PREEMPT Mon Nov 21 10:55:09 2016
uname -v = #1 SMP PREEMPT Sat Mar 9 13:22:03 CST 2019

/usr/bin/uname -p = unknown
/bin/uname -X = unknown
Expand Down Expand Up @@ -173,7 +173,7 @@ EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
JIT='1'
JIT='0'
LDFLAGS=''
LIBOBJS=''
LIBS=' -lutil'
Expand Down
6 changes: 3 additions & 3 deletions app-sample/vicl/config.status
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ $config_files
Report bugs to the package provider."

ac_cs_config="'--prefix=/data/data/com.termux/files/home' '--with-jit'"
ac_cs_config="'--prefix=/data/data/com.termux/files/home'"
ac_cs_version="\
config.status
configured by ./configure, generated by GNU Autoconf 2.69,
Expand Down Expand Up @@ -496,7 +496,7 @@ if $ac_cs_silent; then
fi

if $ac_cs_recheck; then
set X /bin/sh './configure' '--prefix=/data/data/com.termux/files/home' '--with-jit' $ac_configure_extra_args --no-create --no-recursion
set X /bin/sh './configure' '--prefix=/data/data/com.termux/files/home' $ac_configure_extra_args --no-create --no-recursion
shift
$as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
CONFIG_SHELL='/bin/sh'
Expand Down Expand Up @@ -586,7 +586,7 @@ S["LTLIBOBJS"]=""
S["LIBOBJS"]=""
S["DESTDIR"]="/data/data/com.termux/files/home"
S["OS"]="LINUX"
S["JIT"]="1"
S["JIT"]="0"
S["OBJEXT"]="o"
S["EXEEXT"]=""
S["ac_ct_CC"]="gcc"
Expand Down
5 changes: 3 additions & 2 deletions app-sample/vicl/vicl14Completion.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,8 @@ class ViClone version 14
start_i = line.length()-1;
}
inputing_text := "";
for(i:=start_i; i >= 0; i--) {
i := 0;
for(i=start_i; i >= 0; i--) {
if(line.chars(i).isalnum() || line.chars(i) == '_')
{
inputing_text.insert(0, line.chars(i));
Expand Down Expand Up @@ -977,4 +978,4 @@ class ViClone version 14
(inputing_text,i) := gettingInputingWord();
completion_core(inputing_text, i, words)
}
}
}
5 changes: 3 additions & 2 deletions app-sample/vicl/vicl5Word.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ class ViClone version 5
win.moveCursor(y, x);
}
elif(y < real_pos_y) {
for(i:=real_pos_y; i>y; i--) {
i := 0;
for(i=real_pos_y; i>y; i--) {
line = win.texts.items(i);
line.setValue("");
}
Expand Down Expand Up @@ -362,4 +363,4 @@ class ViClone version 5
}
}
}
}
}
17 changes: 17 additions & 0 deletions code/ForBlock.clcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class ForBlock {
def main():static {
for(i:=0; i<5; i++) {
println("AAA");
}
for(i:=0; i<5; i++) {
println("BBB");
}

for it in {1,2,3} {
it.toString().println();
}
for it in {1,2,3} {
it.toString().println();
}
}
}
2 changes: 2 additions & 0 deletions code/main.cl
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,5 @@ println("MixinLayersTest");
MixinLayersTest.main();
println("GCMemoryTest");
GCMemoryTest.main();
println("ForBlock");
ForBlock.main();
1 change: 1 addition & 0 deletions conf6789
1 change: 1 addition & 0 deletions conf6789.dir/conf6789.file
1 change: 1 addition & 0 deletions conf6789.file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

clover2 (10.3.2-1) unstable; urgency=medium

* normal block local variable bug. The case of `for(i:=0; i<5; i++) {}`,
the i variable is inner block scope. `for it in {1,2,3} {
it.toString().println(); }` can be ruunned.

clover2 (10.3.1-1) unstable; urgency=medium

* new Editor sample.
Expand Down
8 changes: 8 additions & 0 deletions manual/changelog-en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

version 10.3.2

normal block local variable bug.

The case of `for(i:=0; i<5; i++) {}`, the i variable is inner block scope.

for it in {1,2,3} { it.toString().println(); } can be ruunned.

version 10.3.1

new Editor sample.
Expand Down
9 changes: 9 additions & 0 deletions manual/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
English page is here [>> English page](changelog-en)

version 10.3.2

normal block local variable bug.

The case of `for(i:=0; i<5; i++) {}`, the i variable is inner block scope.

for it in {1,2,3} { it.toString().println(); } can be ruunned.


version 10.3.1

new Editor sample.
Expand Down
9 changes: 6 additions & 3 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,13 @@ struct sNodeBlockStruct

typedef struct sNodeBlockStruct sNodeBlock;

sNodeBlock* sNodeBlock_alloc(BOOL clone);
void append_node_to_node_block(sNodeBlock* node_block, unsigned int node);
void sNodeBlock_free(sNodeBlock* block);
sNodeBlock* sNodeBlock_clone(sNodeBlock* block);
BOOL parse_block(ALLOC sNodeBlock** node_block, sParserInfo* info, sVarTable* new_table, BOOL block_object, BOOL string_expression);
BOOL parse_block(ALLOC sNodeBlock** node_block, sParserInfo* info, sVarTable* new_table, BOOL block_object, BOOL string_expression, unsigned int pre_block_node, char* for_in_item_name);
void make_block_for_for_expresssion(ALLOC sNodeBlock** node_block, sParserInfo* info, unsigned int for_expression);
BOOL parse_block_for_in(ALLOC sNodeBlock** node_block, sParserInfo* info, sVarTable* new_table, BOOL block_object, BOOL string_expression, unsigned int item_node, char* item_name);
BOOL create_null_block(ALLOC sNodeBlock** node_block, sParserInfo* info, sVarTable* new_table, BOOL block_object);
BOOL parse_question_operator_block(unsigned int object_node, int num_method_chains, ALLOC sNodeBlock** node_block, sParserInfo* info);

Expand Down Expand Up @@ -2607,5 +2611,4 @@ extern BOOL gVMMutexFlg;
BOOL js_compiler(char* sname);
BOOL js_class_compiler(char* class_name);

#endif

#endif
2 changes: 1 addition & 1 deletion src/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -6051,7 +6051,7 @@ static BOOL call_normal_method(unsigned int node, sCompileInfo* info, sNodeType*
BOOL lambda = FALSE;

sNodeBlock* node_block = NULL;
if(!parse_block(ALLOC &node_block, &info2, new_table, TRUE, FALSE)) {
if(!parse_block(ALLOC &node_block, &info2, new_table, TRUE, FALSE, 0, NULL)) {
return FALSE;
}

Expand Down
Loading

0 comments on commit e0584ab

Please sign in to comment.