@@ -387,7 +387,7 @@ Module Semantics. Section main.
387387 (*>> 3. Return the union of CharSets A and B. << *)
388388 CharSet.union A B
389389
390- (** >> NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom ClassRanges << *)
390+ (** >> [OMITTED] NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom ClassRanges << *)
391391 (*>> 1. Let A be CompileToCharSet of ClassAtomNoDash with argument rer. << *)
392392 (*>> 2. Let B be CompileToCharSet of ClassAtom with argument rer. << *)
393393 (*>> 3. Let C be CompileToCharSet of ClassRanges with argument rer. << *)
@@ -512,15 +512,15 @@ Module Semantics. Section main.
512512 (*>> 9. If greedy is false, then << *)
513513 if greedy is false then
514514 (*>> a. Let z be c(x). << *)
515- let ! z =<< c x in
515+ let z := c x in
516516 (*>> b. If z is not failure, return z. << *)
517517 if z != failure
518518 then z else
519519 (*>> c. Return m(xr, d). << *)
520520 m xr d
521521 else
522522 (*>> 10. Let z be m(xr, d). << *)
523- let ! z =<< m xr d in
523+ let z := m xr d in
524524 (*>> 11. If z is not failure, return z. << *)
525525 if z != failure
526526 then z else
@@ -614,7 +614,7 @@ Module Semantics. Section main.
614614 (*>> 3. Assert: q.[[Min]] ≤ q.[[Max]]. << *)
615615 assert! (CompiledQuantifier_min q <=? CompiledQuantifier_max q)%NoI;
616616 (*>> 4. Let parenIndex be CountLeftCapturingParensBefore(Term). << *)
617- let parenIndex := countLeftCapturingParensBefore r ctx in
617+ let parenIndex := countLeftCapturingParensBefore self ctx in
618618 (*>> 5. Let parenCount be CountLeftCapturingParensWithin(Atom). << *)
619619 let parenCount := countLeftCapturingParensWithin r (Quantified_inner qu :: ctx) in
620620 (*>> 6. Return a new Matcher with parameters (x, c) that captures m, q, parenIndex, and parenCount and performs the following steps when called: << *)
@@ -647,7 +647,7 @@ Module Semantics. Section main.
647647 (*>> d. Let e be x's endIndex. << *)
648648 let e := MatchState.endIndex x in
649649 (*>> e. If e = 0, or if rer.[[Multiline]] is true and the character Input[e - 1] is matched by LineTerminator, then << *)
650- if ! (e =? 0)%Z ||! ((RegExpRecord.multiline rer is true) &&! (let ! c =<< input[(e-1)%Z] in CharSet.contains Characters.line_terminators c )) then
650+ if ! (e =? 0)%Z ||! ((RegExpRecord.multiline rer is true) &&! (let ! d =<< input[(e-1)%Z] in CharSet.contains Characters.line_terminators d )) then
651651 (*>> i. Return c(x). << *)
652652 c x
653653 else
@@ -667,7 +667,7 @@ Module Semantics. Section main.
667667 (*>> e. Let InputLength be the number of elements in Input. << *)
668668 let inputLength := List.length input in
669669 (*>> f. If e = InputLength, or if rer.[[Multiline]] is true and the character Input[e] is matched by LineTerminator, then << *)
670- if ! (e =? inputLength)%Z ||! ((RegExpRecord.multiline rer is true) &&! (let ! c =<< input[e] in CharSet.contains Characters.line_terminators c )) then
670+ if ! (e =? inputLength)%Z ||! ((RegExpRecord.multiline rer is true) &&! (let ! d =<< input[e] in CharSet.contains Characters.line_terminators d )) then
671671 (*>> i. Return c(x). << *)
672672 c x
673673 else
@@ -846,7 +846,7 @@ Module Semantics. Section main.
846846 (*>> 1. Let ch be the character matched by PatternCharacter. << *)
847847 let ch := c in
848848 (*>> 2. Let A be a one-element CharSet containing the character ch. << *)
849- let A := CharSet.singleton c in
849+ let A := CharSet.singleton ch in
850850 (*>> 3. Return CharacterSetMatcher(rer, A, false, direction). << *)
851851 characterSetMatcher rer A false direction
852852
@@ -901,6 +901,7 @@ Module Semantics. Section main.
901901 (*>> vii. Else, << *)
902902 else
903903 (*>> 1. Assert: direction is backward. << *)
904+ assert! (direction == backward) ;
904905 (*>> 2. Assert: ye ≤ xe. << *)
905906 assert! (ye <=? xe)%Z ;
906907 (*>> 3. Let r be the CaptureRange (ye, xe). << *)
@@ -932,16 +933,16 @@ Module Semantics. Section main.
932933 (*>> 2. Let ch be the character whose character value is cv. << *)
933934 let ch := Character.from_numeric_value cv in
934935 (*>> 3. Let A be a one-element CharSet containing the character ch. << *)
935- let a := CharSet.singleton ch in
936+ let A := CharSet.singleton ch in
936937 (*>> 4. Return CharacterSetMatcher(rer, A, false, direction). << *)
937- characterSetMatcher rer a false direction
938+ characterSetMatcher rer A false direction
938939
939940 (** >> AtomEscape :: CharacterClassEscape << *)
940941 | AtomEsc (ACharacterClassEsc cce) =>
941942 (*>> 1. Let A be CompileToCharSet of CharacterClassEscape with argument rer. << *)
942- let ! a =<< compileToCharSet cce rer in
943+ let ! A =<< compileToCharSet cce rer in
943944 (*>> 2. Return CharacterSetMatcher(rer, A, false, direction). << *)
944- characterSetMatcher rer a false direction
945+ characterSetMatcher rer A false direction
945946
946947 (** >> AtomEscape :: k GroupName << *)
947948 | AtomEsc (GroupEsc gn) =>
0 commit comments