     node
 
 isReference = (token) ->
-  token.label in ['bare', 'operator', 'param', 'recurse']
+  token.label in ['bare', 'operator', 'param', 'recurse'] and not isDelim token
 
 fnDefinition = (node) ->
   words = inside node
   [keyword, paramList, defs...] = words
-  params = if Array.isArray(paramList) then inside paramList else undefined
+  params = if Array.isArray(paramList) then paramList else undefined
   defs ?= []
   for def, i in defs
     if matchNode '::', def

  {params, body, wheres} = fnDefinition node
  if !params?
    throw new Error 'missing parameter list'
  paramNames = params.map(getToken).map(validIdentifier)
  node.scope = toMap paramNames
  curry paramNames, """
    (function (#{paramNames.join ', '}) {

      ['brace', token in ['{', '}']]
      ['bare', true]

isDelim = (token) ->
  /[\(\)\[\]\{\}]/.test token.token

labelMatches = (ast) ->
  macro 'match', ast, (node, args) ->
    [keyword, over, patterns...] = args
