Defined but undefined type. in Developer Help
|
|
Code:
computer_directory parent_type = /datum var name = "" list contents = list()
computer_file var name = "" contents = ""
program proc/RunCode() var n_scriptOptions/nS_Options/options = new() n_Scanner/nS_Scanner/scanner = new (contents, options) list/tokens = scanner.Scan() n_Parser/nS_Parser/parser = new (tokens, options) node/block/GlobalBlock/P = parser.Parse() n_Interpreter/interpreter
if(scanner.errors.len || parser.errors.len) return -1 interpreter = new (program=P) interpreter.Run() return 1
computer_directory/root name = "root"
|
Problem description:
I am trying to make a game with a command line interface similar to Console and plan on using Nickr5's Scripting library for the programming side of things however I run into the following error that doesn't make sense to me when attempting to compile this file:
computer\system.dm:26:error: P: undefined type: P computer\system.dm:21:warning: P: variable defined but not used
Both lines are marked in the above code snippet.
Please help if you can.
|
I think the way the library is designed right now isn't great because the code you need to run even a simple script is ugly and overcomplicated. I'd like to update it sometime soon and would love any advice you have on how to maker it less of a pain. In the future, since it looks like people might actually be using the library now, I'll try to keep everything up to date and avoid breaking backwards-compatibility when possible.