2023-03-10 04:33:58 +00:00
|
|
|
main = func($$args){
|
2023-06-08 18:14:35 +00:00
|
|
|
|
|
|
|
____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;
|
|
|
|
}
|
2023-03-10 04:33:58 +00:00
|
|
|
if(fs.file_exists(args[0]))
|
|
|
|
{
|
2023-06-08 18:14:35 +00:00
|
|
|
code_txt = ____load(args[0]);
|
|
|
|
|
|
|
|
|
|
|
|
code=reflection.parse_code(code_txt);
|
|
|
|
for(i = 1;i<args.length;i++)
|
|
|
|
{
|
|
|
|
code.args.add(args[i]);
|
|
|
|
}
|
2023-03-10 04:33:58 +00:00
|
|
|
code.run();
|
2023-06-08 18:14:35 +00:00
|
|
|
}else{
|
|
|
|
console.writeln("tlang <app.tlang,code_files.txt>");
|
2023-03-10 04:33:58 +00:00
|
|
|
}
|
|
|
|
};
|