Files
smnp-py/smnp/token/tokenizers/string.py
Bartłomiej Pluta f826516d8f Refactor tokenizer
2019-07-03 01:55:08 +02:00

17 lines
541 B
Python

from smnp.token.type import TokenType
from smnp.token.model import Token
def tokenizeString(input, current, line):
if input[current] == '"':
value = input[current]
char = ''
consumedChars = 1
while char != '"':
if char is None: #TODO!!!
print("String not terminated")
char = input[current + consumedChars]
value += char
consumedChars += 1
return (consumedChars, Token(TokenType.STRING, value, (line, current)))
return (0, None)