tlang-interperter-cs/tlanglib/launcher/launcher.tlang

35 lines
866 B
Plaintext

main = func($$args){
____load = func(file)
{
___code_txt="";
if(file.endsWith(".txt"))
{
each(fs.readalltext(file).split('\n'))
{
___code_txt = ___code_txt + ____load(fs.relative_to_parent_of(file,item)) + "\n";
}
}else{
if(!fs.file_exists(file)) console.writeln("WARN: " + file + " Does not exist");
___code_txt=fs.readalltext(file);
}
___code_txt;
}
if(fs.file_exists(args[0]))
{
code_txt = ____load(args[0]);
code=reflection.parse_code(code_txt);
for(i = 1;i<args.length;i++)
{
code.args.add(args[i]);
}
code.run();
}else{
console.writeln("tlang <app.tlang,code_files.txt>");
}
};