Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 9f4ab59

Browse files
committed
com.livecode.list: Workaround for compiler bug 14931.
1 parent 7954f33 commit 9f4ab59

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

libscript/src/list.mlc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public foreign handler MCListExecDeleteLastElementOf(inout Target as List) as un
7676

7777
public foreign handler MCListEvalIndexOfElement(in IsLast as CBool, in Needle as any, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
7878
public foreign handler MCListEvalIndexOfElementAfter(in IsLast as CBool, in Needle as any, in After as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
79-
public foreign handler MCListEvalIndexOfElementBefore(in IsLast as CBool, in Needle as any, in Before as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
79+
public foreign handler MCListEvalIndexOfElementBefore(in IsFirst as CBool, in Needle as any, in Before as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
8080

8181
public foreign handler MCListEvalOffsetOfList(in IsLast as CBool, in Needle as List, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
8282
public foreign handler MCListEvalOffsetOfListAfter(in IsLast as CBool, in Needle as List, in After as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
83-
public foreign handler MCListEvalOffsetOfListBefore(in IsLast as CBool, in Needle as List, in Before as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
83+
public foreign handler MCListEvalOffsetOfListBefore(in IsFirst as CBool, in Needle as List, in Before as LCIndex, in Haystack as List, out Index as LCUIndex) as undefined binds to "<builtin>"
8484

8585
--
8686

@@ -963,9 +963,9 @@ specified, the last matching element is found.
963963
Tags: Lists
964964
*/
965965
syntax ListIndexBefore is prefix operator with precedence 1
966-
"the" ( "first" <IsLast=false> | "last" <IsLast=true> | <IsLast=true> ) "index" "of" <Needle: Expression> "before" <Before: Expression> "in" <Haystack: Expression>
966+
"the" ( "first" <IsFirst=true> | "last" <IsFirst=false> | <IsFirst=false> ) "index" "of" <Needle: Expression> "before" <Before: Expression> "in" <Haystack: Expression>
967967
begin
968-
MCListEvalIndexOfElementBefore(IsLast, Needle, Before, Haystack, output)
968+
MCListEvalIndexOfElementBefore(IsFirst, Needle, Before, Haystack, output)
969969
end syntax
970970

971971
----------------------------------------------------------------
@@ -1075,9 +1075,9 @@ is equal to <Needle>, the return value is 0. If neither "first" nor
10751075
Tags: Lists
10761076
*/
10771077
syntax ListOffsetBefore is prefix operator with precedence 1
1078-
"the" ( "first" <IsLast=false> | "last" <IsLast=true> | <IsLast=true> ) "offset" "of" <Needle: Expression> "before" <Before: Expression> "in" <Haystack: Expression>
1078+
"the" ( "first" <IsFirst=true> | "last" <IsFirst=false> | <IsFirst=false> ) "offset" "of" <Needle: Expression> "before" <Before: Expression> "in" <Haystack: Expression>
10791079
begin
1080-
MCListEvalOffsetOfListBefore(IsLast, Needle, Before, Haystack, output)
1080+
MCListEvalOffsetOfListBefore(IsFirst, Needle, Before, Haystack, output)
10811081
end syntax
10821082

10831083
end module

libscript/src/module-list.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ MCListEvalIndexOfElementAfter (bool p_is_last,
504504
}
505505

506506
extern "C" MC_DLLEXPORT void
507-
MCListEvalIndexOfElementBefore (bool p_is_last,
507+
MCListEvalIndexOfElementBefore (bool p_is_first,
508508
MCValueRef p_needle,
509509
index_t p_before,
510510
MCProperListRef p_haystack,
@@ -522,7 +522,7 @@ MCListEvalIndexOfElementBefore (bool p_is_last,
522522
return;
523523
}
524524

525-
MCListEvalIndexOfElementInRange (p_is_last, p_needle, p_haystack,
525+
MCListEvalIndexOfElementInRange (!p_is_first, p_needle, p_haystack,
526526
MCRangeMake(0, t_start),
527527
r_output);
528528
}
@@ -590,7 +590,7 @@ MCListEvalOffsetOfListAfter (bool p_is_last,
590590
}
591591

592592
extern "C" MC_DLLEXPORT void
593-
MCListEvalOffsetOfListBefore (bool p_is_last,
593+
MCListEvalOffsetOfListBefore (bool p_is_first,
594594
MCProperListRef p_needle,
595595
index_t p_before,
596596
MCProperListRef p_haystack,
@@ -608,7 +608,7 @@ MCListEvalOffsetOfListBefore (bool p_is_last,
608608
return;
609609
}
610610

611-
MCListEvalOffsetOfListInRange (p_is_last, p_needle, p_haystack,
611+
MCListEvalOffsetOfListInRange (!p_is_first, p_needle, p_haystack,
612612
MCRangeMake(0, t_start),
613613
r_output);
614614
}

0 commit comments

Comments
 (0)