Tamar 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/.gitmodules +3 -0
  2. data/HISTORY +22 -5
  3. data/Tamar.gemspec +114 -1
  4. data/VERSION +1 -1
  5. data/src/lua/CMakeLists.txt +176 -0
  6. data/src/lua/COPYRIGHT +34 -0
  7. data/src/lua/FindReadline.cmake +25 -0
  8. data/src/lua/HISTORY +183 -0
  9. data/src/lua/INSTALL +99 -0
  10. data/src/lua/Makefile +128 -0
  11. data/src/lua/README +46 -0
  12. data/src/lua/dist.cmake +450 -0
  13. data/src/lua/dist.info +10 -0
  14. data/src/lua/doc/amazon.gif +0 -0
  15. data/src/lua/doc/contents.html +499 -0
  16. data/src/lua/doc/cover.png +0 -0
  17. data/src/lua/doc/logo.gif +0 -0
  18. data/src/lua/doc/lua.1 +163 -0
  19. data/src/lua/doc/lua.css +41 -0
  20. data/src/lua/doc/lua.html +172 -0
  21. data/src/lua/doc/luac.1 +136 -0
  22. data/src/lua/doc/luac.html +145 -0
  23. data/src/lua/doc/manual.css +13 -0
  24. data/src/lua/doc/manual.html +8801 -0
  25. data/src/lua/doc/readme.html +40 -0
  26. data/src/lua/etc/Makefile +44 -0
  27. data/src/lua/etc/README +37 -0
  28. data/src/lua/etc/all.c +38 -0
  29. data/src/lua/etc/lua.hpp +9 -0
  30. data/src/lua/etc/lua.ico +0 -0
  31. data/src/lua/etc/lua.pc +31 -0
  32. data/src/lua/etc/luavs.bat +28 -0
  33. data/src/lua/etc/min.c +39 -0
  34. data/src/lua/etc/noparser.c +50 -0
  35. data/src/lua/etc/strict.lua +41 -0
  36. data/src/lua/src/Makefile +182 -0
  37. data/src/lua/src/lapi.c +1087 -0
  38. data/src/lua/src/lapi.h +16 -0
  39. data/src/lua/src/lauxlib.c +652 -0
  40. data/src/lua/src/lauxlib.h +174 -0
  41. data/src/lua/src/lbaselib.c +653 -0
  42. data/src/lua/src/lcode.c +831 -0
  43. data/src/lua/src/lcode.h +76 -0
  44. data/src/lua/src/ldblib.c +398 -0
  45. data/src/lua/src/ldebug.c +638 -0
  46. data/src/lua/src/ldebug.h +33 -0
  47. data/src/lua/src/ldo.c +518 -0
  48. data/src/lua/src/ldo.h +57 -0
  49. data/src/lua/src/ldump.c +164 -0
  50. data/src/lua/src/lfunc.c +174 -0
  51. data/src/lua/src/lfunc.h +34 -0
  52. data/src/lua/src/lgc.c +711 -0
  53. data/src/lua/src/lgc.h +110 -0
  54. data/src/lua/src/linit.c +38 -0
  55. data/src/lua/src/liolib.c +556 -0
  56. data/src/lua/src/llex.c +463 -0
  57. data/src/lua/src/llex.h +81 -0
  58. data/src/lua/src/llimits.h +128 -0
  59. data/src/lua/src/lmathlib.c +263 -0
  60. data/src/lua/src/lmem.c +86 -0
  61. data/src/lua/src/lmem.h +49 -0
  62. data/src/lua/src/loadlib.c +666 -0
  63. data/src/lua/src/loadlib_rel.c +719 -0
  64. data/src/lua/src/lobject.c +214 -0
  65. data/src/lua/src/lobject.h +381 -0
  66. data/src/lua/src/lopcodes.c +102 -0
  67. data/src/lua/src/lopcodes.h +268 -0
  68. data/src/lua/src/loslib.c +243 -0
  69. data/src/lua/src/lparser.c +1339 -0
  70. data/src/lua/src/lparser.h +82 -0
  71. data/src/lua/src/lstate.c +214 -0
  72. data/src/lua/src/lstate.h +169 -0
  73. data/src/lua/src/lstring.c +111 -0
  74. data/src/lua/src/lstring.h +31 -0
  75. data/src/lua/src/lstrlib.c +871 -0
  76. data/src/lua/src/ltable.c +588 -0
  77. data/src/lua/src/ltable.h +40 -0
  78. data/src/lua/src/ltablib.c +287 -0
  79. data/src/lua/src/ltm.c +75 -0
  80. data/src/lua/src/ltm.h +54 -0
  81. data/src/lua/src/lua.c +392 -0
  82. data/src/lua/src/lua.def +131 -0
  83. data/src/lua/src/lua.h +388 -0
  84. data/src/lua/src/lua.rc +28 -0
  85. data/src/lua/src/lua_dll.rc +26 -0
  86. data/src/lua/src/luac.c +200 -0
  87. data/src/lua/src/luac.rc +1 -0
  88. data/src/lua/src/luaconf.h.in +724 -0
  89. data/src/lua/src/luaconf.h.orig +763 -0
  90. data/src/lua/src/lualib.h +53 -0
  91. data/src/lua/src/lundump.c +227 -0
  92. data/src/lua/src/lundump.h +36 -0
  93. data/src/lua/src/lvm.c +766 -0
  94. data/src/lua/src/lvm.h +36 -0
  95. data/src/lua/src/lzio.c +82 -0
  96. data/src/lua/src/lzio.h +67 -0
  97. data/src/lua/src/print.c +227 -0
  98. data/src/lua/test/README +26 -0
  99. data/src/lua/test/bisect.lua +27 -0
  100. data/src/lua/test/cf.lua +16 -0
  101. data/src/lua/test/echo.lua +5 -0
  102. data/src/lua/test/env.lua +7 -0
  103. data/src/lua/test/factorial.lua +32 -0
  104. data/src/lua/test/fib.lua +40 -0
  105. data/src/lua/test/fibfor.lua +13 -0
  106. data/src/lua/test/globals.lua +13 -0
  107. data/src/lua/test/hello.lua +3 -0
  108. data/src/lua/test/life.lua +111 -0
  109. data/src/lua/test/luac.lua +7 -0
  110. data/src/lua/test/printf.lua +7 -0
  111. data/src/lua/test/readonly.lua +12 -0
  112. data/src/lua/test/sieve.lua +29 -0
  113. data/src/lua/test/sort.lua +66 -0
  114. data/src/lua/test/table.lua +12 -0
  115. data/src/lua/test/trace-calls.lua +32 -0
  116. data/src/lua/test/trace-globals.lua +38 -0
  117. data/src/lua/test/xd.lua +14 -0
  118. metadata +115 -2
@@ -0,0 +1,41 @@
1
+ body {
2
+ color: #000000 ;
3
+ background-color: #FFFFFF ;
4
+ font-family: sans-serif ;
5
+ text-align: justify ;
6
+ margin-right: 20px ;
7
+ margin-left: 20px ;
8
+ }
9
+
10
+ h1, h2, h3, h4 {
11
+ font-weight: normal ;
12
+ font-style: italic ;
13
+ }
14
+
15
+ a:link {
16
+ color: #000080 ;
17
+ background-color: inherit ;
18
+ text-decoration: none ;
19
+ }
20
+
21
+ a:visited {
22
+ background-color: inherit ;
23
+ text-decoration: none ;
24
+ }
25
+
26
+ a:link:hover, a:visited:hover {
27
+ color: #000080 ;
28
+ background-color: #E0E0FF ;
29
+ }
30
+
31
+ a:link:active, a:visited:active {
32
+ color: #FF0000 ;
33
+ }
34
+
35
+ hr {
36
+ border: 0 ;
37
+ height: 1px ;
38
+ color: #a0a0a0 ;
39
+ background-color: #a0a0a0 ;
40
+ }
41
+
@@ -0,0 +1,172 @@
1
+ <!-- $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $ -->
2
+ <HTML>
3
+ <HEAD>
4
+ <TITLE>LUA man page</TITLE>
5
+ <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
6
+ </HEAD>
7
+
8
+ <BODY BGCOLOR="#FFFFFF">
9
+
10
+ <H2>NAME</H2>
11
+ lua - Lua interpreter
12
+ <H2>SYNOPSIS</H2>
13
+ <B>lua</B>
14
+ [
15
+ <I>options</I>
16
+ ]
17
+ [
18
+ <I>script</I>
19
+ [
20
+ <I>args</I>
21
+ ]
22
+ ]
23
+ <H2>DESCRIPTION</H2>
24
+ <B>lua</B>
25
+ is the stand-alone Lua interpreter.
26
+ It loads and executes Lua programs,
27
+ either in textual source form or
28
+ in precompiled binary form.
29
+ (Precompiled binaries are output by
30
+ <B>luac</B>,
31
+ the Lua compiler.)
32
+ <B>lua</B>
33
+ can be used as a batch interpreter and also interactively.
34
+ <P>
35
+ The given
36
+ <I>options</I>
37
+ (see below)
38
+ are executed and then
39
+ the Lua program in file
40
+ <I>script</I>
41
+ is loaded and executed.
42
+ The given
43
+ <I>args</I>
44
+ are available to
45
+ <I>script</I>
46
+ as strings in a global table named
47
+ <B>arg</B>.
48
+ If these arguments contain spaces or other characters special to the shell,
49
+ then they should be quoted
50
+ (but note that the quotes will be removed by the shell).
51
+ The arguments in
52
+ <B>arg</B>
53
+ start at 0,
54
+ which contains the string
55
+ '<I>script</I>'.
56
+ The index of the last argument is stored in
57
+ <B>arg.n</B>.
58
+ The arguments given in the command line before
59
+ <I>script</I>,
60
+ including the name of the interpreter,
61
+ are available in negative indices in
62
+ <B>arg</B>.
63
+ <P>
64
+ At the very start,
65
+ before even handling the command line,
66
+ <B>lua</B>
67
+ executes the contents of the environment variable
68
+ <B>LUA_INIT</B>,
69
+ if it is defined.
70
+ If the value of
71
+ <B>LUA_INIT</B>
72
+ is of the form
73
+ '@<I>filename</I>',
74
+ then
75
+ <I>filename</I>
76
+ is executed.
77
+ Otherwise, the string is assumed to be a Lua statement and is executed.
78
+ <P>
79
+ Options start with
80
+ <B>'-'</B>
81
+ and are described below.
82
+ You can use
83
+ <B>'--'</B>
84
+ to signal the end of options.
85
+ <P>
86
+ If no arguments are given,
87
+ then
88
+ <B>"-v -i"</B>
89
+ is assumed when the standard input is a terminal;
90
+ otherwise,
91
+ <B>"-"</B>
92
+ is assumed.
93
+ <P>
94
+ In interactive mode,
95
+ <B>lua</B>
96
+ prompts the user,
97
+ reads lines from the standard input,
98
+ and executes them as they are read.
99
+ If a line does not contain a complete statement,
100
+ then a secondary prompt is displayed and
101
+ lines are read until a complete statement is formed or
102
+ a syntax error is found.
103
+ So, one way to interrupt the reading of an incomplete statement is
104
+ to force a syntax error:
105
+ adding a
106
+ <B>';'</B>
107
+ in the middle of a statement is a sure way of forcing a syntax error
108
+ (except inside multiline strings and comments; these must be closed explicitly).
109
+ If a line starts with
110
+ <B>'='</B>,
111
+ then
112
+ <B>lua</B>
113
+ displays the values of all the expressions in the remainder of the
114
+ line. The expressions must be separated by commas.
115
+ The primary prompt is the value of the global variable
116
+ <B>_PROMPT</B>,
117
+ if this value is a string;
118
+ otherwise, the default prompt is used.
119
+ Similarly, the secondary prompt is the value of the global variable
120
+ <B>_PROMPT2</B>.
121
+ So,
122
+ to change the prompts,
123
+ set the corresponding variable to a string of your choice.
124
+ You can do that after calling the interpreter
125
+ or on the command line
126
+ (but in this case you have to be careful with quotes
127
+ if the prompt string contains a space; otherwise you may confuse the shell.)
128
+ The default prompts are "&gt; " and "&gt;&gt; ".
129
+ <H2>OPTIONS</H2>
130
+ <P>
131
+ <B>-</B>
132
+ load and execute the standard input as a file,
133
+ that is,
134
+ not interactively,
135
+ even when the standard input is a terminal.
136
+ <P>
137
+ <B>-e </B><I>stat</I>
138
+ execute statement
139
+ <I>stat</I>.
140
+ You need to quote
141
+ <I>stat </I>
142
+ if it contains spaces, quotes,
143
+ or other characters special to the shell.
144
+ <P>
145
+ <B>-i</B>
146
+ enter interactive mode after
147
+ <I>script</I>
148
+ is executed.
149
+ <P>
150
+ <B>-l </B><I>name</I>
151
+ call
152
+ <B>require</B>('<I>name</I>')
153
+ before executing
154
+ <I>script</I>.
155
+ Typically used to load libraries.
156
+ <P>
157
+ <B>-v</B>
158
+ show version information.
159
+ <H2>SEE ALSO</H2>
160
+ <B>luac</B>(1)
161
+ <BR>
162
+ <A HREF="http://www.lua.org/">http://www.lua.org/</A>
163
+ <H2>DIAGNOSTICS</H2>
164
+ Error messages should be self explanatory.
165
+ <H2>AUTHORS</H2>
166
+ R. Ierusalimschy,
167
+ L. H. de Figueiredo,
168
+ and
169
+ W. Celes
170
+ <!-- EOF -->
171
+ </BODY>
172
+ </HTML>
@@ -0,0 +1,136 @@
1
+ .\" $Id: luac.man,v 1.28 2006/01/06 16:03:34 lhf Exp $
2
+ .TH LUAC 1 "$Date: 2006/01/06 16:03:34 $"
3
+ .SH NAME
4
+ luac \- Lua compiler
5
+ .SH SYNOPSIS
6
+ .B luac
7
+ [
8
+ .I options
9
+ ] [
10
+ .I filenames
11
+ ]
12
+ .SH DESCRIPTION
13
+ .B luac
14
+ is the Lua compiler.
15
+ It translates programs written in the Lua programming language
16
+ into binary files that can be later loaded and executed.
17
+ .LP
18
+ The main advantages of precompiling chunks are:
19
+ faster loading,
20
+ protecting source code from accidental user changes,
21
+ and
22
+ off-line syntax checking.
23
+ .LP
24
+ Pre-compiling does not imply faster execution
25
+ because in Lua chunks are always compiled into bytecodes before being executed.
26
+ .B luac
27
+ simply allows those bytecodes to be saved in a file for later execution.
28
+ .LP
29
+ Pre-compiled chunks are not necessarily smaller than the corresponding source.
30
+ The main goal in pre-compiling is faster loading.
31
+ .LP
32
+ The binary files created by
33
+ .B luac
34
+ are portable only among architectures with the same word size and byte order.
35
+ .LP
36
+ .B luac
37
+ produces a single output file containing the bytecodes
38
+ for all source files given.
39
+ By default,
40
+ the output file is named
41
+ .BR luac.out ,
42
+ but you can change this with the
43
+ .B \-o
44
+ option.
45
+ .LP
46
+ In the command line,
47
+ you can mix
48
+ text files containing Lua source and
49
+ binary files containing precompiled chunks.
50
+ This is useful to combine several precompiled chunks,
51
+ even from different (but compatible) platforms,
52
+ into a single precompiled chunk.
53
+ .LP
54
+ You can use
55
+ .B "'\-'"
56
+ to indicate the standard input as a source file
57
+ and
58
+ .B "'\--'"
59
+ to signal the end of options
60
+ (that is,
61
+ all remaining arguments will be treated as files even if they start with
62
+ .BR "'\-'" ).
63
+ .LP
64
+ The internal format of the binary files produced by
65
+ .B luac
66
+ is likely to change when a new version of Lua is released.
67
+ So,
68
+ save the source files of all Lua programs that you precompile.
69
+ .LP
70
+ .SH OPTIONS
71
+ Options must be separate.
72
+ .TP
73
+ .B \-l
74
+ produce a listing of the compiled bytecode for Lua's virtual machine.
75
+ Listing bytecodes is useful to learn about Lua's virtual machine.
76
+ If no files are given, then
77
+ .B luac
78
+ loads
79
+ .B luac.out
80
+ and lists its contents.
81
+ .TP
82
+ .BI \-o " file"
83
+ output to
84
+ .IR file ,
85
+ instead of the default
86
+ .BR luac.out .
87
+ (You can use
88
+ .B "'\-'"
89
+ for standard output,
90
+ but not on platforms that open standard output in text mode.)
91
+ The output file may be a source file because
92
+ all files are loaded before the output file is written.
93
+ Be careful not to overwrite precious files.
94
+ .TP
95
+ .B \-p
96
+ load files but do not generate any output file.
97
+ Used mainly for syntax checking and for testing precompiled chunks:
98
+ corrupted files will probably generate errors when loaded.
99
+ Lua always performs a thorough integrity test on precompiled chunks.
100
+ Bytecode that passes this test is completely safe,
101
+ in the sense that it will not break the interpreter.
102
+ However,
103
+ there is no guarantee that such code does anything sensible.
104
+ (None can be given, because the halting problem is unsolvable.)
105
+ If no files are given, then
106
+ .B luac
107
+ loads
108
+ .B luac.out
109
+ and tests its contents.
110
+ No messages are displayed if the file passes the integrity test.
111
+ .TP
112
+ .B \-s
113
+ strip debug information before writing the output file.
114
+ This saves some space in very large chunks,
115
+ but if errors occur when running a stripped chunk,
116
+ then the error messages may not contain the full information they usually do.
117
+ For instance,
118
+ line numbers and names of local variables are lost.
119
+ .TP
120
+ .B \-v
121
+ show version information.
122
+ .SH FILES
123
+ .TP 15
124
+ .B luac.out
125
+ default output file
126
+ .SH "SEE ALSO"
127
+ .BR lua (1)
128
+ .br
129
+ http://www.lua.org/
130
+ .SH DIAGNOSTICS
131
+ Error messages should be self explanatory.
132
+ .SH AUTHORS
133
+ L. H. de Figueiredo,
134
+ R. Ierusalimschy and
135
+ W. Celes
136
+ .\" EOF
@@ -0,0 +1,145 @@
1
+ <!-- $Id: luac.man,v 1.28 2006/01/06 16:03:34 lhf Exp $ -->
2
+ <HTML>
3
+ <HEAD>
4
+ <TITLE>LUAC man page</TITLE>
5
+ <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
6
+ </HEAD>
7
+
8
+ <BODY BGCOLOR="#FFFFFF">
9
+
10
+ <H2>NAME</H2>
11
+ luac - Lua compiler
12
+ <H2>SYNOPSIS</H2>
13
+ <B>luac</B>
14
+ [
15
+ <I>options</I>
16
+ ] [
17
+ <I>filenames</I>
18
+ ]
19
+ <H2>DESCRIPTION</H2>
20
+ <B>luac</B>
21
+ is the Lua compiler.
22
+ It translates programs written in the Lua programming language
23
+ into binary files that can be later loaded and executed.
24
+ <P>
25
+ The main advantages of precompiling chunks are:
26
+ faster loading,
27
+ protecting source code from accidental user changes,
28
+ and
29
+ off-line syntax checking.
30
+ <P>
31
+ Precompiling does not imply faster execution
32
+ because in Lua chunks are always compiled into bytecodes before being executed.
33
+ <B>luac</B>
34
+ simply allows those bytecodes to be saved in a file for later execution.
35
+ <P>
36
+ Precompiled chunks are not necessarily smaller than the corresponding source.
37
+ The main goal in precompiling is faster loading.
38
+ <P>
39
+ The binary files created by
40
+ <B>luac</B>
41
+ are portable only among architectures with the same word size and byte order.
42
+ <P>
43
+ <B>luac</B>
44
+ produces a single output file containing the bytecodes
45
+ for all source files given.
46
+ By default,
47
+ the output file is named
48
+ <B>luac.out</B>,
49
+ but you can change this with the
50
+ <B>-o</B>
51
+ option.
52
+ <P>
53
+ In the command line,
54
+ you can mix
55
+ text files containing Lua source and
56
+ binary files containing precompiled chunks.
57
+ This is useful because several precompiled chunks,
58
+ even from different (but compatible) platforms,
59
+ can be combined into a single precompiled chunk.
60
+ <P>
61
+ You can use
62
+ <B>'-'</B>
63
+ to indicate the standard input as a source file
64
+ and
65
+ <B>'--'</B>
66
+ to signal the end of options
67
+ (that is,
68
+ all remaining arguments will be treated as files even if they start with
69
+ <B>'-'</B>).
70
+ <P>
71
+ The internal format of the binary files produced by
72
+ <B>luac</B>
73
+ is likely to change when a new version of Lua is released.
74
+ So,
75
+ save the source files of all Lua programs that you precompile.
76
+ <P>
77
+ <H2>OPTIONS</H2>
78
+ Options must be separate.
79
+ <P>
80
+ <B>-l</B>
81
+ produce a listing of the compiled bytecode for Lua's virtual machine.
82
+ Listing bytecodes is useful to learn about Lua's virtual machine.
83
+ If no files are given, then
84
+ <B>luac</B>
85
+ loads
86
+ <B>luac.out</B>
87
+ and lists its contents.
88
+ <P>
89
+ <B>-o </B><I>file</I>
90
+ output to
91
+ <I>file</I>,
92
+ instead of the default
93
+ <B>luac.out</B>.
94
+ (You can use
95
+ <B>'-'</B>
96
+ for standard output,
97
+ but not on platforms that open standard output in text mode.)
98
+ The output file may be a source file because
99
+ all files are loaded before the output file is written.
100
+ Be careful not to overwrite precious files.
101
+ <P>
102
+ <B>-p</B>
103
+ load files but do not generate any output file.
104
+ Used mainly for syntax checking and for testing precompiled chunks:
105
+ corrupted files will probably generate errors when loaded.
106
+ Lua always performs a thorough integrity test on precompiled chunks.
107
+ Bytecode that passes this test is completely safe,
108
+ in the sense that it will not break the interpreter.
109
+ However,
110
+ there is no guarantee that such code does anything sensible.
111
+ (None can be given, because the halting problem is unsolvable.)
112
+ If no files are given, then
113
+ <B>luac</B>
114
+ loads
115
+ <B>luac.out</B>
116
+ and tests its contents.
117
+ No messages are displayed if the file passes the integrity test.
118
+ <P>
119
+ <B>-s</B>
120
+ strip debug information before writing the output file.
121
+ This saves some space in very large chunks,
122
+ but if errors occur when running a stripped chunk,
123
+ then the error messages may not contain the full information they usually do.
124
+ For instance,
125
+ line numbers and names of local variables are lost.
126
+ <P>
127
+ <B>-v</B>
128
+ show version information.
129
+ <H2>FILES</H2>
130
+ <P>
131
+ <B>luac.out</B>
132
+ default output file
133
+ <H2>SEE ALSO</H2>
134
+ <B>lua</B>(1)
135
+ <BR>
136
+ <A HREF="http://www.lua.org/">http://www.lua.org/</A>
137
+ <H2>DIAGNOSTICS</H2>
138
+ Error messages should be self explanatory.
139
+ <H2>AUTHORS</H2>
140
+ L. H. de Figueiredo,
141
+ R. Ierusalimschy and
142
+ W. Celes
143
+ <!-- EOF -->
144
+ </BODY>
145
+ </HTML>
@@ -0,0 +1,13 @@
1
+ h3 code {
2
+ font-family: inherit ;
3
+ }
4
+
5
+ pre {
6
+ font-size: 105% ;
7
+ }
8
+
9
+ span.apii {
10
+ float: right ;
11
+ font-family: inherit ;
12
+ }
13
+