Lines Matching +full:line +full:- +full:name
5 # SPDX-License-Identifier: Apache-2.0
18 ---------- -------------------------------------------
24 ---------- -------------------------------------------
31 # expression. To be permissive here, use a non-greedy match up to
32 # the first colon (':'). This breaks if the variable name has a
35 r'''(?P<name>.*?) # name
45 # non-zero number. False if the constant is 0, OFF, NO,
47 # the suffix -NOTFOUND. Named boolean constants are
48 # case-insensitive. If the argument is not one of these
57 or val.endswith('-NOTFOUND')
68 def from_line(cls, line, line_no): argument
69 # Comments can only occur at the beginning of a line.
71 if line.startswith('//') or line.startswith('#'):
74 # Whitespace-only lines do not contain cache entries.
75 if not line.strip():
78 m = cls.CACHE_ENTRY.match(line)
82 name, type_, value = (m.group(g) for g in ('name', 'type', 'value'))
87 args = exc.args + (f'on line {line_no}: {line}',)
94 return CMakeCacheEntry(name, value)
96 def __init__(self, name, value): argument
97 self.name = name
101 fmt = 'CMakeCacheEntry(name={}, value={})'
102 return fmt.format(self.name, self.value)
119 for line_no, line in enumerate(cache):
120 entry = CMakeCacheEntry.from_line(line, line_no)
123 self._entries = OrderedDict((e.name, e) for e in entries)
125 def get(self, name, default=None): argument
126 entry = self._entries.get(name)
132 def get_list(self, name, default=None): argument
135 entry = self._entries.get(name)
148 def __contains__(self, name): argument
149 return name in self._entries
151 def __getitem__(self, name): argument
152 return self._entries[name].value
154 def __setitem__(self, name, entry): argument
158 self._entries[name] = entry
160 def __delitem__(self, name): argument
161 del self._entries[name]