MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / parse_regexor

Function parse_regexor

2018/src/20.py:12–19  ·  view source on GitHub ↗
(s: str, i: int)

Source from the content-addressed store, hash-verified

10Graph = dict[tuple[int,int],set[tuple[int,int]]]
11
12def parse_regexor(s: str, i: int) -> tuple[int,Regex]:
13 regexes = []
14 while i < len(s) and s[i] != ')':
15 if s[i] == '|':
16 i += 1
17 i,r = parse_regex(s,i)
18 regexes.append(r)
19 return i+1, (RegexType.OR, regexes)
20
21def parse_regex(s: str, i: int) -> tuple[int,Regex]:
22 r = []

Callers 1

parse_regexFunction · 0.85

Calls 1

parse_regexFunction · 0.85

Tested by

no test coverage detected