INNER CODE UNIT · Python
end
kejilion/sh · site_access_nginx.py:37
end: int = -1
directives: list[Directive] = field(default_factory=list)
children: list["Block"] = field(default_factory=list)
def tokenize(text: str):
"""Yield decoded Nginx tokens together with their original source spans."""
n, i = len(text), 0
while i < n:
if text[i].isspace():
i += 1
continue
if text[i] == "#":
while i < n and text[i] != "\n":
i += 1
continue
if text[i] in "{};":
yield Token(text[i], i, i + 1, True)