aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-23 14:56:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-23 14:56:42 -0300
commit664da61c079f762d835ea6f875cdf3da96982bab (patch)
tree0acb6ddebd549b1efea9c875b641be02c75d6221
parent8bc00db24975f52b52e6ef8184c216ce2feae9fd (diff)
downloadlpeg-664da61c079f762d835ea6f875cdf3da96982bab.tar.gz
lpeg-664da61c079f762d835ea6f875cdf3da96982bab.tar.bz2
lpeg-664da61c079f762d835ea6f875cdf3da96982bab.zip
Copyright notice in module 're'
-rw-r--r--re.html34
-rw-r--r--re.lua10
2 files changed, 10 insertions, 34 deletions
diff --git a/re.html b/re.html
index 114d968..ddad801 100644
--- a/re.html
+++ b/re.html
@@ -100,7 +100,7 @@ equivalent to <code>p / defs[name]</code></td></tr>
100<tr><td><code>p =&gt; name</code></td> <td>match-time capture 100<tr><td><code>p =&gt; name</code></td> <td>match-time capture
101equivalent to <code>lpeg.Cmt(p, defs[name])</code></td></tr> 101equivalent to <code>lpeg.Cmt(p, defs[name])</code></td></tr>
102<tr><td><code>p ~&gt; name</code></td> <td>fold capture 102<tr><td><code>p ~&gt; name</code></td> <td>fold capture
103equivalent to <code>lpeg.Cf(p, defs[name])</code></td></tr> 103(deprecated)</td></tr>
104<tr><td><code>p &gt;&gt; name</code></td> <td>accumulator capture 104<tr><td><code>p &gt;&gt; name</code></td> <td>accumulator capture
105equivalent to <code>(p % defs[name])</code></td></tr> 105equivalent to <code>(p % defs[name])</code></td></tr>
106</tbody></table> 106</tbody></table>
@@ -458,37 +458,9 @@ print(re.match(p, p)) -- a self description must match itself
458<h2><a name="license">License</a></h2> 458<h2><a name="license">License</a></h2>
459 459
460<p> 460<p>
461Copyright &copy; 2008-2023 Lua.org, PUC-Rio. 461This module is part of the <a href="lpeg.html">LPeg</a> package and shares
462</p> 462its <a href="lpeg.html#license">license</a>.
463<p>
464Permission is hereby granted, free of charge,
465to any person obtaining a copy of this software and
466associated documentation files (the "Software"),
467to deal in the Software without restriction,
468including without limitation the rights to use,
469copy, modify, merge, publish, distribute, sublicense,
470and/or sell copies of the Software,
471and to permit persons to whom the Software is
472furnished to do so,
473subject to the following conditions:
474</p>
475
476<p>
477The above copyright notice and this permission notice
478shall be included in all copies or substantial portions of the Software.
479</p>
480 463
481<p>
482THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
483EXPRESS OR IMPLIED,
484INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
485FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
486IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
487DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
488TORT OR OTHERWISE, ARISING FROM,
489OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
490THE SOFTWARE.
491</p>
492 464
493</div> <!-- id="content" --> 465</div> <!-- id="content" -->
494 466
diff --git a/re.lua b/re.lua
index 5044e9e..1fb9fa9 100644
--- a/re.lua
+++ b/re.lua
@@ -1,3 +1,7 @@
1--
2-- Copyright 2007-2023, Lua.org & PUC-Rio (see 'lpeg.html' for license)
3-- written by Roberto Ierusalimschy
4--
1 5
2-- imported functions and modules 6-- imported functions and modules
3local tonumber, type, print, error = tonumber, type, print, error 7local tonumber, type, print, error = tonumber, type, print, error
@@ -9,14 +13,14 @@ local m = require"lpeg"
9-- on 'mm' 13-- on 'mm'
10local mm = m 14local mm = m
11 15
12-- pattern's metatable 16-- patterns' metatable
13local mt = getmetatable(mm.P(0)) 17local mt = getmetatable(mm.P(0))
14 18
15 19
20local version = _VERSION
16 21
17-- No more global accesses after this point 22-- No more global accesses after this point
18local version = _VERSION 23_ENV = nil -- does no harm in Lua 5.1
19if version == "Lua 5.2" then _ENV = nil end
20 24
21 25
22local any = m.P(1) 26local any = m.P(1)