@emmetio/scanner
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -64,5 +64,5 @@ declare type MatchFn = (ch: number) => boolean; | ||
*/ | ||
error(message: string): StreamReaderError; | ||
error(message: string, pos?: number): ScannerError; | ||
} | ||
export declare class StreamReaderError extends Error { | ||
export declare class ScannerError extends Error { | ||
pos: number; | ||
@@ -69,0 +69,0 @@ string: string; |
{ | ||
"name": "@emmetio/scanner", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Scans given text character-by-character", | ||
@@ -5,0 +5,0 @@ "main": "./scanner.js", |
@@ -32,2 +32,6 @@ const defaultQuotedOptions = { | ||
} | ||
/** | ||
* Check if given character code is a white-space character: a space character | ||
* or line breaks | ||
*/ | ||
function isWhiteSpace(code) { | ||
@@ -39,3 +43,3 @@ return code === 32 /* space */ | ||
/** | ||
* Check if given character code is a space | ||
* Check if given character code is a space character | ||
*/ | ||
@@ -211,7 +215,7 @@ function isSpace(code) { | ||
*/ | ||
error(message) { | ||
return new StreamReaderError(`${message} at ${this.pos + 1}`, this.pos, this.string); | ||
error(message, pos = this.pos) { | ||
return new ScannerError(`${message} at ${pos + 1}`, pos, this.string); | ||
} | ||
} | ||
class StreamReaderError extends Error { | ||
class ScannerError extends Error { | ||
constructor(message, pos, str) { | ||
@@ -225,3 +229,3 @@ super(message); | ||
export default Scanner; | ||
export { StreamReaderError, eatPair, eatQuoted, isAlpha, isAlphaNumeric, isAlphaNumericWord, isAlphaWord, isNumber, isQuote, isSpace, isWhiteSpace }; | ||
export { ScannerError, eatPair, eatQuoted, isAlpha, isAlphaNumeric, isAlphaNumericWord, isAlphaWord, isNumber, isQuote, isSpace, isWhiteSpace }; | ||
//# sourceMappingURL=scanner.es.js.map |
@@ -36,2 +36,6 @@ 'use strict'; | ||
} | ||
/** | ||
* Check if given character code is a white-space character: a space character | ||
* or line breaks | ||
*/ | ||
function isWhiteSpace(code) { | ||
@@ -43,3 +47,3 @@ return code === 32 /* space */ | ||
/** | ||
* Check if given character code is a space | ||
* Check if given character code is a space character | ||
*/ | ||
@@ -215,7 +219,7 @@ function isSpace(code) { | ||
*/ | ||
error(message) { | ||
return new StreamReaderError(`${message} at ${this.pos + 1}`, this.pos, this.string); | ||
error(message, pos = this.pos) { | ||
return new ScannerError(`${message} at ${pos + 1}`, pos, this.string); | ||
} | ||
} | ||
class StreamReaderError extends Error { | ||
class ScannerError extends Error { | ||
constructor(message, pos, str) { | ||
@@ -228,3 +232,3 @@ super(message); | ||
exports.StreamReaderError = StreamReaderError; | ||
exports.ScannerError = ScannerError; | ||
exports.default = Scanner; | ||
@@ -231,0 +235,0 @@ exports.eatPair = eatPair; |
@@ -22,5 +22,9 @@ import Scanner from './index'; | ||
export declare function isAlphaWord(code: number): boolean; | ||
/** | ||
* Check if given character code is a white-space character: a space character | ||
* or line breaks | ||
*/ | ||
export declare function isWhiteSpace(code: number): boolean; | ||
/** | ||
* Check if given character code is a space | ||
* Check if given character code is a space character | ||
*/ | ||
@@ -27,0 +31,0 @@ export declare function isSpace(code: number): boolean; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
45495
582
0