2020-11-29 10:17:56 +00:00
|
|
|
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
2021-07-01 10:47:58 +00:00
|
|
|
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
|
2022-03-12 11:39:52 +00:00
|
|
|
# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors
|
2020-11-29 10:17:56 +00:00
|
|
|
|
|
|
|
import tokenize
|
|
|
|
from io import StringIO
|
2021-09-25 04:23:32 +00:00
|
|
|
from tokenize import TokenInfo
|
|
|
|
from typing import List
|
2020-11-29 10:17:56 +00:00
|
|
|
|
|
|
|
|
2021-09-25 04:23:32 +00:00
|
|
|
def _tokenize_str(code: str) -> List[TokenInfo]:
|
2020-11-29 10:17:56 +00:00
|
|
|
return list(tokenize.generate_tokens(StringIO(code).readline))
|