Enable extending existing types to add custom methods
This commit is contained in:
@@ -6,6 +6,7 @@ from smnp.token.tokenizers.bracket import tokenizeOpenBracket, tokenizeCloseBrac
|
||||
from smnp.token.tokenizers.comma import tokenizeComma
|
||||
from smnp.token.tokenizers.comment import tokenizeComment
|
||||
from smnp.token.tokenizers.dot import tokenizeDot
|
||||
from smnp.token.tokenizers.extend import tokenizeExtend
|
||||
from smnp.token.tokenizers.function import tokenizeFunction
|
||||
from smnp.token.tokenizers.identifier import tokenizeIdentifier
|
||||
from smnp.token.tokenizers.integer import tokenizeInteger
|
||||
@@ -30,6 +31,7 @@ tokenizers = (
|
||||
tokenizeString,
|
||||
tokenizeFunction,
|
||||
tokenizeReturn,
|
||||
tokenizeExtend,
|
||||
tokenizeInteger,
|
||||
tokenizeNote,
|
||||
tokenizeIdentifier,
|
||||
|
||||
6
smnp/token/tokenizers/extend.py
Normal file
6
smnp/token/tokenizers/extend.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from smnp.token.tools import tokenizeKeyword
|
||||
from smnp.token.type import TokenType
|
||||
|
||||
|
||||
def tokenizeExtend(input, current, line):
|
||||
return tokenizeKeyword(TokenType.EXTEND, "extend", input, current, line)
|
||||
@@ -22,3 +22,4 @@ class TokenType(Enum):
|
||||
OPEN_SQUARE = auto()
|
||||
CLOSE_SQUARE = auto()
|
||||
TYPE = auto()
|
||||
EXTEND = auto()
|
||||
|
||||
Reference in New Issue
Block a user