add comments about sume parts that are verified to work as far as line breaks go

This commit is contained in:
2024-07-02 06:02:16 +01:00
parent 3e924b1082
commit 65b3db2a6a
4 changed files with 11 additions and 17 deletions

View File

@@ -6,6 +6,9 @@ bench: gap_buffer_svelte gap_buffer_rust gap_buffer_seph gap_buffer_automerge ro
gap_buffer_svelte:
mlton gap_buffer_svelte.mlb
gap_buffer_svelte_llvm:
mlton -output gap_buffer_svelte_llvm -codegen llvm gap_buffer_svelte.mlb
gap_buffer_rust:
mlton gap_buffer_rust.mlb
@@ -16,6 +19,9 @@ gap_buffer_seph:
gap_buffer_automerge:
mlton gap_buffer_automerge.mlb
gap_buffer_automerge_llvm:
mlton -output gap_buffer_automerge_llvm -codegen llvm gap_buffer_automerge.mlb
rope_svelte:
mlton rope_svelte.mlb

BIN
bench/gap_buffer_automerge_llvm Executable file

Binary file not shown.

BIN
bench/gap_buffer_svelte_llvm Executable file

Binary file not shown.

View File

@@ -685,21 +685,10 @@ struct
if isInLimit (newString, rightStringsHd, newLines, rightLinesHd) then
(* Allocate new string because we can do so while staying in limit. *)
let
(* VERIFIED TO WORK *)
val _ = print "line 474\n"
val newRightStringsHd = rightStringsHd ^ newString
val newRightLinesHd = countLineBreaks newRightStringsHd
(*
val newRightLinesHd =
Vector.tabulate
( Vector.length newLines + Vector.length rightLinesHd
, fn idx =>
if idx < Vector.length rightLinesHd then
Vector.sub (rightLinesHd, idx)
else
Vector.sub (newLines, idx - Vector.length rightLinesHd)
+ String.size rightStringsHd
)
*)
in
verifyReturn
{ idx = curIdx
@@ -707,7 +696,7 @@ struct
, leftStrings = leftStrings
, leftLines = leftLines
, rightStrings = newRightStringsHd :: rightStringsTl
, rightLines = countLineBreaks newRightStringsHd :: rightLinesTl
, rightLines = newRightLinesHd :: rightLinesTl
}
end
else
@@ -918,13 +907,13 @@ struct
isInLimit
(leftStringsHd, rightStringsHd, leftLinesHd, rightLinesHd)
*)
false
true
then
let
(* VERIFIED TO WORK *)
val _ = print "line 650\n"
val nextLine = curLine + Vector.length rightLinesHd
val newLeftStringsHd = leftStringsHd ^ rightStringsHd
(*
val newLeftLinesHd =
Vector.tabulate
( Vector.length leftLinesHd
@@ -936,8 +925,7 @@ struct
Vector.sub
(rightLinesHd, idx - Vector.length leftLinesHd)
+ String.size leftStringsHd
) *)
val newLeftLinesHd = countLineBreaks newLeftStringsHd
)
in
moveRightAndIns
( idx