Refactor tokenizer: remove colon, add colon as duration separator to note and create TokenType.TYPE

This commit is contained in:
Bartłomiej Pluta
2019-07-05 23:09:27 +02:00
parent f7b8704516
commit c1fbc2fe23
6 changed files with 43 additions and 30 deletions

View File

@@ -1,23 +1,24 @@
from enum import Enum
from enum import Enum, auto
class TokenType(Enum):
OPEN_PAREN = 1
CLOSE_PAREN = 2
ASTERISK = 3
STRING = 4
IDENTIFIER = 5
COMMA = 6
INTEGER = 7
OPEN_BRACKET = 8
CLOSE_BRACKET = 9
ASSIGN = 10
COLON = 11
NOTE = 12
COMMENT = 13
PERCENT = 14
MINUS = 15
FUNCTION = 16
RETURN = 17
DOT = 18
OPEN_SQUARE = 19
CLOSE_SQUARE = 20
OPEN_PAREN = auto()
CLOSE_PAREN = auto()
ASTERISK = auto()
STRING = auto()
IDENTIFIER = auto()
COMMA = auto()
INTEGER = auto()
OPEN_BRACKET = auto()
CLOSE_BRACKET = auto()
ASSIGN = auto()
NOTE = auto()
COMMENT = auto()
PERCENT = auto()
MINUS = auto()
FUNCTION = auto()
RETURN = auto()
DOT = auto()
OPEN_SQUARE = auto()
CLOSE_SQUARE = auto()
TYPE = auto()