File: variables.jinja.py

package info (click to toggle)
cmake-format 0.6.13-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,436 kB
  • sloc: python: 16,990; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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)