This is Lua 1.0. It was never publicly released. This code is a snapshot of

the status of Lua on 28 Jul 1993. It is distributed for historical curiosity
to celebrate 10 years of Lua and is hereby placed in the public domain.

There is no documentation, except the test programs. The manual for Lua 1.1
probably works for this version as well.

The source files for the lexer and parser have been lost: all that is left is
the output of lex and yacc. A grammar can be found inside y_tab.c in yyreds.

The code compiles and runs in RedHat 5.2 with gcc 2.7.2.3. It may not run in
newer systems, because it assumes that stdin and stdout are constants, though
ANSI C does not promise they are. If make fails, try using the fixed modules
provided in the "fixed" directory. To see the differences (which are really
quite minor), do "make diff".

To see Lua 1.0 in action, do "make test". (The last test raises an error on
purpose.)

Enjoy!

-- The Lua team, lua@tecgraf.puc-rio.br
This commit is contained in:
The Lua team
2003-10-09 23:44:30 -03:00
parent cd05d9c5cb
commit b9dde086db
12 changed files with 1605 additions and 0 deletions

47
save.lua Normal file
View File

@@ -0,0 +1,47 @@
$debug
function savevar (n,v)
if v = nil then return end;
if type(v) = "number" then print(n.."="..v) return end
if type(v) = "string" then print(n.."='"..v.."'") return end
if type(v) = "table" then
if v.__visited__ ~= nil then
print(n .. "=" .. v.__visited__);
else
print(n.."=@()")
v.__visited__ = n;
local r,f;
r,f = next(v,nil);
while r ~= nil do
if r ~= "__visited__" then
if type(r) = 'string' then
savevar(n.."['"..r.."']",f)
else
savevar(n.."["..r.."]",f)
end
end
r,f = next(v,r)
end
end
end
end
function save ()
local n,v
n,v = nextvar(nil)
while n ~= nil do
savevar(n,v);
n,v = nextvar(n)
end
end
a = 3
x = @{a = 4, b = "name", l=@[4,5,67]}
b = @{t=5}
x.next = b
save()