diff --git a/src/runtime/globals.ts b/src/runtime/globals.ts index 8992ce6..b581b6f 100644 --- a/src/runtime/globals.ts +++ b/src/runtime/globals.ts @@ -28,8 +28,6 @@ import { unlinkSync as deleteFileSync, } from 'fs'; import path from 'path'; -import { Runtime } from 'inspector'; -import { NumericLiteral } from '../parser/ast'; export function createGlobalEnv(filename: string): Environment { const env = new Environment(); @@ -88,6 +86,15 @@ export function createGlobalEnv(filename: string): Environment { true, ); + env.declareVar( + 'hagarara', + MK_NATIVE_FN((args) => { + const exit_code = (args[0] as NumberVal).value; + process.exit(exit_code); + }), + true, + ); + // Kin mathematics utility functions env.declareVar( 'KIN_IMIBARE', diff --git a/todo.md b/todo.md deleted file mode 100644 index 57073be..0000000 --- a/todo.md +++ /dev/null @@ -1,13 +0,0 @@ -# Todo - -Support: - -- Loops control statements like continue, break to name a few. -- Stop Kin while it's running -- Recursion -- Introduce more native functions - -Methods: - -- unshift for arrays -- shift for arrays