Skip to content

Commit

Permalink
CoffeeScript's string interpolation breaks docco sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvande committed Feb 22, 2011
1 parent 4f37649 commit dc38257
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions milk.coffee
Expand Up @@ -37,13 +37,13 @@ Parse = (template, delimiters = ['{{','}}'], sectionName = null, start = 0) ->
return ///
([\s\S]*?) # Capture the pre-tag content
([#{' '}\t]*) # Capture the pre-tag whitespace
#{tagOpen} \s* # Match the opening tag
(?: #{tagOpen} \s* # Match the opening tag
(?:
(=) \s* (.+?) \s* = | # Capture type and content for Set Delimiters
({) \s* (.+?) \s* } | # Capture type and content for Triple Mustaches
(\W?) \s* ([\s\S]+?) # Capture type and content for everything else
)
\s* #{tagClose} # Match the closing tag
\s* #{tagClose} ) # Match the closing tag
///gm

tagPattern = BuildRegex()
Expand All @@ -63,13 +63,13 @@ Parse = (template, delimiters = ['{{','}}'], sectionName = null, start = 0) ->

indent = new Array(lastLine.length - lastTag.length + 1).join(' ')
carets = new Array(lastTag.length + 1).join('^')
message = """
#{message}
Line #{parsedLines.length}:
#{ lastLine + template.substr(errorPos, endOfLine.lastIndex - errorPos) }
#{ indent }#{ carets }
"""
message = [
message,
'',
"Line #{parsedLines.length}:",
lastLine + template.substr(errorPos, endOfLine.lastIndex - errorPos),
"#{indent}#{carets}"
].join("\n")

# As we start matching things, we'll pull out the relevant captures, indices,
# and deterimine whether the tag is standalone.
Expand Down
2 changes: 1 addition & 1 deletion pages
Submodule pages updated 2 files
+70 −70 index.html
+2 −2 milk.js

0 comments on commit dc38257

Please sign in to comment.