@matchlighter/common_library
Advanced tools
Comparing version 1.4.5 to 1.4.6
export declare function escapeRegExp(str: string): string; | ||
export declare class MicroParser { | ||
constructor(str: string); | ||
readonly options: { | ||
whitespace_regex: RegExp; | ||
}; | ||
constructor(str: string, options?: { | ||
whitespace_regex: RegExp; | ||
}); | ||
protected stream: string; | ||
@@ -5,0 +10,0 @@ PEEK(n?: number): string; |
@@ -10,3 +10,4 @@ "use strict"; | ||
class MicroParser { | ||
constructor(str) { | ||
constructor(str, options = { whitespace_regex: WHITESPACE_RE }) { | ||
this.options = options; | ||
this.stream = str; | ||
@@ -44,7 +45,7 @@ } | ||
TRY_CONSUME_WS(what) { | ||
this.TRY_CONSUME(WHITESPACE_RE); | ||
this.TRY_CONSUME(this.options.whitespace_regex); | ||
return this.TRY_CONSUME(what); | ||
} | ||
CONSUME_WS(what) { | ||
this.TRY_CONSUME(WHITESPACE_RE); | ||
this.TRY_CONSUME(this.options.whitespace_regex); | ||
if (what) | ||
@@ -51,0 +52,0 @@ return this.CONSUME(what); |
export declare function escapeRegExp(str: string): string; | ||
export declare class MicroParser { | ||
constructor(str: string); | ||
readonly options: { | ||
whitespace_regex: RegExp; | ||
}; | ||
constructor(str: string, options?: { | ||
whitespace_regex: RegExp; | ||
}); | ||
protected stream: string; | ||
@@ -5,0 +10,0 @@ PEEK(n?: number): string; |
@@ -6,3 +6,4 @@ const WHITESPACE_RE = /[ \t]*/; | ||
export class MicroParser { | ||
constructor(str) { | ||
constructor(str, options = { whitespace_regex: WHITESPACE_RE }) { | ||
this.options = options; | ||
this.stream = str; | ||
@@ -40,7 +41,7 @@ } | ||
TRY_CONSUME_WS(what) { | ||
this.TRY_CONSUME(WHITESPACE_RE); | ||
this.TRY_CONSUME(this.options.whitespace_regex); | ||
return this.TRY_CONSUME(what); | ||
} | ||
CONSUME_WS(what) { | ||
this.TRY_CONSUME(WHITESPACE_RE); | ||
this.TRY_CONSUME(this.options.whitespace_regex); | ||
if (what) | ||
@@ -47,0 +48,0 @@ return this.CONSUME(what); |
{ | ||
"name": "@matchlighter/common_library", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "Shared Functions, Helpers, Patterns & Utilities for Apps and Libraries", | ||
@@ -5,0 +5,0 @@ "author": "Matchlighter", |
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
372299
5847