INNER CODE UNIT · Python
Block
kejilion/sh · site_access_nginx.py:33
class Block:
words: list[str]
start: int
open_end: int
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":