Nmap Development mailing list archives

Re: Completed Lua 5.3 upgrade!


From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 7 Jul 2016 17:26:42 -0500

Patrick,

These changes temporarily broke nsedoc generation. The specific issue I'm
running into is detection of a file's "module" status, which we previously
did with this chunk of Lua 5.1 code:

    -- module"x.y"
    -- module'x.y'
    local _, m1 = string.match(line, "^%s*module%s*([\"'])(.-[^\\])%1");
    -- module[[x.y]]
    local _, m2 = string.match(line, "^%s*module%s*%[(=*)%[(.-)%]%1%]");
    -- module([... or ]"x.y")
    -- module([... or ]'x.y')
    local _, m3 = string.match(line, "^%s*module%s*%(.-([\"'])(.-[^\\])%1");
    -- module([... or ][[x.y]])
    local _, m4 = string.match(line, "^%s*module%s*%(.-%[(=*)%[(.-)%]%1%]");
    -- module(...)
    local _, m5 = string.match(line, "^%s*module%s*%(%s*%.%.%.%s*[,%)]");
    -- _ENV = stdnse.module("name"
    local _, m6 = string.match(line,
"^%s*_ENV%s*=%s*stdnse%s*%.%s*module%s*%(?%s*([\"'])(.-[^\\])%1");
    -- _ENV = require "stdnse".module "base32"
    local _, _, m7 = string.match(line,
"^%s*_ENV%s*=%s*require%s*([\"'])stdnse%1%s*%.%s*module%s*%(?%s*([\"'])(.-[^\\])%2");

    local modulename = m1 or m2 or m3 or m4 or m5 or m6 or m7;

I actually added that last one (m7) because of the syntax you used in
base32.lua. But so far it appears the libraries bin, bit, and bits all do
not use stdnse.module. I found a workaround by using the "@class module"
and "@name" NSEdoc tags, but I wanted to know more about stdnse.module and
stdnse.seeall. These are documented as "mimicking" the behavior of Lua 5.1,
but are we using any of this behavior? Could all libs be converted to just
returning _ENV and using @class and @name tags?

Dan

On Sat, Jul 2, 2016 at 12:06 PM, Patrick Donnelly <batrick () batbytes com>
wrote:

On Sun, Jun 26, 2016 at 4:53 PM, Patrick Donnelly <batrick () batbytes com>
wrote:
On Sat, Jun 25, 2016 at 1:25 PM, Patrick Donnelly <batrick () batbytes com>
wrote:
On Fri, Jun 17, 2016 at 8:43 PM, Patrick Donnelly <batrick () batbytes com>
wrote:
On Wed, Jun 8, 2016 at 9:31 PM, Patrick Donnelly <batrick () batbytes com>
wrote:
Without further ado, here's the branch:

https://github.com/batrick/nmap/tree/nse-lua53

If there are no questions/comments/complaints/objections, I'd like to
merge the branch sometime around next Friday. All feedback is still
welcome!

I've incorporated Daniel's suggestions. The branch is now in svn:
https://svn.nmap.org/nmap-exp/patrick/nse-lua53

Last call for comments. I plan to merge into /nmap tomorrow.

Alright, I've resolved all of the reported problems. I will give the
branch another few days to cool before merging. Please keep testing
everyone!

Merged in https://svn.nmap.org/nmap@35945.

--
Patrick Donnelly
_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: