Skip to content

Commit c4946e2

Browse files
author
Gerit Wagner
committed
update token/tokentypes
1 parent fb52ad9 commit c4946e2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

search_query/constants.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"""Constants for search-query"""
33
# pylint: disable=too-few-public-methods
44
# pylint: disable=line-too-long
5+
from dataclasses import dataclass
56
from enum import Enum
7+
from typing import Tuple
68

79
# noqa: E501
810

@@ -17,7 +19,7 @@ class PLATFORM(Enum):
1719
PRE_NOTATION = "pre_notation"
1820

1921

20-
class TokenTypes:
22+
class TokenTypes(Enum):
2123
"""Token types"""
2224

2325
LOGIC_OPERATOR = "LOGIC_OPERATOR"
@@ -28,6 +30,14 @@ class TokenTypes:
2830
PARENTHESIS_CLOSED = "PARENTHESIS_CLOSED"
2931

3032

33+
@dataclass
34+
class Token:
35+
"""Token class"""
36+
value: str
37+
type: TokenTypes
38+
position: Tuple[int, int]
39+
40+
3141
class Operators:
3242
"""Operators"""
3343

0 commit comments

Comments
 (0)