Skip to content

Commit 0f39b03

Browse files
committed
Fix parsing nested casts
Fix parsing value `(type1) (type2) val`.
1 parent 16eb362 commit 0f39b03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/laytonsmith/core/functions/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public static ParseTree rewrite(List<ParseTree> list, boolean returnSConcat,
350350
}
351351

352352
// Rewrite cast operator.
353-
for(int i = 0; i < list.size() - 1; i++) {
353+
for(int i = list.size() - 1; i >= 0; i--) {
354354
ParseTree node = list.get(i);
355355
if(node.getData() instanceof CFunction cf && cf.hasFunction() && cf.getFunction() != null
356356
&& cf.getFunction().getName().equals(Compiler.p.NAME) && node.numberOfChildren() == 1) {

0 commit comments

Comments
 (0)