From 60462cc98aca994574ecd6077d170192e61821dd Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 23 Sep 2021 23:20:52 +0200 Subject: [PATCH] parsing/tokenizer: partial revert of 5141f7c6 (#735) --- vunit/parsing/tokenizer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vunit/parsing/tokenizer.py b/vunit/parsing/tokenizer.py index cd120750e..e30250aef 100644 --- a/vunit/parsing/tokenizer.py +++ b/vunit/parsing/tokenizer.py @@ -13,8 +13,11 @@ from vunit.ostools import read_file, file_exists, simplify_path +TokenType = collections.namedtuple("Token", ["kind", "value", "location"]) + + def Token(kind, value="", location=None): # pylint: disable=invalid-name - return collections.namedtuple("Token", ["kind", "value", "location"])(kind, value, location) + return TokenType(kind, value, location) class TokenKind: