 patternMatchingRules = [
   (pattern) ->
     trigger: pattern.label is 'numerical'
-    cond: (exp) -> ["#{exp} == #{pattern.token}"]
+    cond: (exp) -> ["#{exp}" + " == #{pattern.token}"]
+  (pattern) ->
+    trigger: pattern.label is 'const'
+    cond: (exp) -> ["'#{pattern.token}' in #{exp}"]
   (pattern) ->
     trigger: pattern.label is 'name'
     assignTo: (exp) ->

      value ?= "#{exp}[#{label}]"
      recurse: (for elem, i in elems
        [elem, "#{value}[#{i}]"])
  (pattern) ->
    [constr, elems...] = inside pattern
    label = "'#{constr.token}'"

  [constr, args...] = elems
  items = args.map(compileImpl).join ', '
  "({\"#{constr.token}\": [#{items}]})"

compileConst = (token) ->
  "({'#{token.token}': true})"

compileList = (elems) ->
  # "[#{elems.join ', '}]"
