Skip to content

Troubleshooting

Jeroen Broks edited this page Aug 4, 2020 · 5 revisions

A few things that can go wrong while using Neil

Error: "No API has been set up to read entire directories!"

This can mostly happen when you import entire bundles with the '#use' or 'Neil.Use' instructions... What is important to note is that Lua does by default NOT support reading entire directories, and since Neil has to work in any engine supporting Lua, I could not offer any default support for this either. The reason why Lua doesn't support is is because Lua has been set up to be compiled in any C compiler, and there is no standard library for this in C, and when compilers have libraries for that they can differ from what other compilers offer, and thus not to spook up Lua, offering no support was the only way to go. The engine in which Neil is running will therefore have to offer this support. If you can from that API create a function which returns an array based table that lists out all files recursively assign that function to Neil.ReadDir Neil can do what it has to do.

The Neil.DirExists() function always returns "false"

By default this will happen, and that is for the same reason as the issue above. It would take features standard C does not provide, and Lua was set up to be compiled in standard C without the need of any 3rd party libraries. In order to prevent needless crashes I've set the default function to return "false" only... You will have to write your own API and attach that to Lua and Neil.

Issues with multi-line strings and comments

Neil DOES support multi-line strings and comments. Multi-line strings are just the same as in Lua... Just use the normal Lua markings (can put them here as GitHub messes that up) to open them and to close them. Multi-line comments work the same as in C, thus /* to open them and */ to close them. Using them is strongly discouraged unless you know what you are doing. The Neil lexer doesn't like these, and can mess things up for you. The trouble will most of all occur when debugging though. Line numbers tied to run-time errors will very likely come out faulty. This is not an issue planned to be addressed, at least not at the short term.