From 1a6884ff711bf9181014934fcba17b0fe652ac2a Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 3 Oct 2013 13:34:47 -0700 Subject: [PATCH] Remove the ALL_CAPS vars replace with CapCamelCase --- src/token.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/token.coffee b/src/token.coffee index c6e440db6..ad2ece720 100644 --- a/src/token.coffee +++ b/src/token.coffee @@ -1,9 +1,9 @@ _ = require './underscore-extensions' textUtils = require './text-utils' -whitespaceRegexesByTabLength = {} -LEADING_WHITESPACE_REGEX = /^[ ]+/ -TRAILING_WHITESPACE_REGEX = /[ ]+$/ +WhitespaceRegexesByTabLength = {} +LeadingWhitespaceRegex = /^[ ]+/ +TrailingWhitespaceRegex = /[ ]+$/ EscapeRegex = /[&"'<>]/g # Private: Represents a single unit of text as selected by a grammar. @@ -36,7 +36,7 @@ class Token [new Token(value: value1, scopes: @scopes), new Token(value: value2, scopes: @scopes)] whitespaceRegexForTabLength: (tabLength) -> - whitespaceRegexesByTabLength[tabLength] ?= new RegExp("([ ]{#{tabLength}})|(\t)|([^\t]+)", "g") + WhitespaceRegexesByTabLength[tabLength] ?= new RegExp("([ ]{#{tabLength}})|(\t)|([^\t]+)", "g") breakOutAtomicTokens: (tabLength, breakOutLeadingWhitespace) -> if @hasSurrogatePair @@ -141,7 +141,7 @@ class Token leadingHtml = '' trailingHtml = '' - if hasLeadingWhitespace and match = LEADING_WHITESPACE_REGEX.exec(html) + if hasLeadingWhitespace and match = LeadingWhitespaceRegex.exec(html) classes = 'leading-whitespace' classes += ' indent-guide' if hasIndentGuide classes += ' invisible-character' if invisibles.space @@ -151,7 +151,7 @@ class Token startIndex = match[0].length - if hasTrailingWhitespace and match = TRAILING_WHITESPACE_REGEX.exec(html) + if hasTrailingWhitespace and match = TrailingWhitespaceRegex.exec(html) classes = 'trailing-whitespace' classes += ' indent-guide' if hasIndentGuide and not hasLeadingWhitespace classes += ' invisible-character' if invisibles.space