We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb52ad9 commit c4946e2Copy full SHA for c4946e2
search_query/constants.py
@@ -2,7 +2,9 @@
2
"""Constants for search-query"""
3
# pylint: disable=too-few-public-methods
4
# pylint: disable=line-too-long
5
+from dataclasses import dataclass
6
from enum import Enum
7
+from typing import Tuple
8
9
# noqa: E501
10
@@ -17,7 +19,7 @@ class PLATFORM(Enum):
17
19
PRE_NOTATION = "pre_notation"
18
20
21
-class TokenTypes:
22
+class TokenTypes(Enum):
23
"""Token types"""
24
25
LOGIC_OPERATOR = "LOGIC_OPERATOR"
@@ -28,6 +30,14 @@ class TokenTypes:
28
30
PARENTHESIS_CLOSED = "PARENTHESIS_CLOSED"
29
31
32
33
+@dataclass
34
+class Token:
35
+ """Token class"""
36
+ value: str
37
+ type: TokenTypes
38
+ position: Tuple[int, int]
39
+
40
41
class Operators:
42
"""Operators"""
43
0 commit comments