-
Notifications
You must be signed in to change notification settings - Fork 22
Eberon syntax relaxations
vladfolts edited this page Nov 16, 2014
·
1 revision
Here are additions to orginal oberon grammar to make it less strict in some cases.
Example:
PROCEDURE p; END; (* 'p' is note required before 'END' *)
Pocedure name duplicating at the end is useless in case of small procedures. So it is optional in Eberon.
Example:
TYPE
T = RECORD
field1: INTEGER;
field2: INTEGER;
fieldn: INTEGER; (* semocolon is allowed here in Eberon, prohibited by original oberon grammar *)
END;
Although this semicolon is "extra" from grammar standpoint it just inconvenient from editing/merge standpoint. So Eberon allows to have it.
Example:
PROCEDURE p(): INTEGER;
RETURN 0; (* semocolon is allowed here in Eberon, prohibited by original oberon grammar *)
END;
Although RETURN is not a statement from oberon grammar standpoint (it is a part of procedure declaration) it still looks and feels like a statement. So Eberon allows to have extra semicolon after it.