Skip to content

Commit

Permalink
Merge pull request #22 from jmorrell/patch-2
Browse files Browse the repository at this point in the history
Remove passed_value_index from parseString
  • Loading branch information
vtrushin authored May 4, 2018
2 parents c9790ad + 1f9846e commit 153a005
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/tokenize.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ function parseKeyword(input, index, line, column) {

function parseString(input, index, line, column) {
const startIndex = index;
let passedValueIndex = index;
let buffer = '';
let state = stringStates._START_;

Expand All @@ -168,20 +167,17 @@ function parseString(input, index, line, column) {
if (char === '\\') {
buffer += char;
index ++;
passedValueIndex = index;
state = stringStates.ESCAPE;
} else if (char === '"') {
index ++;
passedValueIndex = index;
return {
type: tokenTypes.STRING,
line,
column: column + index - startIndex,
index,
value: input.slice(startIndex, passedValueIndex)
value: input.slice(startIndex, index)
};
} else {
passedValueIndex = index + 1;
buffer += char;
index ++;
}
Expand All @@ -192,7 +188,6 @@ function parseString(input, index, line, column) {
if (char in escapes) {
buffer += char;
index ++;
passedValueIndex = index;
if (char === 'u') {
for (let i = 0; i < 4; i ++) {
const curChar = input.charAt(index);
Expand Down

0 comments on commit 153a005

Please sign in to comment.