 
 # Parse the modifier string and return a more useful object
 parse_mods = (data) ->
-  result = {}
+  result = {
+    'reroll_func': (x) -> false
+  }
 
   if not data
     return result

  result = 1 + Math.floor(Math.random() * sides)

  # Rerolling logic
  if meta_modifiers['reroll']?['lt']? and meta_modifiers['reroll']['lt'] >= sides
    return result # skip rerolling when we would roll forever

  if meta_modifiers['reroll']?
    while result <= meta_modifiers['reroll']['lt'] or result >= meta_modifiers['reroll']['gt']
      result = 1 + Math.floor(Math.random() * sides)
      if meta_modifiers['reroll']['once'] then break

  return result


      when 'r'
        match = data.match(/^r(o)?(<|>)(\d+)/)
        reroll_once = false
        reroll_value = parseInt match[3]
        if match[1] == 'o' then reroll_once = true
        if match[2] == '<'
          reroll_func = (x) -> x <= reroll_value
        if match[2] == '>'
          reroll_func = (x) -> x >= reroll_value
        if reroll_func?
          result['reroll_func'] = reroll_func
          result['reroll_once'] = reroll_once

        data = data[match[0].length..]

      # This suggests we have unparseable data in our mod string.
