Skip to content

Commit

Permalink
/ issue #69: str := str + "World" optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-N-Cher committed Sep 17, 2019
1 parent ed6215c commit 8cf1ea9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Binary file modified Bin/ofront+.exe
Binary file not shown.
Binary file modified Mod/OPV.odc
Binary file not shown.
4 changes: 3 additions & 1 deletion Mod/OfrontOPV.Mod
Expand Up @@ -318,6 +318,7 @@ MODULE OfrontOPV; (* J. Templ 16.2.95 / 3.7.96

PROCEDURE SameExp (n1, n2: OPT.Node): BOOLEAN;
BEGIN
IF (n2^.class = Nderef) & (n2^.typ^.form = String) THEN n2 := n2^.left END;
WHILE (n1^.class = n2^.class) & (n1^.typ = n2^.typ) DO
CASE n1^.class OF
| Nvar, Nvarpar, Nproc: RETURN n1^.obj = n2^.obj
Expand Down Expand Up @@ -811,7 +812,8 @@ MODULE OfrontOPV; (* J. Templ 16.2.95 / 3.7.96
| and:
OPM.WriteString(" && ")
| plus:
IF form = Set THEN OPM.WriteString(" | ")
IF form = String THEN OPM.err(265)
ELSIF form = Set THEN OPM.WriteString(" | ")
ELSE OPM.WriteString(" + ")
END
| minus:
Expand Down
1 change: 1 addition & 0 deletions Mod/Text/OPV.txt
Expand Up @@ -317,6 +317,7 @@

PROCEDURE SameExp (n1, n2: OPT.Node): BOOLEAN;
BEGIN
IF (n2^.class = Nderef) & (n2^.typ^.form = String) THEN n2 := n2^.left END;
WHILE (n1^.class = n2^.class) & (n1^.typ = n2^.typ) DO
CASE n1^.class OF
| Nvar, Nvarpar, Nproc: RETURN n1^.obj = n2^.obj
Expand Down

0 comments on commit 8cf1ea9

Please sign in to comment.