rascal
rascal copied to clipboard
Chained map key checks throw NotYetImplemented exception.
Chaining map key checks for nested maps throws the following exception:
org.rascalmpl.interpreter.asserts.NotYetImplemented: Operation not yet implemented on class org.rascalmpl.semantics.dynamic.Assignable$Bracket at |rascal://metrics::Duplication|(721,31,<36,3>,<36,34>)(internal error) at $shell$(|main://$shell$|)
org.rascalmpl.interpreter.asserts.NotYetImplemented: Operation not yet implemented on class org.rascalmpl.semantics.dynamic.Assignable$Bracket at |rascal://metrics::Duplication|(721,31,<36,3>,<36,34>)
at org.rascalmpl.ast.AbstractAST.interpret(AbstractAST.java:146)
at org.rascalmpl.semantics.dynamic.Assignable$Subscript.interpret(Assignable.java:581)
at org.rascalmpl.semantics.dynamic.Assignable$IfDefinedOrDefault.assignment(Assignable.java:392)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:199)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:749)
at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:458)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:749)
at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:458)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:467)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:413)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:327)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:305)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:486)
at org.rascalmpl.semantics.dynamic.Command$Expression.interpret(Command.java:57)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1147)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1107)
at org.rascalmpl.eclipse.console.RascalScriptInterpreter.execCommand(RascalScriptInterpreter.java:446)
at org.rascalmpl.eclipse.console.RascalScriptInterpreter.run(RascalScriptInterpreter.java:239)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
The code used is:
map[str, map[str, set[int]]] nestedMap = ();
(nestedMap["abc"] ? ("xyz": {})) ["xyz"] ? { 5 } += 5;
ok thanks
On Tue, Nov 12, 2013 at 12:46 PM, Omar007 [email protected] wrote:
Chaining map key checks for nested maps throws the following exception:
org.rascalmpl.interpreter.asserts.NotYetImplemented: Operation not yet implemented on class org.rascalmpl.semantics.dynamic.Assignable$Bracket at |rascal://metrics::Duplication|(721,31,<36,3>,<36,34>)(internal error) at $shell$(|main://$shell$|) org.rascalmpl.interpreter.asserts.NotYetImplemented: Operation not yet implemented on class org.rascalmpl.semantics.dynamic.Assignable$Bracket at |rascal://metrics::Duplication|(721,31,<36,3>,<36,34>) at org.rascalmpl.ast.AbstractAST.interpret(AbstractAST.java:146) at org.rascalmpl.semantics.dynamic.Assignable$Subscript.interpret(Assignable.java:581) at org.rascalmpl.semantics.dynamic.Assignable$IfDefinedOrDefault.assignment(Assignable.java:392) at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:199) at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:749) at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:458) at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:749) at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:458) at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:467) at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:413) at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:327) at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:305) at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:486) at org.rascalmpl.semantics.dynamic.Command$Expression.interpret(Command.java:57) at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1147) at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1107) at org.rascalmpl.eclipse.console.RascalScriptInterpreter.execCommand(RascalScriptInterpreter.java:446) at org.rascalmpl.eclipse.console.RascalScriptInterpreter.run(RascalScriptInterpreter.java:239) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
The code used is:
map[str, map[str, set[int]]] nestedMap = ();
(nestedMap["abc"] ? ("xyz": {})) ["xyz"] ? { 5 } += 5;
— Reply to this email directly or view it on GitHubhttps://github.com/cwi-swat/rascal/issues/391 .
Jurgen Vinju
-
Centrum Wiskunde & Informatica - SWAT
-
INRIA Lille - ATEAMS
-
Universiteit van Amsterdam
www: http://jurgen.vinju.org, http://www.rascal-mpl.org, http://twitter.com/jurgenvinju skype: jurgen.vinju
This has been the pile for a long time. Will check later if the bracket notation on the left hand side of assignables is still unimplemented. Hi @Omar007 😇