feat: sync all remaining python source board configurations

This commit is contained in:
yczpf2019
2026-01-24 16:19:55 +08:00
parent 1990bee9a1
commit 20bde81bbb
519 changed files with 93119 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
'use strict';
pbc.globalFunctionD['exit'] = function (py2block, func, args, keywords, starargs, kwargs, node) {
if (args.length != 0) {
throw new Error("Incorrect number of arguments");
}
return [block("controls_end_program", func.lineno, {}, {}, {
"inline": "true"
})];
}
pbc.moduleFunctionD.get('time')['time'] = function(py2block, func, args, keywords, starargs, kwargs, node) {
if (args.length != 0) {
throw new Error("Incorrect number of arguments");
}
return block("controls_millis", func.lineno, {}, {}, {
"inline": "true"
});
}
pbc.moduleFunctionD.get('time')['localtime'] = function(py2block, func, args, keywords, starargs, kwargs, node) {
if (args.length != 0) {
throw new Error("Incorrect number of arguments");
}
return block("time_localtime", func.lineno, {
"op":'all'
}, {}, {
"inline": "true"
});
}
pbc.moduleFunctionD.get('time')['sleep'] = function(py2block, func, args, keywords, starargs, kwargs, node) {
if (args.length != 1) {
throw new Error("Incorrect number of arguments");
}
var argblock = py2block.convert(args[0]);
return [block("time_sleep", func.lineno, {}, {
"DELAY_TIME":argblock
}, {
"inline": "true"
})];
}