@tokey/core
Advanced tools
Comparing version 1.0.0 to 1.1.0
import type { Token } from "./types"; | ||
export interface TokyOptions<T extends Token<unknown>> { | ||
shouldAddToken(type: T["type"], value: string): boolean; | ||
isStringDelimiter(char: string): boolean; | ||
isDelimiter(char: string): boolean; | ||
isStringDelimiter(char: string, previousChar: string): boolean; | ||
isDelimiter(char: string, previousChar: string): boolean; | ||
isWhitespace(char: string): boolean; | ||
@@ -7,0 +7,0 @@ getCommentStartType(ch: string, source: string, nextCharIndex: number): string; |
@@ -32,3 +32,3 @@ "use strict"; | ||
} | ||
else if (isStringDelimiter(ch)) { | ||
else if (isStringDelimiter(ch, previousChar)) { | ||
pushBuffer(); | ||
@@ -38,3 +38,3 @@ buffer += ch; | ||
} | ||
else if (isDelimiter(ch)) { | ||
else if (isDelimiter(ch, previousChar)) { | ||
pushBuffer(); | ||
@@ -41,0 +41,0 @@ buffer += ch; |
{ | ||
"name": "@tokey/core", | ||
"description": "simple code like tokenizer", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
@@ -5,4 +5,4 @@ import type { Token } from "./types"; | ||
shouldAddToken(type: T["type"], value: string): boolean; | ||
isStringDelimiter(char: string): boolean; | ||
isDelimiter(char: string): boolean; | ||
isStringDelimiter(char: string, previousChar: string): boolean; | ||
isDelimiter(char: string, previousChar: string): boolean; | ||
isWhitespace(char: string): boolean; | ||
@@ -62,7 +62,7 @@ getCommentStartType( | ||
buffer += ch; | ||
} else if (isStringDelimiter(ch)) { | ||
} else if (isStringDelimiter(ch, previousChar)) { | ||
pushBuffer(); | ||
buffer += ch; | ||
inString = ch; | ||
} else if (isDelimiter(ch)) { | ||
} else if (isDelimiter(ch, previousChar)) { | ||
pushBuffer(); | ||
@@ -69,0 +69,0 @@ buffer += ch; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95618