|
| 1 | +from typing import Literal |
| 2 | + |
| 3 | +class Node: |
| 4 | + source_line: int |
| 5 | + source_column: int |
| 6 | + type: str |
| 7 | + |
| 8 | + def __init__(self, source_line: int, source_column: int) -> None: ... |
| 9 | + def serialize(self) -> str: ... |
| 10 | + |
| 11 | +class ParseError(Node): |
| 12 | + type: Literal["error"] |
| 13 | + kind: str |
| 14 | + message: str |
| 15 | + repr_format: str |
| 16 | + def __init__(self, line: int, column: int, kind: str, message: str) -> None: ... |
| 17 | + |
| 18 | +class Comment(Node): |
| 19 | + type: Literal["comment"] |
| 20 | + value: str |
| 21 | + repr_format: str |
| 22 | + def __init__(self, line: int, column: int, value: str) -> None: ... |
| 23 | + |
| 24 | +class WhitespaceToken(Node): |
| 25 | + type: Literal["whitespace"] |
| 26 | + value: str |
| 27 | + repr_format: str |
| 28 | + def __init__(self, line: int, column: int, value: str) -> None: ... |
| 29 | + |
| 30 | +class LiteralToken(Node): |
| 31 | + type: Literal["literal"] |
| 32 | + value: str |
| 33 | + repr_format: str |
| 34 | + def __init__(self, line: int, column: int, value: str) -> None: ... |
| 35 | + def __eq__(self, other: object) -> bool: ... |
| 36 | + def __ne__(self, other: object) -> bool: ... |
| 37 | + |
| 38 | +class IdentToken(Node): |
| 39 | + type: Literal["ident"] |
| 40 | + value: str |
| 41 | + lower_value: str |
| 42 | + repr_format: str |
| 43 | + def __init__(self, line: int, column: int, value: str) -> None: ... |
| 44 | + |
| 45 | +class AtKeywordToken(Node): |
| 46 | + type: Literal["at-keyword"] |
| 47 | + value: str |
| 48 | + lower_value: str |
| 49 | + repr_format: str |
| 50 | + def __init__(self, line: int, column: int, value: str) -> None: ... |
| 51 | + |
| 52 | +class HashToken(Node): |
| 53 | + type: Literal["hash"] |
| 54 | + value: str |
| 55 | + is_identifier: bool |
| 56 | + repr_format: str |
| 57 | + def __init__(self, line: int, column: int, value: str, is_identifier: bool) -> None: ... |
| 58 | + |
| 59 | +class StringToken(Node): |
| 60 | + type: Literal["string"] |
| 61 | + value: str |
| 62 | + representation: str |
| 63 | + repr_format: str |
| 64 | + def __init__(self, line: int, column: int, value: str, representation: str) -> None: ... |
| 65 | + |
| 66 | +class URLToken(Node): |
| 67 | + type: Literal["url"] |
| 68 | + value: str |
| 69 | + representation: str |
| 70 | + repr_format: str |
| 71 | + def __init__(self, line: int, column: int, value: str, representation: str) -> None: ... |
| 72 | + |
| 73 | +class UnicodeRangeToken(Node): |
| 74 | + type: Literal["unicode-range"] |
| 75 | + start: int |
| 76 | + end: int |
| 77 | + repr_format: str |
| 78 | + def __init__(self, line: int, column: int, start: int, end: int) -> None: ... |
| 79 | + |
| 80 | +class NumberToken(Node): |
| 81 | + type: Literal["number"] |
| 82 | + value: float |
| 83 | + int_value: int | None |
| 84 | + is_integer: bool |
| 85 | + representation: str |
| 86 | + repr_format: str |
| 87 | + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... |
| 88 | + |
| 89 | +class PercentageToken(Node): |
| 90 | + type: Literal["percentage"] |
| 91 | + value: float |
| 92 | + int_value: int | None |
| 93 | + is_integer: bool |
| 94 | + representation: str |
| 95 | + repr_format: str |
| 96 | + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... |
| 97 | + |
| 98 | +class DimensionToken(Node): |
| 99 | + type: Literal["dimension"] |
| 100 | + value: float |
| 101 | + int_value: int | None |
| 102 | + is_integer: bool |
| 103 | + representation: str |
| 104 | + unit: str |
| 105 | + lower_unit: str |
| 106 | + repr_format: str |
| 107 | + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str, unit: str) -> None: ... |
| 108 | + |
| 109 | +class ParenthesesBlock(Node): |
| 110 | + type: Literal["() block"] |
| 111 | + content: list[Node] |
| 112 | + repr_format: str |
| 113 | + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... |
| 114 | + |
| 115 | +class SquareBracketsBlock(Node): |
| 116 | + type: Literal["[] block"] |
| 117 | + content: list[Node] |
| 118 | + repr_format: str |
| 119 | + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... |
| 120 | + |
| 121 | +class CurlyBracketsBlock(Node): |
| 122 | + type: Literal["{} block"] |
| 123 | + content: list[Node] |
| 124 | + repr_format: str |
| 125 | + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... |
| 126 | + |
| 127 | +class FunctionBlock(Node): |
| 128 | + type: Literal["function"] |
| 129 | + name: str |
| 130 | + lower_name: str |
| 131 | + arguments: list[Node] |
| 132 | + repr_format: str |
| 133 | + def __init__(self, line: int, column: int, name: str, arguments: list[Node]) -> None: ... |
| 134 | + |
| 135 | +class Declaration(Node): |
| 136 | + type: Literal["declaration"] |
| 137 | + name: str |
| 138 | + lower_name: str |
| 139 | + value: list[Node] |
| 140 | + important: bool |
| 141 | + repr_format: str |
| 142 | + def __init__(self, line: int, column: int, name: str, lower_name: str, value: list[Node], important: bool) -> None: ... |
| 143 | + |
| 144 | +class QualifiedRule(Node): |
| 145 | + type: Literal["qualified-rule"] |
| 146 | + prelude: list[Node] |
| 147 | + content: list[Node] |
| 148 | + repr_format: str |
| 149 | + def __init__(self, line: int, column: int, prelude: list[Node], content: list[Node]) -> None: ... |
| 150 | + |
| 151 | +class AtRule(Node): |
| 152 | + type: Literal["at-rule"] |
| 153 | + at_keyword: str |
| 154 | + lower_at_keyword: str |
| 155 | + prelude: list[Node] |
| 156 | + content: list[Node] | None |
| 157 | + repr_format: str |
| 158 | + def __init__( |
| 159 | + self, line: int, column: int, at_keyword: str, lower_at_keyword: str, prelude: list[Node], content: list[Node] | None |
| 160 | + ) -> None: ... |
0 commit comments