From 810d01108110901a290aa4d4a9cdf96187430d0d Mon Sep 17 00:00:00 2001 From: mryouse Date: Wed, 22 Jun 2022 04:03:13 +0000 Subject: initial commit of user defined types! --- neb/lexer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'neb/lexer.py') diff --git a/neb/lexer.py b/neb/lexer.py index b522460..22a9710 100644 --- a/neb/lexer.py +++ b/neb/lexer.py @@ -162,7 +162,9 @@ def get_type(data, line): counter += 1 if counter >= len(data): break - if value not in types: - raise LexError(f"unrecognized type {value}", line) - return Token(types[value], value, None, line), counter - 1 + if value in types: + typ = types[value] + else: + typ = TokenType.USER_TYPE + return Token(typ, value, None, line), counter - 1 -- cgit v1.2.3