Skip to content

Commit

Permalink
fix(basic.gblib): Extraction of copy command in regexp.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jan 15, 2021
1 parent 4048e72 commit e4be160
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/basic.gblib/services/GBVMService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
});
Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit e4be160

Please sign in to comment.