From 133922f5c2311736c32bf1de5b9888510e41cb28 Mon Sep 17 00:00:00 2001 From: Robert-M-Lucas Date: Sun, 16 Jun 2024 18:25:10 +0100 Subject: [PATCH] Printing and function calls --- .idea/workspace.xml | 68 ++++---- build/out.asm | 145 ++++++++++++++++-- build/out.o | Bin 688 -> 1712 bytes build/out.out | Bin 16512 -> 16768 bytes main.why | 22 ++- src/root/builtin/functions/mod.rs | 0 src/root/builtin/mod.rs | 21 ++- src/root/builtin/{ => types}/int/add.rs | 8 +- src/root/builtin/{ => types}/int/mod.rs | 17 +- src/root/builtin/types/int/p_sub.rs | 45 ++++++ src/root/builtin/types/int/printi.rs | 64 ++++++++ src/root/builtin/{ => types}/int/sub.rs | 8 +- src/root/builtin/types/mod.rs | 1 + src/root/compiler/assembly/utils.rs | 12 -- src/root/compiler/compile.rs | 21 ++- src/root/compiler/compile_evaluable.rs | 112 ++++++++++---- src/root/compiler/compile_function.rs | 27 ++-- src/root/compiler/compile_function_call.rs | 17 +- src/root/compiler/global_tracker.rs | 32 ++++ src/root/compiler/mod.rs | 3 +- .../parser/parse_function/parse_literal.rs | 2 +- src/root/shared/common.rs | 14 ++ types.toml | 7 + 23 files changed, 505 insertions(+), 141 deletions(-) create mode 100644 src/root/builtin/functions/mod.rs rename src/root/builtin/{ => types}/int/add.rs (90%) rename src/root/builtin/{ => types}/int/mod.rs (74%) create mode 100644 src/root/builtin/types/int/p_sub.rs create mode 100644 src/root/builtin/types/int/printi.rs rename src/root/builtin/{ => types}/int/sub.rs (90%) create mode 100644 src/root/builtin/types/mod.rs create mode 100644 src/root/compiler/global_tracker.rs diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a777d00..ff2ef1e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,22 +8,28 @@ - + + + + + - - + + + + + + - - - - - - + + + + - { + "keyToString": { + "Cargo.Run whython-8.executor": "Run", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.rust.reset.selective.auto.import": "true", + "git-widget-placeholder": "master", + "ignore.virus.scanning.warn.message": "true", + "last_opened_file_path": "/home/robertlucas/RustroverProjects/whython-8/src/root/builtin/int", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true", + "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "", + "org.rust.first.attach.projects": "true", + "settings.editor.selected.configurable": "preferences.pluginManager", + "vue.rearranger.settings.migration": "true" } -}]]> +} + + @@ -180,6 +188,8 @@ + +