diff options
author | Lua Team <team@lua.org> | 2000-11-06 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2000-11-06 12:00:00 +0000 |
commit | 8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch) | |
tree | 25859eb162c67eafc46866e0ec3a9a7ebf93157a /doc/lua.html | |
parent | b7610da5fed99f59ac73ae452da8839a0f2c1bda (diff) | |
download | lua-github-4.0.tar.gz |
Lua 4.04.0
Diffstat (limited to 'doc/lua.html')
-rw-r--r-- | doc/lua.html | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/doc/lua.html b/doc/lua.html new file mode 100644 index 00000000..ef861bb5 --- /dev/null +++ b/doc/lua.html @@ -0,0 +1,151 @@ +<!-- lua.man,v 1.3 2000/09/04 21:41:28 lhf Exp --> +<HTML> +<HEAD> +<TITLE>LUA man page</TITLE> +</HEAD> + +<BODY BGCOLOR="#FFFFFF"> + +<H1>NAME</H1> +lua - Lua interpreter +<H1>SYNOPSIS</H1> +<B>lua</B> +[ +<I>arguments</I> +] +<H1>DESCRIPTION</H1> +<B>lua</B> +is the stand-alone Lua interpreter. +It loads and executes Lua programs, +either in textual source form or +in precompiled binary form, +as output by +<B>luac</B>, +the Lua compiler. +<B>lua</B> +can be used as a batch interpreter and also interactively. +<P> +The +<I>arguments</I> +can be options, assignments, or filenames, +and are processed in order, +from left to right. +<P> +Options start with +<B>-</B> +and are described below. +<P> +An assignment is an argument of the form +<B>a=b</B>, +which assigns the string +.RB ` b ' +to the global variable +<B>a</B>. +Note that no quotes are needed around the string if it does not contain spaces +or other characters special to the shell. +This is for convenience only. +(In general, +you should be careful when using quotes and spaces on the command line +because they are usually handled by the shell.) +<P> +If the argument is neither an option nor an assignment, +then it is assumed to be a filename, +which is then loaded and executed. +<P> +If no arguments are given, +then +<B>"-v -i"</B> +is assumed when the standard input is a terminal; +otherwise, +<B>-</B> +is assumed. +<H1>OPTIONS</H1> +<P> +<B>-</B> +load the standard input as a file, +that is, +not interactively, +even when the standard input is a terminal. +<P> +<B>-c</B> +close Lua before exiting. +<P> +<B>-e "</B><I>stat"</I> +execute statement +<I>stat</I>. +You will need to quote +<I>stat </I> +if it contains spaces or quotes. +<P> +<B>-f "</B><I>file"</I> +collect all remaining arguments as strings into a global table named +<B>arg</B> +and then execute +<I>file</I>. +The arguments in +<B>arg</B> +start at 0, +which contains the string +.RI ` file '. +The index of the last argument is stored in +<B>"arg.n"</B>. +<P> +<B>-i</B> +enter interactive mode, +displaying a prompt. +In this mode, +<B>lua</B> +reads lines from the standard input and executes them as they are read. +Each line must contain a complete statement. +To span a statement across several lines, end each line with a backslash +<B>`\e'</B>. +The prompt shown is the value of the global variable +<B>_PROMPT</B>, +if this value is a string. +So, +to change the prompt, +set +<B>_PROMPT</B> +to a string of your choice. +You can do that after calling the interpreter +or on the command line with +<B>"_PROMPT=\'lua: \'"</B>, +for example. +(Note the need for quotes, because the string contains a space.) +The default prompt is ``> ''. +<P> +<B>-q</B> +enter interactive mode, +but without displaying a prompt. +<P> +<B>-s</B><I>n</I> +set the stack size to +.IB n . +If present, +this must be the first option. +Note that +<I>n</I> +is in the same argument as +<B>-s</B>. +For example, +to specify a stack size of 2000, +use +<B>-s2000</B>. +<P> +<B>-v</B> +print version information. +<H1>SEE ALSO</H1> +<B>luac</B>(1) +<BR> +<A HREF="http://www.tecgraf.puc-rio.br/lua/">http://www.tecgraf.puc-rio.br/lua/</A> +<H1>DIAGNOSTICS</H1> +Error messages should be self explanatory. +<H1>AUTHORS</H1> +R. Ierusalimschy, +L. H. de Figueiredo, +and +W. Celes +(<A HREF="mailto:lua@tecgraf.puc-rio.br">lua@tecgraf.puc-rio.br</A>) +<!-- EOF --> +</BODY> +</HTML> |