jeefo_tokenizer
Advanced tools
Comparing version 0.0.34 to 0.0.35
20
index.js
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. | ||
* File Name : index.js | ||
* Created at : 2017-04-12 | ||
* Updated at : 2019-01-29 | ||
* Updated at : 2019-03-05 | ||
* Author : jeefo | ||
@@ -30,18 +30,2 @@ * Purpose : | ||
clone () { | ||
const clone = new JeefoTokenizer(); | ||
clone.token_definitions = this.token_definitions.map(token_definition => { | ||
return new TokenDefinition({ | ||
is : token_definition.is, | ||
initialize : token_definition.initialize, | ||
prototype : token_definition.Token.prototype | ||
}); | ||
}); | ||
clone.cursor_positions_stack = this.cursor_positions_stack.map(cursor_position => Object.assign({}, cursor_position)); | ||
return clone; | ||
} | ||
get_next_token () { | ||
@@ -67,3 +51,3 @@ const current_character = this.streamer.get_next_character(true); | ||
this.token_definitions.push(new TokenDefinition(token_definition)); | ||
this.token_definitions.sort((a, b) => a.Token.prototype.precedence - b.Token.prototype.precedence); | ||
this.token_definitions.sort((a, b) => a.Token.prototype.priority - b.Token.prototype.priority); | ||
@@ -70,0 +54,0 @@ return this; |
{ | ||
"name": "jeefo_tokenizer", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"homepage": "https://github.com/je3f0o/jeefo_tokenizer", | ||
@@ -5,0 +5,0 @@ "copyright": "2017", |
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. | ||
* File Name : token_definition.js | ||
* Created at : 2017-08-10 | ||
* Updated at : 2019-01-29 | ||
* Updated at : 2019-03-05 | ||
* Author : jeefo | ||
@@ -22,7 +22,7 @@ * Purpose : | ||
} | ||
if (typeof token_definition.type !== "string") { | ||
throw new Error("Invalid argument: token_definition.type"); | ||
if (typeof token_definition.id !== "string") { | ||
throw new Error("Invalid argument: token_definition.id"); | ||
} | ||
if (typeof token_definition.precedence !== "number") { | ||
throw new Error("Invalid argument: token_definition.precedence"); | ||
if (typeof token_definition.priority !== "number") { | ||
throw new Error("Invalid argument: token_definition.priority"); | ||
} | ||
@@ -37,4 +37,4 @@ if (typeof token_definition.is !== "function") { | ||
this.Token = class Token {}; | ||
this.Token.prototype.type = token_definition.type; | ||
this.Token.prototype.precedence = token_definition.precedence; | ||
this.Token.prototype.id = token_definition.id; | ||
this.Token.prototype.priority = token_definition.priority; | ||
@@ -41,0 +41,0 @@ this.is = token_definition.is; |
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
7596
169