Skip to content

Commit

Permalink
version 10.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ab25cq committed Mar 7, 2019
1 parent a314e50 commit 038dad0
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 84 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

version 10.2.1

Java Script Reflection.

version 10.2.0

Fixed the bug of REPL
Expand Down
8 changes: 8 additions & 0 deletions JS.jsclcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class System:js
}
}

class Global:js
{
}

class Clover:js
{
def test(str:String, exp:bool):static native {
Expand Down Expand Up @@ -1054,6 +1058,10 @@ class String:native js
def trim():pure_native String;
def trimEnd():pure_native String;
def trimStart():pure_native String;

def println() {
System.println(self);
}
}

class Set<T:ISortable>:native js
Expand Down
2 changes: 2 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ String.ojsclcl: JS.jsclcl
PWD=`pwd`; ./cclover2 -core Tuple9.ojsclcl
PWD=`pwd`; ./cclover2 -core Exception.ojsclcl
PWD=`pwd`; ./cclover2 -core System.ojsclcl
PWD=`pwd`; ./cclover2 -core Global.ojsclcl
PWD=`pwd`; ./cclover2 -core Clover.ojsclcl
PWD=`pwd`; ./cclover2 -core Array.ojsclcl
PWD=`pwd`; ./cclover2 -core Int8Array.ojsclcl
Expand Down Expand Up @@ -561,6 +562,7 @@ install:
$(INSTALL) -m 644 ./MWrapperClassBase.clm $(DESTDIR)/share/clover2

$(INSTALL) -m 644 System.ojsclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 Global.ojsclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 Clover.ojsclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 Object.ojsclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 String.ojsclcl $(DESTDIR)/share/clover2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# clover2 computer language

version 10.2.0
version 10.2.1

サポートしている機能

Expand Down
69 changes: 36 additions & 33 deletions Reflection.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,19 @@ class Class
numClassFields:int;
numMethods:int;

JS:bool;

def initialize() {}

def initialize(class_name:String) {
def initialize(class_name:String, js:bool=false) {
className = class_name;
flags = Clover.getClassFlags(class_name);
genericsParamTypes = Clover.getClassGenericsParamTypes(class_name);
genericsParamNames = Clover.getClassGenericsParamNames(class_name);
numFields = Clover.getNumFields(class_name);
numClassFields = Clover.getNumClassFields(class_name);
numMethods = Clover.getNumMethods(class_name);
flags = Clover.getClassFlags(class_name, js);
genericsParamTypes = Clover.getClassGenericsParamTypes(class_name,js);
genericsParamNames = Clover.getClassGenericsParamNames(class_name,js);
numFields = Clover.getNumFields(class_name,js);
numClassFields = Clover.getNumClassFields(class_name,js);
numMethods = Clover.getNumMethods(class_name,js);
JS = js;
}

def clone():Class {
Expand Down Expand Up @@ -178,22 +181,22 @@ class Class
}

def appendField(name:String, type:String) {
Clover.appendField(className, name, type);
Clover.appendField(className, name, type, JS);
}
def appendMethod(code:String) {
Clover.appendMethod(className, code);
Clover.appendMethod(className, code, JS);
}
def appendMethod(method_index:int, code:String) {
Clover.appendMethod(className, method_index, code);
Clover.appendMethod(className, method_index, code, JS);
}
def declareMethod(code:String):int {
return Clover.declareMethod(className, code);
}
def appendClassField(name:String, type:String) {
Clover.appendClassField(className, name, type);
Clover.appendClassField(className, name, type, JS);
}
def getField(index:int): Field {
return Clover.getField(className, index);
return Clover.getField(className, index, JS);
}
def getField(name:String): Field? {
for(i:=0; i<numFields; i++) {
Expand All @@ -207,7 +210,7 @@ class Class
return null;
}
def getClassField(index:int): Field {
return Clover.getClassField(className, index);
return Clover.getClassField(className, index, JS);
}
def getClassField(name:String): Field? {
for(i:=0; i<numClassFields; i++) {
Expand All @@ -221,7 +224,7 @@ class Class
return null;
}
def getMethod(index:int): Method {
return Clover.getMethod(className, index);
return Clover.getMethod(className, index, JS);
}
def getMethod(name:String): Method? {
for(i:=numMethods-1; i>=0; i--) { # reverse search for multiple definition
Expand Down Expand Up @@ -262,7 +265,7 @@ class Class
return result;
}
def createObject(): Anonymous {
return Clover.createObject(className);
return Clover.createObject(className, JS);
}
def createArray(size:int): Anonymous {
return Clover.createArray(className, size);
Expand All @@ -275,27 +278,27 @@ class Class

inherit Clover
{
def appendField(class_name:String, name:String, type:String):static native throws Exception;
def appendMethod(class_name:String, code:String): static native throws Exception;
def appendMethod(class_name:String, method_index:int, code:String): static native throws Exception;
def appendClassField(class_name:String, name:String, type:String):static native throws Exception;
def appendField(class_name:String, name:String, type:String, js:bool=false):static native throws Exception;
def appendMethod(class_name:String, code:String, js:bool=false): static native throws Exception;
def appendMethod(class_name:String, method_index:int, code:String, js:bool=false): static native throws Exception;
def appendClassField(class_name:String, name:String, type:String, js:bool=false):static native throws Exception;
def appendClass(code:String):static native throws Exception;
def declareMethod(class_name:String, code:String): static native int throws Exception;

def getField(class_name:String, index:int):static native Field throws Exception;
def getClassField(class_name:String, index:int):static native Field throws Exception;
def getMethod(class_name:String, index:int):static native Method throws Exception;
def getClassFlags(class_name:String): static native long throws Exception;
def getClassGenericsParamTypes(class_name:String): static native String[] throws Exception;
def getClassGenericsParamNames(class_name:String): static native String[] throws Exception;
def getNumFields(class_name:String): static native int throws Exception;
def getNumClassFields(class_name:String): static native int throws Exception;
def getNumMethods(class_name:String): static native int throws Exception;
def isLoadedClass(class_name:String): static native bool throws Exception;
def isDefinedClass(class_name:String): static native bool throws Exception;
def createObject(class_name:String): static native Anonymous;

def isTypedefedClass(class_name:String, class_name2:String): static native bool;
def getField(class_name:String, index:int, js:bool=false):static native Field throws Exception;
def getClassField(class_name:String, index:int,js:bool=false):static native Field throws Exception;
def getMethod(class_name:String, index:int, js:bool=false):static native Method throws Exception;
def getClassFlags(class_name:String, js:bool=false): static native long throws Exception;
def getClassGenericsParamTypes(class_name:String, js:bool=false): static native String[] throws Exception;
def getClassGenericsParamNames(class_name:String, js:bool=false): static native String[] throws Exception;
def getNumFields(class_name:String, js:bool=false): static native int throws Exception;
def getNumClassFields(class_name:String, js:bool=false): static native int throws Exception;
def getNumMethods(class_name:String, js:bool=false): static native int throws Exception;
def isLoadedClass(class_name:String, js:bool=false): static native bool throws Exception;
def isDefinedClass(class_name:String, js:bool=false): static native bool throws Exception;
def createObject(class_name:String, js:bool=false): static native Anonymous;

def isTypedefedClass(class_name:String, class_name2:String, js:bool=false): static native bool;

def isPrimitiveClass(name:String):static bool {
return name.equals("int") || isTypedefedClass(name, "int") || name.equals("uint") || isTypedefedClass(name, "uint") || name.equals("byte") || isTypedefedClass(name, "byte") || name.equals("ubyte") || isTypedefedClass(name, "ubyte") || name.equals("short") || isTypedefedClass(name, "short") || name.equals("ushort") || isTypedefedClass(name, "ushort") || name.equals("long") || isTypedefedClass(name, "long") || name.equals("ulong") || isTypedefedClass(name, "ulong") || name.equals("float") || isTypedefedClass(name, "float") || name.equals("double") || isTypedefedClass(name, "double") || name.equals("pointer") || isTypedefedClass(name, "pointer") || name.equals("char") || isTypedefedClass(name, "char") || name.equals("bool") || isTypedefedClass(name, "bool") || name.match(/lambda$|lambda\(\)|lambda\(.*/) || isTypedefedClass(name, "lambda") || name.equals("regex")|| isTypedefedClass(name, "regex") ;
Expand Down
3 changes: 0 additions & 3 deletions a.jscl
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
var abc = 1;
var def = 2;

Binary file added a.ojscl
Binary file not shown.
4 changes: 4 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

clover2 (10.2.1-1) unstable; urgency=medium

* Java Script Reflection.

clover2 (10.2.0-1) unstable; urgency=medium

* Fixed the bug of REPL
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: unknown
Priority: optional
Maintainer: Daisuke Minato <[email protected]>
Build-Depends: debhelper (>= 9), autotools-dev, libpcre3-dev, libreadline-dev, clang, libreadline7
Standards-Version: 10.2.0
Standards-Version: 10.2.1
Homepage: https://github.com/ab25cq/clover2/wiki
Vcs-Git: https://github.com/ab25cq/clover2.git

Expand Down
6 changes: 3 additions & 3 deletions debian/files
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
clover2-dbgsym_10.2.0-1_amd64.deb debug extra
clover2_10.2.0-1_amd64.buildinfo unknown optional
clover2_10.2.0-1_amd64.deb unknown optional
clover2-dbgsym_10.2.1-1_amd64.deb debug extra
clover2_10.2.1-1_amd64.buildinfo unknown optional
clover2_10.2.1-1_amd64.deb unknown optional
4 changes: 4 additions & 0 deletions manual/changelog-en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

version 10.2.1

Java Script Reflection.

version 10.2.0

Fixed the bug of REPL
Expand Down
4 changes: 4 additions & 0 deletions manual/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
English page is here [>> English page](changelog-en)

version 10.2.1

Java Script Reflection.

version 10.2.0

Fixed the bug of REPL
Expand Down
Loading

0 comments on commit 038dad0

Please sign in to comment.