Lines Matching +full:in +full:- +full:line

2 # SPDX-License-Identifier: GPL-2.0-only
10 def line_len(line: str) -> int:
11 tabs = line.count('\t')
12 return tabs * 7 + len(line)
14 def break_long_line(line: str, indent='') -> list[str]:
16 while line_len(line) > COLUMN_LIMIT:
17 i = line[:COLUMN_LIMIT - line_len(line)].rfind(' ')
18 result.append(line[:i])
19 line = indent + line[i + 1:]
20 if line:
21 result.append(line)
31 for label in sorted(node.labels):
41 def abbreviate_atoms(atoms: list[str]) -> list[str]:
42 def shorten(s: str) -> str:
44 return '_'.join([x[:2] for x in s.lower().split('_') if x not in skip])
47 for atom in atoms:
48 for i in range(len(atom), -1, -1):
49 if sum(a.startswith(atom[:i]) for a in atoms) > 1:
70 def _fill_states(self) -> str:
75 for node in self.ba:
84 for a in sorted(self.atoms):
98 for name in self.atoms_abbr:
111 for node in self.ltl:
112 if str(node) not in required_values:
125 for atom in self.atoms:
126 if atom.lower() not in required_values:
128 buf.append("\tbool %s = test_bit(LTL_%s, mon->atoms);" % (atom.lower(), atom))
133 for line in buf:
134 buf2.extend(break_long_line(line, "\t "))
145 for node in self.ba:
146 for o in sorted(node.outgoing):
155 for node in self.ba:
158 for o in sorted(node.outgoing):
159 line = "\t\tif "
162 line += build_condition_string(o)
163 lines = break_long_line(line, indent)
182 for node in self.ba:
189 for node in self.ba:
193 line = "\tif "
196 line += build_condition_string(node)
197 lines = break_long_line(line, indent)
200 buf.append("\t\t__set_bit(S%i, mon->states);" % node.id)
223 for a in self.atoms:
229 "/* SPDX-License-Identifier: GPL-2.0 */",