 ###
 
 regexCommentedMembers = ///
-  (                     # First group captures the comment
-    (?:\n\x20\x20# .*)  # A comment line indented two spaces
-    +                   # Any number of comment lines
+  (                         # First group captures the comment
+    (?:                     # Non-capturing group
+      \r?\n\x20\x20# .*     # A comment line indented two spaces
+    )
+    +                       # Any number of comment lines
   )
-  \n\x20\x20            # Two spaces at start of identifier line
-  (                     # Second group captures the identifier
-    [a-zA-Z0-9$][\w]+   # JavaScript member identifier
+  \r?\n\x20\x20             # Identifier line indented two spaces
+  (                         # Second group captures the identifier
+    [a-zA-Z0-9$][\w]+       # JavaScript member identifier
   )
-  :                     # Colon terminates identifier
+  :                         # Colon terminates identifier
   ///gm
 
 fs = require "fs"



docComments = ( source ) ->
  console?.log source
  comments = {}
  match = regexCommentedMembers.exec source
  while match != null

  console?.log comments
###

source2 = fs.readFileSync "c:/Source/quickui-catalog/coffee/LateralNavigator.coffee", "utf8"

console?.log docComments source2

###
#regex = /((?:\n\x20\x20# .*)+)\n\x20\x20([a-zA-Z0-9$][\w]+):/gm
regex = /((?:\r?\n\x20\x20# .*)+)\r?\n\x20\x20([a-zA-Z0-9$][\w]+):/g
text = source2
match = regex.exec text
while match != null
  [ full, capture ] = match
  console?.log "<#{capture}>"
  match = regex.exec text
###