Skip to content

Commit

Permalink
Fix cosmetic matching (tokenization bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
remusao committed Dec 3, 2018
1 parent 7167736 commit 59c9096
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function fastTokenizerNoRegex(
tokensBufferIndex += 1;
}

return TOKENS_BUFFER.subarray(0, tokensBufferIndex);
return TOKENS_BUFFER.slice(0, tokensBufferIndex);
}

function fastTokenizer(pattern: string, isAllowedCode: (ch: number) => boolean): Uint32Array {
Expand All @@ -187,7 +187,7 @@ function fastTokenizer(pattern: string, isAllowedCode: (ch: number) => boolean):
tokensBufferIndex += 1;
}

return TOKENS_BUFFER.subarray(0, tokensBufferIndex);
return TOKENS_BUFFER.slice(0, tokensBufferIndex);
}

export function tokenize(pattern: string): Uint32Array {
Expand Down

0 comments on commit 59c9096

Please sign in to comment.