summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d544695)
raw | patch | inline | side by side (parent: d544695)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 13 Aug 2017 19:58:04 +0000 (22:58 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 13 Aug 2017 19:58:04 +0000 (22:58 +0300) |
Test.obn | patch | blob | history | |
Test18A.obn | [new file with mode: 0644] | patch | blob |
Test18B.obn | [new file with mode: 0644] | patch | blob |
Test18C.obn | [new file with mode: 0644] | patch | blob |
obn-run-tests.sh | patch | blob | history | |
src/backends/jvm/generator-jvm-abi.c | patch | blob | history | |
src/backends/jvm/generator-jvm.c | patch | blob | history | |
src/oberon.c | patch | blob | history |
diff --git a/Test.obn b/Test.obn
index 8249fb77223116fd24082f63a7dba78821d98fe1..c039f87259a54823da72904d8cacb593996e0b7c 100644 (file)
--- a/Test.obn
+++ b/Test.obn
MODULE Test;
-IMPORT Out;
+VAR
+ x : PROCEDURE(i : INTEGER);
+
+PROCEDURE X(a : INTEGER);
+END X;
BEGIN
- Out.Open;
- Out.String("Hello World!"); Out.Ln;
+ x := X;
END Test.
diff --git a/Test18A.obn b/Test18A.obn
--- /dev/null
+++ b/Test18A.obn
@@ -0,0 +1,13 @@
+MODULE Test18A;
+
+VAR
+ x : PROCEDURE(i : INTEGER);
+
+PROCEDURE X(a : INTEGER);
+END X;
+
+BEGIN
+ x := X;
+END Test18A.
+
+Проверка процедурного типа. Тест должен проходить.
diff --git a/Test18B.obn b/Test18B.obn
--- /dev/null
+++ b/Test18B.obn
@@ -0,0 +1,13 @@
+MODULE Test18B;
+
+VAR
+ x : PROCEDURE(VAR i : INTEGER);
+
+PROCEDURE X(a : INTEGER);
+END X;
+
+BEGIN
+ x := X;
+END Test18B.
+
+Проверка процедурного типа. Тест должен проваливаться.
diff --git a/Test18C.obn b/Test18C.obn
--- /dev/null
+++ b/Test18C.obn
@@ -0,0 +1,10 @@
+MODULE Test18C;
+
+VAR
+ x : PROCEDURE (i : LONGREAL);
+
+BEGIN
+ x := ABS;
+END Test18C.
+
+Проверка процедурного типа. Тест должен проваливаться.
diff --git a/obn-run-tests.sh b/obn-run-tests.sh
index e3e3d5af23365db90c84c03533503c0a55d0c127..70a1ea639fa66156b76136ee13d8fe1a3ae4b05d 100755 (executable)
--- a/obn-run-tests.sh
+++ b/obn-run-tests.sh
maketest Test14
maketest Test15
maketest Test16
+
makefail Test17A
makefail Test17B
makecomp Test17C
makefail Test17E
makefail Test17F
+makecomp Test18A
+makefail Test18B
+makefail Test18C
index 8d966cbe4877ac404487fbd308d8bc2d5a359deb..1d634a5ea0ddfcbaad19f707f4521202389ebec6 100644 (file)
case JVM_STORAGE_REGISTER:
case JVM_STORAGE_PARAM:
case JVM_STORAGE_PARAM_VAR:
+ case JVM_STORAGE_FRAME:
+ case JVM_STORAGE_FRAME_VAR:
+ case JVM_STORAGE_FRAME_PARAM:
+ case JVM_STORAGE_FRAME_PARAM_VAR:
jvm_generate(p, 0, 0, ".var %i is %s %s from start to end", reg, name, desc);
break;
case JVM_STORAGE_REGISTER_VAR:
jvm_generate(p, 0, 0, ".var %i is %s [%s from start to end", reg, name, desc);
break;
case JVM_STORAGE_PARAM_VARPTR:
+ case JVM_STORAGE_FRAME_PARAM_VARPTR:
jvm_generate(p, 0, 0, ".var %i is %s [%s from start to end", reg, name, desc);
jvm_generate(p, 0, 0, ".var %i is %s$offset I from start to end", reg + 1, name);
break;
case JVM_STORAGE_FIELD_VAR:
fprintf(v -> class -> fp, ".field public %s [%s\n\n", name, desc);
break;
- case JVM_STORAGE_FRAME:
- case JVM_STORAGE_FRAME_VAR:
- case JVM_STORAGE_FRAME_PARAM:
- case JVM_STORAGE_FRAME_PARAM_VAR:
- case JVM_STORAGE_FRAME_PARAM_VARPTR:
- /* См. ниже jvm_generate_frame_class() */
- break;
default:
gen_error("jvm_generate_var: invalid storage %i", storage);
break;
index bf5200bd786daafe7cff702b2731eb2b0552343a..e897f6e98cb64913f5e58b9612ad8be3e7ef1c9c 100644 (file)
case OBERON_CLASS_VAR_PARAM:
case OBERON_CLASS_PARAM:
case OBERON_CLASS_VAR:
+ jvm_generate_var(v);
jvm_generate_var_initialization(p, v);
break;
case OBERON_CLASS_PROC:
jvm_generate_procedure_frame(proc);
- /* Создание парамеров и переменных */
+ /* Создание паÑ\80амеÑ\82Ñ\80ов и пеÑ\80еменнÑ\8bÑ\85 */
var = proc -> scope -> list -> next;
while(var)
{
diff --git a/src/oberon.c b/src/oberon.c
index efa6fed9c13a02e3e3d5438a8be29c7121768970..3b8a6b14846e593d9bbaf7b31385993475362a8c 100644 (file)
--- a/src/oberon.c
+++ b/src/oberon.c
oberon_object_t * field = type -> decl;
for(int i = 0; i < num_fields; i++)
{
- oberon_initialize_object(ctx, field);
+ //oberon_initialize_object(ctx, field);
+ oberon_initialize_type(ctx, field -> type);
field = field -> next;
- }
+ }
oberon_generator_init_type(ctx, type);
}