From ed2a063a4388ef7e315f4d7b9e59405b9aad71e4 Mon Sep 17 00:00:00 2001 From: mryouse Date: Fri, 1 Jul 2022 02:59:39 +0000 Subject: Revert "initial commit of multi-type support (only list of strings for now)" This reverts commit bf8900200c25d383c883501446a8048ad8966d94. --- neb/parser.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'neb/parser.py') diff --git a/neb/parser.py b/neb/parser.py index 10c6633..bbaf7a8 100644 --- a/neb/parser.py +++ b/neb/parser.py @@ -45,19 +45,8 @@ def parseLiteral(token, prev, tokens): def parseType(token, prev, tokens): # if the next token is a symbol, combine for a type - if tokens[0].type_ == TokenType.SYMBOL: + if len(tokens) > 0 and tokens[0].type_ == TokenType.SYMBOL: return Type(f":{tokens[0].text}"), 2 - elif tokens[0].type_ == TokenType.OPEN_BRACKET: - # only format currently supported: - # [ ] - if tokens[1].type_ != TokenType.COLON: - raise ParseError("invalid type definition (expecting colon)", tokens[1].line) - typ, counter = parseType(tokens[1], tokens[0], tokens[2:]) - if tokens[1+counter].type_ != TokenType.CLOSE_BRACKET: - raise ParseError("invalid type definition (expecting close bracket)", tokens[1+counter].line) - return MultiType(f":[{typ.name}]", typ), counter + 3 - else: - raise ParseError("invalid type definition!", tokens[0].line) def parse(tokens): idx = 0 -- cgit v1.2.3