gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cannot declare function


From: Alexey Ulasevich
Subject: cannot declare function
Date: Sun, 13 Oct 2024 14:03:53 +0300
User-agent: Mozilla Thunderbird

Hi,

I wrote simple code (file name proc_test.mod):

MODULE proc_test;
PROCEDURE Calc : CARDINAL;
BEGIN
RETURN 2;
END Calc;
BEGIN
END proc_test.
I tried to compile it by command:
gm2 proc_test.mod
So I got:
proc_test.mod:3:22: предупреждение: In procedure «Calc»: syntax warning, «END» missing 3 | PROCEDURE Calc : CARDINAL; | ^~~~~~~~ proc_test.mod:3:22: предупреждение: syntax warning, «;» missing proc_test.mod:6:13: предупреждение: In program module «proc_test»: syntax warning, «.» missing 6 | END Calc; | ^ proc_test.mod:1:8: ошибка: module name at beginning «proc_test» does not match the name at end «Calc» 1 | MODULE proc_test; | ^~~~~~~~~ proc_test.mod:3:15: ошибка: In procedure «Calc»: procedure name at beginning «Calc» does not match the name at end «CARDINAL» 3 | PROCEDURE Calc : CARDINAL; | ^~~~ proc_test.mod:3:20: ошибка: syntax error, found «:» 3 | PROCEDURE Calc : CARDINAL; | ^ proc_test.mod:3:22: ошибка: procedure name at end «CARDINAL» does not match the name at beginning «Calc» 3 | PROCEDURE Calc : CARDINAL; | ^~~~~~~~ proc_test.mod:6:9: ошибка: In program module «proc_test»: module name at end «Calc» does not match the name at beginning «proc_test» 6 | END Calc; | ^~~~ proc_test.mod:6:13: ошибка: syntax error, found «;» 6 | END Calc; | ^ proc_test.mod:11:1: ошибка: no scope active: compilation failed
Is it a bug or I do something wrong?
PS: gm2 (GCC) 14.2.1 20241004
Thanks.
Alexey Ulasevich


reply via email to

[Prev in Thread] Current Thread [Next in Thread]