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

Commit e3003d6

Browse files
committed
[Bug 14846] com.livecode.char: Disable "(index|offset) of _ (before|after) _"
1 parent 0070fe7 commit e3003d6

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

libscript/src/char.mlc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ The first (respectively last) offset of <Needle> in <Target> is number of chars
384384
Tags: Strings
385385
*/
386386

387+
/* bug 14846
387388
syntax CharOffsetAfter is prefix operator with precedence 1
388389
"the" ( "first" <IsLast=false> | "last" <IsLast=true> | <IsLast=false> ) "offset" "of" <Needle: Expression> "after" <After: Expression> "in" <Target: Expression>
389390
begin
@@ -394,6 +395,7 @@ syntax CharIndexAfter is prefix operator with precedence 1
394395
begin
395396
MCCharEvalOffsetOfCharsAfter(IsLast, Needle, After, Target, output)
396397
end syntax
398+
*/
397399

398400
/*
399401

@@ -421,6 +423,7 @@ The first (respectively last) offset of <Needle> in <Target> is number of chars
421423
Tags: Strings
422424
*/
423425

426+
/* bug 14846
424427
syntax CharOffsetBefore is prefix operator with precedence 1
425428
"the" ( "first" <IsFirst=true> | "last" <IsFirst=false> | <IsFirst=false> ) "offset" "of" <Needle: Expression> "before" <Before: Expression> "in" <Target: Expression>
426429
begin
@@ -431,7 +434,7 @@ syntax CharIndexBefore is prefix operator with precedence 1
431434
begin
432435
MCCharEvalOffsetOfCharsBefore(IsFirst, Needle, Before, Target, output)
433436
end syntax
434-
437+
*/
435438

436439
/*
437440
Summary: Determines whether <Source> contains <Needle>.

tests/lcb/stdlib/char.lcb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ public handler TestOffset()
304304
test "index" when the index of "x" in ".xx." is 2
305305
end handler
306306

307+
/* bug 14846
307308
public handler TestOffsetAfter()
308309
-- Only test single-character needles for now
309310
test "offset after (single, +ve)" when the offset of "x" after 1 in "x.xx." is 2
@@ -372,6 +373,7 @@ public handler TestOffsetAfterZero()
372373
put the last offset of "x" in "x" into tNoAfter
373374
test "the last offset after (single, 0, same)" when the last offset of "x" after 0 in "x" is tNoAfter
374375
end handler
376+
*/
375377

376378
public handler TestBeginsWith()
377379
test "begins with" when "xx." begins with "xx"

toolchain/lc-compile/test.mlc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ public handler testChar(inout xResults as List)
606606

607607
put the first offset of "abcdef" in tString into tOffset
608608
testLog("Char", "CharOffset", tOffset is 0, xResults)
609-
609+
610+
/* bug 14846
610611
put the offset of "abcde" after 1 in tString into tOffset
611612

612613
testLog("Char", "CharOffsetAfter", tOffset is 5, xResults)
@@ -623,7 +624,8 @@ public handler testChar(inout xResults as List)
623624
put char tOffset + 1 to tOffset + 3 of tAddress into tTLD
624625

625626
testLog("Char", "CharOffsetBefore", tTLD is "com", xResults)
626-
627+
*/
628+
627629
variable tVar as String
628630
put "123" into tVar
629631

0 commit comments

Comments
 (0)