Skip to content

Commit

Permalink
* LEN("str") allowed only in -C or -3 mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-N-Cher committed Feb 18, 2025
1 parent 29c7144 commit d3bc373
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Mod/OfrontOPB.cp
Original file line number Diff line number Diff line change
Expand Up @@ -1664,13 +1664,19 @@ avoid unnecessary intermediate variables in OFront
ELSIF x^.readonly THEN err(76)
END
| lenfn: (*LEN*)
IF (* (x^.class = Ntype) OR *) (x^.class = Nproc) THEN err(126) (* !!! *)
IF (* (x.class = Ntype) OR *) (x.class = Nproc) THEN err(126) (* !!! *)
ELSE
IF (OPM.Lang = "C") & (x^.typ^.form = Pointer) THEN DeRef(x) END;
IF (x^.class = Nconst) & (x^.typ^.form = Char8) THEN CharToString8(x)
ELSIF (x^.class = Nconst) & (x^.typ^.form = Char16) THEN CharToString16(x)
IF (OPM.Lang = "C") & (x.typ.form = Pointer) THEN DeRef(x) END;
IF x.class = Nconst THEN
IF x.typ.form = Char8 THEN CharToString8(x)
ELSIF x.typ.form = Char16 THEN CharToString16(x)
END
END;
IF ~(x^.typ^.comp IN {DynArr, Array}) & ~(x^.typ^.form IN {String8, String16}) THEN err(131) END
IF ~(x^.typ^.comp IN {DynArr, Array}) & (
(OPM.Lang # "C") & (OPM.Lang # "3") OR ~(x.typ.form IN {String8, String16})
)
THEN err(131)
END
END
| copyfn: (*COPY*)
IF (x^.class = Nconst) & (f = Char8) THEN CharToString8(x); f := String8
Expand Down
2 changes: 1 addition & 1 deletion Mod/OfrontOPM.cmdln.cp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ MODULE OfrontOPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
IF CmdArgs.Count = 0 THEN stop := TRUE;
Console.Ln;
Console.String(title); Console.Ln;
Console.String("Copyright (c) Software Templ OG, 1995-2020 & VEDAsoft Oberon Club, 2013-2024"); Console.Ln; Console.Ln;
Console.String("Copyright (c) Software Templ OG, 1995-2020 & VEDAsoft Oberon Club, 2013-2025"); Console.Ln; Console.Ln;
Console.String(' command = "'); Console.String(cmd); Console.String('" options {file options}.'); Console.Ln;
Console.String(' options = ["-" {option} ].'); Console.Ln;
Console.String(' option = "m" | "s" | "e" | "i" | "r" | "x" | "a" | "p" | "t" | "f" | "d"'); Console.Ln;
Expand Down
Binary file modified Target/BlackBox/Mod/OPB.odc
Binary file not shown.
Binary file modified Target/Win32/ofront+.exe
Binary file not shown.

0 comments on commit d3bc373

Please sign in to comment.