| ------------------------------------------------------------------------------- |
| -- Copyright (c) 2006-2013 Fabien Fleutot and others. |
| -- |
| -- All rights reserved. |
| -- |
| -- This program and the accompanying materials are made available |
| -- under the terms of the Eclipse Public License v1.0 which |
| -- accompanies this distribution, and is available at |
| -- http://www.eclipse.org/legal/epl-v10.html |
| -- |
| -- This program and the accompanying materials are also made available |
| -- under the terms of the MIT public license which accompanies this |
| -- distribution, and is available at http://www.lua.org/license.html |
| -- |
| -- Contributors: |
| -- Fabien Fleutot - API and implementation |
| -- |
| ------------------------------------------------------------------------------- |
| |
| -{ extension 'withdo' } |
| |
| local original_close = io.close |
| |
| function x() |
| with f1, f2 = io.open 'withdo_test.mlua', io.open 'trycatch_test.mlua' do |
| local t1 = f1:read '*a' |
| local t2 = f2:read '*a' |
| return #t1, #t2 |
| end |
| end |
| |
| print(x()) |