Skip to content

Commit 82e6b70

Browse files
Fixed the File Extension Issue
1 parent 40d1bf8 commit 82e6b70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

peth_run.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function randomize(str=""){
3434
return str.split("").sort(() => {return Math.random() - 0.5}).join("");
3535
}
3636

37-
let fileName = process.argv[2]+".pet"; // initialize the filename from the script call from the CLI
37+
let fileName = process.argv[2]+".peth"; // initialize the filename from the script call from the CLI
3838
let filePath = path.join(process.cwd(),"src/"+fileName); //initialize the filepath by merging the path of the current working directory and the provided file
39-
let varFileName = process.argv[2]+".vpet"; // initialize the variable filename from the script call from the CLI
39+
let varFileName = process.argv[2]+".vpeth"; // initialize the variable filename from the script call from the CLI
4040
let varFilePath = path.join(process.cwd(),"src/"+varFileName); //initialize the variable filepath by merging the path of the current working directory and the provided file
4141

4242
let vars = {}; // initialize an object to store the variables
@@ -84,10 +84,10 @@ if(fs.existsSync(varFilePath)){ // if a file with the path in 'varFilePath' exis
8484
}
8585
}
8686

87-
let lineStructure1 = /^\s*peththa \? (keep|repeat|reverse|jumble|rotateR|rotateL) : bath \? (str|int|bigInt) : kawada \? (\d+|".+"|\([a-zA-Z]\w+\)) \[(log|store)\]( {\d+})?$/; // 1st regex for valid line structure in .pth file
88-
let lineStructure2 = /^\s*<(keep|repeat|reverse|jumble|rotateR|rotateL)> \[(log|store)\]( {\d+})?$/; // 2nd regex for valid line structure in .pth file
89-
let emptyLine = /^(|\s+)$/; // regex for an empty line in .pth file
90-
let commentedLine = /^###.+$/; // regex for a commented line in .pth file
87+
let lineStructure1 = /^\s*peththa \? (keep|repeat|reverse|jumble|rotateR|rotateL) : bath \? (str|int|bigInt) : kawada \? (\d+|".+"|\([a-zA-Z]\w+\)) \[(log|store)\]( {\d+})?$/; // 1st regex for valid line structure in .peth file
88+
let lineStructure2 = /^\s*<(keep|repeat|reverse|jumble|rotateR|rotateL)> \[(log|store)\]( {\d+})?$/; // 2nd regex for valid line structure in .peth file
89+
let emptyLine = /^(|\s+)$/; // regex for an empty line in .peth file
90+
let commentedLine = /^###.+$/; // regex for a commented line in .peth file
9191

9292
if(fs.existsSync(filePath) && varErrState === false){ // if the file at 'filePath' exists and there was no error in processing the variables...
9393
let fileContent = fs.readFileSync(filePath,{"encoding":"utf-8"}); // get the file content

0 commit comments

Comments
 (0)