fix(basic.gblib): Extraction of copy command in regexp.

This commit is contained in:
Rodrigo Rodriguez 2021-01-15 11:50:43 -03:00
parent 4048e724d1
commit e4be1600f0

View file

@ -289,6 +289,10 @@ export class GBVMService extends GBService {
return `sendFile (step, ${$3})\n`;
});
code = code.replace(/(COPY)(\s*)(.*)/gi, ($0, $1, $2, $3) => {
return `sys().copyFile (step, ${$3})\n`;
});
code = code.replace(/(save)(\s)(.*)/gi, ($0, $1, $2, $3) => {
return `sys().save(${$3})\n`;
});
@ -429,6 +433,9 @@ export class GBVMService extends GBService {
code = code.replace(/("[^"]*"|'[^']*')|\bsendFileTo\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.sendFileTo' : $1;
});
code = code.replace(/("[^"]*"|'[^']*')|\bcopyFile\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.copyFile' : $1;
});
code = code.replace(/("[^"]*"|'[^']*')|\bsendFile\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.sendFile' : $1;
});