diff options
| author | mryouse | 2022-06-22 04:03:13 +0000 |
|---|---|---|
| committer | mryouse | 2022-06-22 04:03:13 +0000 |
| commit | 810d01108110901a290aa4d4a9cdf96187430d0d (patch) | |
| tree | 4d8b1142e70b0c08426644ac35319febacb88228 /neb/lexer.py | |
| parent | 7e69cf2d253ba12055b827c584380438e2e0a70f (diff) | |
initial commit of user defined types!
Diffstat (limited to 'neb/lexer.py')
| -rw-r--r-- | neb/lexer.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
