import json


def read_config_file(config_filename):
  """Reads configuration parameters from the specified JSON file."""

  # Strip comments while keeping line numbers.
  config_str = ""
  with open(config_filename, "r") as f_in:
    for line in f_in:
      line = line.rstrip()
      comment_pos = line.find("//")
      if comment_pos > -1:
        line = line[:comment_pos]
      config_str += line + "\n"

  config = json.loads(config_str)

  return config