Skip to content

Commit

Permalink
version 10.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ab25cq committed Apr 13, 2019
1 parent 48bfce7 commit 27d027e
Show file tree
Hide file tree
Showing 48 changed files with 2,540 additions and 286 deletions.
4 changes: 4 additions & 0 deletions C.clcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extern
{
def puts(str:byte*):int;
}
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

version 10.3.6

Fixed the bug on PC

version 10.3.5

Finish curses library implement. I could't have suported all routines yet. It's too many....
Expand Down
11 changes: 8 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ OBJS=@OBJS@
COMPILER_OBJS=@COMPILER_OBJS@
JIT_OBJS=@JIT_OBJS@
JIT_RUNTIME_OBJS=@JIT_RUNTIME_OBJS@
JIT_SCRIPT_RUNTIME_OBJS=@JIT_SCRIPT_RUNTIME_OBJS@
COMMON_OBJS=@COMMON_OBJS@
INTERPRETER=@INTERPRETER@
JIT=@JIT@
Expand Down Expand Up @@ -71,6 +72,7 @@ SortableArray.oclcl: Fundamental.clcl String.clcl Container.clcl Range.clcl Comm
PWD=`pwd`; ./cclover2 -core CGI.clcl
PWD=`pwd`; ./cclover2 -core Socket.clcl
PWD=`pwd`; ./cclover2 -core MyOwnLibrary.clcl
PWD=`pwd`; ./cclover2 -core C.clcl

String.ojsclcl: JS.jsclcl
PWD=`pwd`; ./cclover2 -core JS.jsclcl
Expand Down Expand Up @@ -107,8 +109,8 @@ String.ojsclcl: JS.jsclcl
PWD=`pwd`; ./cclover2 -core Float64Array.ojsclcl
PWD=`pwd`; ./cclover2 -core DataView.ojsclcl

libclover2.so.1.0.0: $(COMMON_OBJ) $(COMPILER_OBJS) $(OBJS) $(JIT_RUNTIME_OBJS)
$(CC) -shared -o libclover2.so.1.0.0 $(COMMON_OBJS) $(COMPILER_OBJS) $(OBJS:src/class_clover_runtime.o=) $(CFLAGS) $(LIBS) $(JIT_RUNTIME_OBJS)
libclover2.so.1.0.0: $(COMMON_OBJ) $(COMPILER_OBJS) $(OBJS) $(JIT_RUNTIME_OBJS) $(JIT_SCRIPT_RUNTIME_OBJS) src/jit_main2.o
$(CC) -shared -o libclover2.so.1.0.0 $(JIT_SCRIPT_RUNTIME_OBJS) $(CFLAGS) $(LIBS)
ln -s -f libclover2.so.1.0.0 libclover2.so.1
ln -s -f libclover2.so.1.0.0 libclover2.so

Expand Down Expand Up @@ -551,6 +553,8 @@ install:
$(INSTALL) -m 644 ./Null.oclcl $(DESTDIR)/share/clover2
if test -e Null.so; then $(INSTALL) -m 755 ./Null.so.1.0.0 $(DESTDIR)/share/clover2; cp -a ./Null.so $(DESTDIR)/share/clover2; fi

if test -e C.oclcl; then $(INSTALL) -m 644 ./C.oclcl $(DESTDIR)/share/clover2; fi

$(INSTALL) -m 644 ./Object.oclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 ./IEqualable.oclcl $(DESTDIR)/share/clover2
$(INSTALL) -m 644 ./IHashKey.oclcl $(DESTDIR)/share/clover2
Expand Down Expand Up @@ -656,6 +660,7 @@ install:
$(INSTALL) -m 755 ./libclover2.so.1.0.0 $(DESTDIR)/lib
$(INSTALL) -m 755 ./libclover2.so.1 $(DESTDIR)/lib
$(INSTALL) -m 755 ./libclover2.so $(DESTDIR)/lib
if test -e src/jit_main2.o; then $(INSTALL) -m 644 src/jit_main2.o $(DESTDIR)/lib/; fi

mkdir -p $(DESTDIR)/include/clover2
$(INSTALL) -m 644 src/common.h $(DESTDIR)/include/clover2/clover2.h
Expand Down Expand Up @@ -833,7 +838,7 @@ test:

if test `uname` != Darwin; then gcc -shared -Wl,-soname=libExtTest.so.1 -o libExtTest.so.1.0.0 -I src/ -I . -I/usr/local/include -fPIC ext/hello.c; ln -fs libExtTest.so.1.0.0 libExtTest.so; PWD=`pwd` ./cclover2 ext.clcl && PWD=`pwd` ./clover2 ext.cl; fi

if test `uname` != Darwin; then gcc -shared -Wl,-soname=ExtensionTest.so.1 -o ExtensionTest.so.1.0.0 -fPIC ExtensionTest.c; ln -fs ExtensionTest.so.1.0.0 ExtensionTest.so; PWD=`pwd` ./cclover2 ExtensionClassTest.clcl; if test $(JIT) = 1; then ./bclover2 ExtensionClassTest.oclcl; fi; PWD=`pwd` ./clover2 ExtensionClassTest.cl; fi
# if test `uname` != Darwin; then gcc -shared -Wl,-soname=ExtensionTest.so.1 -o ExtensionTest.so.1.0.0 -fPIC ExtensionTest.c; ln -fs ExtensionTest.so.1.0.0 ExtensionTest.so; PWD=`pwd` ./cclover2 ExtensionClassTest.clcl; if test $(JIT) = 1; then ./bclover2 ExtensionClassTest.oclcl; fi; PWD=`pwd` ./clover2 ExtensionClassTest.cl; fi

PWD=`pwd` ./cclover2 code/getopt.cl && ./clover2 code/getopt.cl -a -b -c aaa xxxx gggg
PWD=`pwd` ./cclover2 code/getopt_long.cl && ./clover2 code/getopt_long.cl -a --break --clear aaa --delete=ggg xxx yyy zzz
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.3.5
version 10.3.6

サポートしている機能

Expand Down
4 changes: 2 additions & 2 deletions SystemCalls.clcl
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ inherit System
def init_color(pair:short, r:short, g:short, b:short): native;
def color_content(color:short, r:pointer@short, g:pointer@short, b:pointer@short):native;
def pair_content(pair:short, f:pointer@short, b:pointer@short): native;
def reset_color_pairs(): native;
#def reset_color_pairs(): native;
def COLOR_PAIRS(n:int):native int;
def PAIR_NUMBER(attr:int):native int;

Expand Down Expand Up @@ -819,4 +819,4 @@ inherit Command

return result;
}
}
}
5 changes: 5 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
実行形式で関数定義

C-FFIでstruct

C-FFIでint以外のデータ型に対応
993 changes: 993 additions & 0 deletions aaa

Large diffs are not rendered by default.

Binary file added b
Binary file not shown.
9 changes: 6 additions & 3 deletions b.cl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
klass := Class("ClassX");
println("AAA");
def fun():int {
return 1+1;
}

fun().toString().println();

methods := klass.getClassMethods();

println(methods.length().toString())
Empty file removed b.clccl
Empty file.
10 changes: 3 additions & 7 deletions b.clcl
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
class ClassX
class InvokePuts
{
def initialize() {
}

def method():static {
}

def method2() {
a := C.puts(C"HELLO C FFI");
a.toString().println();
}
}
11 changes: 11 additions & 0 deletions c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <stdlib.h>

const char* iii = "ABC";

int main()
{
printf("%s", iii);

exit(0);
}
54 changes: 41 additions & 13 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ NODEJS
SCRIPT_OBJS
COMMON_OBJS
COMPILER_OBJS
JIT_SCRIPT_RUNTIME_OBJS
JIT_RUNTIME_OBJS
JIT_OBJS
OBJS
Expand Down Expand Up @@ -4491,23 +4492,47 @@ echo "LLC=\"$LLC\"" >> bclover2
echo "CLANG=\"$CLANG\"" >> bclover2
echo "CLANGPLUSPLUS=\"$CLANGPLUSPLUS\"" >> bclover2
echo "LLVM_CONFIG=\"$LLVM_CONFIG\"" >> bclover2
echo "LIBS=\"$LIBS\"" >> bclover2
echo "LIBS=\"$LIBS $($LLVM_CONFIG --cxxflags --ldflags --system-libs --libs all)\"" >> bclover2
echo "CXX=\"$CLANG\"" >> bclover2
echo "DESTDIR=\"$DESTDIR\"" >> bclover2
cat <<'EOF' >> bclover2
if test $1 = -core; then CORE=1; CLASS_NAME=${2%.*}; else CORE=0; CLASS_NAME=${1%.*}; fi
if test -e ./cclover2; then COMPILER=./cclover2; else COMPILER=cclover2; fi;
EXT_NAME=${1##*.}
if test $EXT_NAME = ocl
then
FILE_NAME=${1%.*};
echo "bitcompile $CLASS_NAME"
echo "bitcompile $1"
if test $CORE = 1; then $COMPILER -core -jit $CLASS_NAME.oclcl; else $COMPILER -jit $CLASS_NAME.oclcl; fi
if test -e ./cclover2; then ./cclover2 -jit $1; else cclover2 -jit $1; fi
if test -e $CLASS_NAME.bc
then
$LLVM_DIS $CLASS_NAME.bc
$LLC -relocation-model=pic $CLASS_NAME.bc
$CLANG -o $CLASS_NAME.o -c $CLASS_NAME.s
$CLANG -shared -Wl,-soname=$CLASS_NAME.so.1 -o $CLASS_NAME.so.1.0.0 $CLASS_NAME.o
ln -fs $CLASS_NAME.so.1.0.0 $CLASS_NAME.so
if test -e $FILE_NAME.bc
then
$LLVM_DIS $FILE_NAME.bc
$LLC -relocation-model=pic $FILE_NAME.bc
if test -e src/jit_main2.o
then
$CXX -o $FILE_NAME src/jit_main2.o $FILE_NAME.s -L . -L $DESTDIR/lib -lclover2 $LIBS
else
$CXX -o $FILE_NAME $DESTDIR/lib/jit_main2.o $FILE_NAME.s -L . -L $DESTDIR/lib -lclover2 $LIBS
fi
fi
else
if test $1 = -core; then CORE=1; CLASS_NAME=${2%.*}; else CORE=0; CLASS_NAME=${1%.*}; fi
if test -e ./cclover2; then COMPILER=./cclover2; else COMPILER=cclover2; fi;
echo "bitcompile $CLASS_NAME"
if test $CORE = 1; then $COMPILER -core -jit $CLASS_NAME.oclcl; else $COMPILER -jit $CLASS_NAME.oclcl; fi
if test -e $CLASS_NAME.bc
then
$LLVM_DIS $CLASS_NAME.bc
$LLC -relocation-model=pic $CLASS_NAME.bc
$CLANG -o $CLASS_NAME.o -c $CLASS_NAME.s
$CLANG -shared -Wl,-soname=$CLASS_NAME.so.1 -o $CLASS_NAME.so.1.0.0 $CLASS_NAME.o -lclover2 $LIBS -L $DESTDIR/lib -L .
ln -fs $CLASS_NAME.so.1.0.0 $CLASS_NAME.so
fi
fi
EOF
Expand All @@ -4518,19 +4543,23 @@ chmod 755 bclover2
CFLAGS="$CFLAGS -Qunused-arguments"
#CFLAGS="$CFLAGS -Qunused-arguments -Wunused-variable"
COMMON_OBJS="src/buffer.o src/debug.o src/xfunc.o src/klass.o src/constant.o src/code.o src/alignment.o src/utf.o"
if test $ENABLE_JIT = 1
then
CFLAGS="$CFLAGS -DENABLE_JIT"
OBJS="src/vm.o src/script.o src/object.o src/array.o src/string.o src/block.o src/regex.o src/integer.o src/byte.o src/short.o src/long.o src/float.o src/pointer.o src/char.o src/bool.o src/hash.o src/list.o src/tuple.o src/carray.o src/type.o src/stack.o src/heap.o src/exception.o src/native_method.o src/class_system.o src/class_clover.o src/class_clover_runtime.o src/clover_to_clang.o src/class_thread.o"
COMPILER_OBJS="src/js.o src/parser.o src/node_type.o src/node.o src/cast.o src/vtable.o src/script_ctime.o src/node_block.o src/node_block_type.o src/class_compiler.o src/klass_compile_time.o src/method_compiler.o src/module.o src/class_clover_compile_time.o"
JIT_OBJS="src/jit.o src/jit2.o src/jit3.o src/jit4.o src/jit5.o src/jit6.o"
JIT_RUNTIME_OBJS="src/jit_runtime.o"
JIT_SCRIPT_RUNTIME_OBJS="$COMMON_OBJS $OBJS $JIT_RUNTIME_OBJS src/jit_main.o"
JIT=1
else
OBJS="src/vm.o src/script.o src/object.o src/array.o src/string.o src/block.o src/regex.o src/integer.o src/byte.o src/short.o src/long.o src/float.o src/pointer.o src/char.o src/bool.o src/hash.o src/list.o src/tuple.o src/carray.o src/type.o src/stack.o src/heap.o src/exception.o src/native_method.o src/class_system.o src/class_clover.o src/class_clover_runtime.o src/clover_to_clang.o src/class_thread.o"
COMPILER_OBJS="src/js.o src/parser.o src/node_type.o src/node.o src/cast.o src/vtable.o src/script_ctime.o src/node_block.o src/node_block_type.o src/class_compiler.o src/klass_compile_time.o src/method_compiler.o src/module.o src/class_clover_compile_time.o"
JIT_OBJS=
JIT_RUNTIME_OBJS=
JIT_SCRIPT_RUNTIME_OBJS=
JIT=0
fi
Expand Down Expand Up @@ -4564,7 +4593,6 @@ fi
done
COMMON_OBJS="src/buffer.o src/debug.o src/xfunc.o src/klass.o src/constant.o src/code.o src/alignment.o src/utf.o"
Expand Down
55 changes: 41 additions & 14 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -373,23 +373,47 @@ echo "LLC=\"$LLC\"" >> bclover2
echo "CLANG=\"$CLANG\"" >> bclover2
echo "CLANGPLUSPLUS=\"$CLANGPLUSPLUS\"" >> bclover2
echo "LLVM_CONFIG=\"$LLVM_CONFIG\"" >> bclover2
echo "LIBS=\"$LIBS\"" >> bclover2
echo "LIBS=\"$LIBS $($LLVM_CONFIG --cxxflags --ldflags --system-libs --libs all)\"" >> bclover2
echo "CXX=\"$CLANG\"" >> bclover2
echo "DESTDIR=\"$DESTDIR\"" >> bclover2
cat <<'EOF' >> bclover2
if test $1 = -core; then CORE=1; CLASS_NAME=${2%.*}; else CORE=0; CLASS_NAME=${1%.*}; fi
if test -e ./cclover2; then COMPILER=./cclover2; else COMPILER=cclover2; fi;
EXT_NAME=${1##*.}
if test $EXT_NAME = ocl
then
FILE_NAME=${1%.*};

echo "bitcompile $CLASS_NAME"
echo "bitcompile $1"

if test $CORE = 1; then $COMPILER -core -jit $CLASS_NAME.oclcl; else $COMPILER -jit $CLASS_NAME.oclcl; fi
if test -e ./cclover2; then ./cclover2 -jit $1; else cclover2 -jit $1; fi

if test -e $CLASS_NAME.bc
then
$LLVM_DIS $CLASS_NAME.bc
$LLC -relocation-model=pic $CLASS_NAME.bc
$CLANG -o $CLASS_NAME.o -c $CLASS_NAME.s
$CLANG -shared -Wl,-soname=$CLASS_NAME.so.1 -o $CLASS_NAME.so.1.0.0 $CLASS_NAME.o
ln -fs $CLASS_NAME.so.1.0.0 $CLASS_NAME.so
if test -e $FILE_NAME.bc
then
$LLVM_DIS $FILE_NAME.bc
$LLC -relocation-model=pic $FILE_NAME.bc

if test -e src/jit_main2.o
then
$CXX -o $FILE_NAME src/jit_main2.o $FILE_NAME.s -L . -L $DESTDIR/lib -lclover2 $LIBS
else
$CXX -o $FILE_NAME $DESTDIR/lib/jit_main2.o $FILE_NAME.s -L . -L $DESTDIR/lib -lclover2 $LIBS
fi
fi
else
if test $1 = -core; then CORE=1; CLASS_NAME=${2%.*}; else CORE=0; CLASS_NAME=${1%.*}; fi
if test -e ./cclover2; then COMPILER=./cclover2; else COMPILER=cclover2; fi;

echo "bitcompile $CLASS_NAME"

if test $CORE = 1; then $COMPILER -core -jit $CLASS_NAME.oclcl; else $COMPILER -jit $CLASS_NAME.oclcl; fi

if test -e $CLASS_NAME.bc
then
$LLVM_DIS $CLASS_NAME.bc
$LLC -relocation-model=pic $CLASS_NAME.bc
$CLANG -o $CLASS_NAME.o -c $CLASS_NAME.s
$CLANG -shared -Wl,-soname=$CLASS_NAME.so.1 -o $CLASS_NAME.so.1.0.0 $CLASS_NAME.o -lclover2 $LIBS -L $DESTDIR/lib -L .
ln -fs $CLASS_NAME.so.1.0.0 $CLASS_NAME.so
fi
fi
EOF

Expand All @@ -400,19 +424,23 @@ AC_SUBST(CXX)
CFLAGS="$CFLAGS -Qunused-arguments"
#CFLAGS="$CFLAGS -Qunused-arguments -Wunused-variable"

COMMON_OBJS="src/buffer.o src/debug.o src/xfunc.o src/klass.o src/constant.o src/code.o src/alignment.o src/utf.o"

if test $ENABLE_JIT = 1
then
CFLAGS="$CFLAGS -DENABLE_JIT"
OBJS="src/vm.o src/script.o src/object.o src/array.o src/string.o src/block.o src/regex.o src/integer.o src/byte.o src/short.o src/long.o src/float.o src/pointer.o src/char.o src/bool.o src/hash.o src/list.o src/tuple.o src/carray.o src/type.o src/stack.o src/heap.o src/exception.o src/native_method.o src/class_system.o src/class_clover.o src/class_clover_runtime.o src/clover_to_clang.o src/class_thread.o"
COMPILER_OBJS="src/js.o src/parser.o src/node_type.o src/node.o src/cast.o src/vtable.o src/script_ctime.o src/node_block.o src/node_block_type.o src/class_compiler.o src/klass_compile_time.o src/method_compiler.o src/module.o src/class_clover_compile_time.o"
JIT_OBJS="src/jit.o src/jit2.o src/jit3.o src/jit4.o src/jit5.o src/jit6.o"
JIT_RUNTIME_OBJS="src/jit_runtime.o"
JIT_SCRIPT_RUNTIME_OBJS="$COMMON_OBJS $OBJS $JIT_RUNTIME_OBJS src/jit_main.o"
JIT=1
else
OBJS="src/vm.o src/script.o src/object.o src/array.o src/string.o src/block.o src/regex.o src/integer.o src/byte.o src/short.o src/long.o src/float.o src/pointer.o src/char.o src/bool.o src/hash.o src/list.o src/tuple.o src/carray.o src/type.o src/stack.o src/heap.o src/exception.o src/native_method.o src/class_system.o src/class_clover.o src/class_clover_runtime.o src/clover_to_clang.o src/class_thread.o"
COMPILER_OBJS="src/js.o src/parser.o src/node_type.o src/node.o src/cast.o src/vtable.o src/script_ctime.o src/node_block.o src/node_block_type.o src/class_compiler.o src/klass_compile_time.o src/method_compiler.o src/module.o src/class_clover_compile_time.o"
JIT_OBJS=
JIT_RUNTIME_OBJS=
JIT_SCRIPT_RUNTIME_OBJS=
JIT=0
fi

Expand All @@ -426,11 +454,10 @@ AC_SUBST(CFLAGS)

AC_CHECK_FUNCS(execvpe)

COMMON_OBJS="src/buffer.o src/debug.o src/xfunc.o src/klass.o src/constant.o src/code.o src/alignment.o src/utf.o"

AC_SUBST(OBJS)
AC_SUBST(JIT_OBJS)
AC_SUBST(JIT_RUNTIME_OBJS)
AC_SUBST(JIT_SCRIPT_RUNTIME_OBJS)
AC_SUBST(COMPILER_OBJS)
AC_SUBST(COMMON_OBJS)
AC_SUBST(SCRIPT_OBJS)
Expand Down
4 changes: 4 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

clover2 (10.3.6-1) unstable; urgency=medium

* Fixed the bug on PC

clover2 (10.3.5-1) unstable; urgency=medium

* Finish curses library implement. I could't have suported all routines yet. It's too many....
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.3.5
Standards-Version: 10.3.6
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.3.5-1_amd64.deb debug extra
clover2_10.3.5-1_amd64.buildinfo unknown optional
clover2_10.3.5-1_amd64.deb unknown optional
clover2-dbgsym_10.3.6-1_amd64.deb debug extra
clover2_10.3.6-1_amd64.buildinfo unknown optional
clover2_10.3.6-1_amd64.deb unknown optional
Binary file added libclover2.a
Binary file not shown.
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.3.6

Fixed the bug on PC

version 10.3.5

Finish curses library implement. I could't have suported all routines yet. It's too many....
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.3.6

Fixed the bug on PC

version 10.3.5

Finish curses library implement. I could't have suported all routines yet. It's too many....
Expand Down
Loading

0 comments on commit 27d027e

Please sign in to comment.