[Nice-commit] Nice/src/bossa/syntax assign.nice,1.2,1.3 tools.nice,1.49,1.50
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-09-02 19:12:19
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6016/F:/nice/src/bossa/syntax Modified Files: assign.nice tools.nice Log Message: Make multi argument 'array' indexing possible. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** tools.nice 2 Sep 2004 15:46:32 -0000 1.49 --- tools.nice 2 Sep 2004 19:12:09 -0000 1.50 *************** *** 188,191 **** --- 188,192 ---- LocatedString name(VarSymbol) = native VarSymbol.name; + Arguments.Argument[] arguments(Arguments) = native Arguments.arguments; mlsub.typing.Polytype getType(Expression) = native mlsub.typing.Polytype Expression.getType(); Index: assign.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/assign.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** assign.nice 5 Aug 2004 10:45:30 -0000 1.2 --- assign.nice 2 Sep 2004 19:12:09 -0000 1.3 *************** *** 38,49 **** public Expression createAssignExp(Expression to, Expression value) { ! // Rewrite "get(e, i) = v" into "set(e, i, v)" if (to instanceof CallExp && "get".equals(notNull(to.function).toString())) ! return createCallExp( new IdentExp(new LocatedString("set", notNull(to.function).location())), ! to.arguments.getExp(0), ! to.arguments.getExp(1), ! value); ! return new AssignExp(to: to, value: value); } --- 38,52 ---- public Expression createAssignExp(Expression to, Expression value) { ! // Rewrite "get(e, i, ...) = v" into "set(e, i, ... , v)" if (to instanceof CallExp && "get".equals(notNull(to.function).toString())) ! { ! List<Arguments.Argument> args = new ArrayList(to.arguments.arguments); ! args.add(new Arguments.Argument(value)); ! ! return createCallExp( new IdentExp(new LocatedString("set", notNull(to.function).location())), ! new Arguments(args.toArray())); ! } ! return new AssignExp(to: to, value: value); } |