Skip to content

Commit

Permalink
error when dropping negative characters
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Dec 12, 2024
1 parent a54a5a0 commit f2c6e45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/kiss/Stream.hx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class Stream {

/** Every drop call should end up calling dropChars() or the position tracker and recording will be wrong. **/
public function dropChars(count:Int, taking:Bool) {
if (count < 0) {
error("Can't drop negative characters");
}
for (idx in 0...count) {
switch (content.charAt(idx)) {
// newline
Expand Down

0 comments on commit f2c6e45

Please sign in to comment.