jeefo_tokenizer
Advanced tools
Comparing version 0.0.35 to 0.0.36
{ | ||
"name": "jeefo_tokenizer", | ||
"version": "0.0.35", | ||
"version": "0.0.36", | ||
"homepage": "https://github.com/je3f0o/jeefo_tokenizer", | ||
@@ -5,0 +5,0 @@ "copyright": "2017", |
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. | ||
* File Name : string_stream.js | ||
* Created at : 2017-04-07 | ||
* Updated at : 2019-03-05 | ||
* Updated at : 2019-03-07 | ||
* Author : jeefo | ||
@@ -18,3 +18,3 @@ * Purpose : | ||
const __update_cursor = (streamer, current_character) => { | ||
if (current_character === '\r' || current_character === '\n') { | ||
if (current_character === '\n') { | ||
streamer.cursor.line += 1; | ||
@@ -62,2 +62,7 @@ streamer.cursor.column = 0; | ||
while (current_character && current_character <= ' ') { | ||
if (current_character === '\r') { | ||
this.cursor.column += 1; | ||
this.cursor.virtual_column += 1; | ||
current_character = this.string.charAt( ++this.cursor.index ); | ||
} | ||
__update_cursor(this, current_character); | ||
@@ -72,6 +77,9 @@ current_character = this.string.charAt( ++this.cursor.index ); | ||
move_cursor (length) { | ||
move_cursor (length, virtual_length) { | ||
if (virtual_length === undefined) { | ||
virtual_length = length; | ||
} | ||
this.cursor.index += length; | ||
this.cursor.column += length; | ||
this.cursor.virtual_column += length; | ||
this.cursor.virtual_column += virtual_length; | ||
} | ||
@@ -78,0 +86,0 @@ |
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
7938
177