# pylint: skip-file
"""
Database of known variable names
NOTE: this file is automatically generated by the script
python -Bm cmakelang.tools.parse_cmake_help variables
"""
import re


PATTERNS = [
  {%-for pattern in patterns%}
    "{{pattern}}",
  {%-endfor%}
]


def stripped_patterns():
  """
  Remove named groups from patterns so we can join them together without
  a name collision.
  """
  regex = re.compile(r"\?P<[\w_]+>")
  return [regex.sub("", pattern) for pattern in PATTERNS]


CASE_SENSITIVE_REGEX = re.compile(
    "|".join(stripped_patterns()))
CASE_INSENSITIVE_REGEX = re.compile(
    "|".join(stripped_patterns()), re.IGNORECASE)
