Skip to content

Commit

Permalink
fix token delimiter replacement for all occurences
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubzitny committed Jun 19, 2016
1 parent d41550e commit 962360b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokenizers/javascript/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ const tokenizer = function(code, parentId, blockId) {
// TODO: refactor these
const tokens = immutable.List(tokensRaw).flatMap((token) => {
if (token.value.indexOf(TOKEN_DELIMITER) != -1)
tokenDelimiters = new RegExep(TOKEN_DELIMITER, 'g')
token.value =
token.value.replace(TOKEN_DELIMITER, TOKEN_DELIMITER_REPLACEMENT)
token.value.replace(tokenDelimiters, TOKEN_DELIMITER_REPLACEMENT)

// NOTE: get rid of all whitespaces, dey sak
if (token.value.search(WHITESPACES) != -1)
Expand Down

0 comments on commit 962360b

Please sign in to comment.