Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhvanitmonpara committed Dec 10, 2024
1 parent 64fd842 commit 39463a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions gjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import runRepl from "./gjs/runRepl.js"
function main() {
const args = process.argv.slice(2);

let debug = {status: false};
let debug = { status: false, processing: false, errors: false, whitespace: false };
let fileName = null;
let showVersion = false;
let showHelp = false;

// Parse arguments
args.forEach((arg) => {
if (arg === '--gjs-debug') {
debug = {status: true, processing: true, errors: true, whitespace: false};
} else if(arg === '--gjs-debug-ws') {
debug = {status: true, processing: true, errors: true, whitespace: true};
}else if (arg === '--version') {
debug = { status: true, processing: true, errors: true, whitespace: false };
} else if (arg === '--gjs-debug-ws') {
debug = { status: true, processing: true, errors: true, whitespace: true };
} else if (arg === '--version') {
showVersion = true;
} else if (arg === '--help') {
showHelp = true;
Expand All @@ -27,7 +27,7 @@ function main() {

// Show version if '--version' flag is provided
if (showVersion) {
console.log("GujjuScript version 1.0.5");
console.log("GujjuScript version 1.0.6");
return;
}

Expand All @@ -37,17 +37,18 @@ function main() {
Usage: gujju [options] [file]
Options:
-debug Enable debugging mode
--version Show version information
--help Show this help message
--debug-gjs Enable debugging mode for gujjuScript
--debug-gjs-ws Enable debugging mode for gujjuScript with whitespace count
--version Show version information
--help Show this help message
If no file is provided, the REPL will start.
`);
return;
}

// Enable debugging if '-debug' flag is present
if (debug) {
if (debug.status) {
console.log("Debugging mode activated.");
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gujjuscript",
"version": "1.0.5",
"version": "1.0.6",
"description": "A simple programming language implementation",
"main": "gjs.js",
"type": "module",
Expand Down

0 comments on commit 39463a0

Please sign in to comment.