zaskar9 / oberon-lang

An LLVM frontend for the Oberon programming language
MIT License
20 stars 3 forks source link

Compilation error due to extra semicolon #34

Open tenko opened 7 months ago

tenko commented 7 months ago

This code fails to compile due to the extra semicolon:

MODULE Test3;
(* Fails to compile in line 15 *)
VAR
    res : LONGINT;

PROCEDURE Test() : LONGINT;
VAR i, j : LONGINT;
BEGIN
    i := 0; j := 6;
    WHILE i < 10 DO
        IF i = 8 THEN
            RETURN i
        ELSIF i  = 7 THEN
            RETURN i; (* Error triggered by this extra semicolon *)
        ELSIF i = j THEN
            RETURN i
        END;
        INC(i)
    END;
END Test;

BEGIN
    res := Test();
END Test3.