From 263d7af0fca89f4b7453f483699ae1b95b09543a Mon Sep 17 00:00:00 2001 From: James King Date: Thu, 18 Apr 2013 18:39:49 -0400 Subject: [PATCH] Added line and column offsets --- hy/compiler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hy/compiler.py b/hy/compiler.py index 0595316..5e38c80 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -229,8 +229,13 @@ class HyASTCompiler(object): if type(expr) != HyDict: raise TypeError("FOOBAR") else: + if len(keywords) > 0: + raise HyCompileError("There can only be " + "one &key argument") keywords = [ast.keyword(arg=ast_str(k), - value=self.compile(v)) + value=self.compile(v), + lineno=expr.start_line, + col_offset=expr.start_column) for k, v in expr.items()] elif lambda_keyword == "&optional": # not implemented yet.