Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "<luafile>: contains no items" #258

Closed
ghost opened this issue Dec 18, 2016 · 7 comments · Fixed by #396
Closed

Getting "<luafile>: contains no items" #258

ghost opened this issue Dec 18, 2016 · 7 comments · Fixed by #396
Assignees

Comments

@ghost
Copy link

ghost commented Dec 18, 2016

I am trying to generate a documentation for https://github.com/FAForever/fa/tree/develop/lua

To do so I am running from within E:\git\faforever\fa

ldoc lua -d E:\git\faforever\fa-lua-doc\

but all I get is:

e:\git\faforever\fa\lua\aeon_naval_weapons.lua:1: contains no items
output written to e:\git\faforever\fa-lua-doc\aeon

However, I can generate documentation for other sub-directories without problems e.g.

ldoc lua\AI -d E:\git\faforever\fa-lua-doc\AI

works without troubles.

I'd like to generate a documentation for the whole lua\ directory. How can I make ldoc simply run over all files and ignore whether there are items or not? Is that possible?

Running it for the entire directory ldoc lua -d E:\git\faforever\fa-lua-doc\ will parse only through the first directory but then stop without a warning or anything. These are the last few lines before ldoc terminates:

...
e:\git\faforever\fa\lua\ai\platoontemplates\seaplatoontemplatessorian.lua:42: empty file
e:\git\faforever\fa\lua\ai\platoontemplates\structureplatoontemplatessorian.lua:105: empty file
e:\git\faforever\fa\lua\ai\aiarchetype-managerloader.lua:202: empty file
e:\git\faforever\fa\lua\ai\aibuildstructures.lua:658: empty file
e:\git\faforever\fa\lua\ai\sorianlang.lua:318: empty file
...
e:\git\faforever\fa\lua\aibrain.lua:2301: definition cannot be parsed - not 'name=value' or 'return value'
e:\git\faforever\fa\lua\aibrain.lua:3475: definition cannot be parsed - not 'name=value' or 'return value'
e:\git\faforever\fa\lua\aibrain.lua:852: VOSounds: 'VOSounds' had no return?

Stefan@STEFAN-PC E:\git\faforever

No message or reason why it terminated without producing anything :/

@stevedonovan
Copy link
Contributor

Oh, just terminating is not good! I see you have the docs in another repo, but

git clone  https://github.com/FAForever/fa-lua-doc

Fails to pull? Is it public? I don't see it in your repo list.

Basically need to see the config.ld and work from there...

(Pretty cool project, BTW)

@ghost
Copy link
Author

ghost commented Dec 19, 2016

Hi! The repository would be https://github.com/FAForever/fa.git, but I've already fixed it.

It turns out that the last line where VOSounds was declared looked like this:

--------------------------------------------------------------------------
---- ---------- System for playing VOs to the Player --------
--------------------------------------------------------------------------
VOSounds = {
}

and LDoc simply didn't like that - so it stopped there. The thing is just that there was not explicit error message like, "Error in line 852; Please fix this" or something which is why I didn't think it could be just a malformed comment or whatever made LDoc stumble here.

I don't know if it's possible but maybe prompting an error message would help in such cases.

BR;

@stevedonovan
Copy link
Contributor

We must definitely have an error there! Thanks, I think you've found a bug.

@ghost
Copy link
Author

ghost commented Dec 19, 2016

You're welcome! Thanks for keeping LDoc up! 👍

@alerque
Copy link
Member

alerque commented May 4, 2023

@lionkor You mentioned you had or could work up a fix for this issue. Is that still something you can submit?

@alerque alerque added the help-wanted PRs welcome! label May 4, 2023
@lionkor
Copy link
Contributor

lionkor commented May 4, 2023

I can take a look, yeah, but I dont have a fix ready yet

@alerque alerque removed the help-wanted PRs welcome! label May 4, 2023
@lionkor
Copy link
Contributor

lionkor commented May 5, 2023

I could not reproduce it with the fa code above, but I was able to reproduce it with this:

--- my function
-- takes nothing and returns nothing
-- @return nothing
function DoNothing()
end

--
Thing = {
}

the output is

reading configuration from /home/lion/src/xyz/config.ld
/home/lion/src/xyz/main.lua:1: contains no items
format: using built-in markdown
output written to /home/lion/src/xyz/public

lionkor added a commit to lionkor/ldoc that referenced this issue May 5, 2023
…ixes lunarmodules#258)

If `search_for_token` does not find a `module` token, t is nil, and t is
returned instead of the original t.

This is an issue, because it causes a branch in `parse.lua` to
erroneously be executed, which exits the entire parsing process with the
warning `contains no items`, even if items are left (because the
original t was scrubbed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants