diff --git a/src/Hassium/HassiumObjects/HassiumTuple.cs b/src/Hassium/HassiumObjects/HassiumTuple.cs index 0473eda..88d00ba 100644 --- a/src/Hassium/HassiumObjects/HassiumTuple.cs +++ b/src/Hassium/HassiumObjects/HassiumTuple.cs @@ -62,7 +62,7 @@ private HassiumObject add(HassiumObject[] args) private HassiumObject remove(HassiumObject[] args) { foreach (HassiumObject arg in args) - Attributes.Remove("Item" + ((HassiumInt)arg).Value); + Attributes.Remove(((HassiumString)arg).Value); return null; } diff --git a/src/Hassium/Parser/Parser.cs b/src/Hassium/Parser/Parser.cs index 356015f..3850c29 100644 --- a/src/Hassium/Parser/Parser.cs +++ b/src/Hassium/Parser/Parser.cs @@ -365,6 +365,7 @@ private static ArgListNode parseArgList(Parser parser) if (!parser.AcceptToken(TokenType.Comma)) break; } + parser.ExpectToken("Unterminated argument list", TokenType.RParen); return ret; @@ -601,7 +602,17 @@ private static AstNode parseTuple(Parser parser) parser.ExpectToken(TokenType.Identifier, "tuple"); string name = parser.ExpectToken(TokenType.Identifier).Value.ToString(); - AstNode body = parseArgList(parser); + parser.AcceptToken(TokenType.LParen, "("); + + AstNode body = new CodeBlock(position); + while (!parser.AcceptToken(TokenType.RParen) && !parser.MatchToken(TokenType.EndOfLine)) + { + body.Children.Add(parseExpression(parser)); + if (!parser.AcceptToken(TokenType.Comma)) + break; + } + + parser.AcceptToken(TokenType.RParen); parser.ExpectToken(TokenType.EndOfLine); return new TupleNode(position, name, body); }