diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024,_15_37_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024,_15_37_[Changes]/shelved.patch
deleted file mode 100644
index 9f1e4c7..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024,_15_37_[Changes]/shelved.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-Index: .idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch
-===================================================================
-diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch
-deleted file mode 100644
---- a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch (revision a072c6e81c1091b995ab0d7dda77e8cc5c7c5f5e)
-+++ /dev/null (revision a072c6e81c1091b995ab0d7dda77e8cc5c7c5f5e)
-@@ -1,77 +0,0 @@
--Index: .idea/workspace.xml
--IDEA additional info:
--Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
--<+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n {\n "lastFilter": {\n "state": "OPEN",\n "assignee": "Robert-M-Lucas"\n }\n}\n \n \n \n {\n "selectedUrlAndAccountId": {\n "url": "https://github.com/Robert-M-Lucas/whython-8.git",\n "accountId": "dcb8df19-0b39-47e1-9073-4a54f7034be8"\n }\n}\n \n \n \n \n \n \n {\n "customColor": "",\n "associatedIndex": 4\n}\n \n \n \n \n \n {\n "keyToString": {\n "Cargo.Build `Run whython-8`.executor": "Run",\n "Cargo.Run whython-8.executor": "Run",\n "Cargo.Test whython-8.executor": "Run",\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "RunOnceActivity.rust.reset.selective.auto.import": "true",\n "Shell Script.Test Asm.executor": "Run",\n "git-widget-placeholder": "master",\n "ignore.virus.scanning.warn.message": "true",\n "last_opened_file_path": "/home/robertlucas/RustroverProjects/trace",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)",\n "nodejs_package_manager_path": "npm",\n "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",\n "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",\n "org.rust.first.attach.projects": "true",\n "settings.editor.selected.configurable": "preferences.pluginManager",\n "vue.rearranger.settings.migration": "true"\n },\n "keyToStringList": {\n "com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [\n "Rust"\n ]\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n 1714088144106\n \n \n 1714088144106\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1717469659146\n \n \n \n 1717469659146\n \n \n \n 1717473113692\n \n \n \n 1717473113692\n \n \n \n 1717473365560\n \n \n \n 1717473365560\n \n \n \n 1717562697947\n \n \n \n 1717562697947\n \n \n \n 1717570846946\n \n \n \n 1717570846946\n \n \n \n 1717572031837\n \n \n \n 1717572031837\n \n \n \n 1717578308406\n \n \n \n 1717578308406\n \n \n \n 1717598684770\n \n \n \n 1717598684770\n \n \n \n 1717599815108\n \n \n \n 1717599815108\n \n \n \n 1717614243407\n \n \n \n 1717614243407\n \n \n \n 1717614696137\n \n \n \n 1717614696137\n \n \n \n 1717677552390\n \n \n \n 1717677552390\n \n \n \n 1717684897421\n \n \n \n 1717684897422\n \n \n \n 1717705529640\n \n \n \n 1717705529640\n \n \n \n 1717769943602\n \n \n \n 1717769943602\n \n \n \n 1717794101530\n \n \n \n 1717794101530\n \n \n \n 1717794233364\n \n \n \n 1717794233364\n \n \n \n 1717794747334\n \n \n \n 1717794747334\n \n \n \n 1717819316020\n \n \n \n 1717819316020\n \n \n \n 1717826853448\n \n \n \n 1717826853448\n \n \n \n 1718558711741\n \n \n \n 1718558711741\n \n \n \n 1718558898901\n \n \n \n 1718558898901\n \n \n \n 1718636633009\n \n \n \n 1718636633009\n \n \n \n 1718798005819\n \n \n \n 1718798005819\n \n \n \n 1718798188305\n \n \n \n 1718798188305\n \n \n \n 1718799244388\n \n \n \n 1718799244388\n \n \n \n 1718803787262\n \n \n \n 1718803787262\n \n \n \n 1718805301324\n \n \n \n 1718805301324\n \n \n \n 1718888868217\n \n \n \n 1718888868217\n \n \n \n 1718889832262\n \n \n \n 1718889832262\n \n \n \n 1718895358320\n \n \n \n 1718895358320\n \n \n \n 1718928037028\n \n \n \n 1718928037028\n \n \n \n 1718928163157\n \n \n \n 1718928163157\n \n \n \n 1718963722966\n \n \n \n 1718963722967\n \n \n \n 1718964303334\n \n \n \n 1718964303334\n \n \n \n 1718968546046\n \n \n \n 1718968546046\n \n \n \n 1719323220161\n \n \n \n 1719323220162\n \n \n \n 1719323378191\n \n \n \n 1719323378191\n \n \n \n 1719324580280\n \n \n \n 1719324580280\n \n \n \n 1719324945974\n \n \n \n 1719324945974\n \n \n \n 1719325143424\n \n \n \n 1719325143424\n \n \n \n 1721950132807\n \n \n \n 1721950132807\n \n \n \n 1721951605297\n \n \n \n 1721951605297\n \n \n \n 1721954057479\n \n \n \n 1721954057480\n \n \n \n 1721990519536\n \n \n \n 1721990519536\n \n \n \n 1721996703318\n \n \n \n 1721996703318\n \n \n \n 1721997307152\n \n \n \n 1721997307152\n \n \n \n 1721997775708\n \n \n \n 1721997775708\n \n \n \n 1722095029520\n \n \n \n 1722095029521\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
--Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
--<+>UTF-8
--===================================================================
--diff --git a/.idea/workspace.xml b/.idea/workspace.xml
----- a/.idea/workspace.xml (revision f39ebc39f3c1966f09766fcb00b4c79886954a55)
--+++ b/.idea/workspace.xml (date 1722117982574)
--@@ -7,11 +7,8 @@
--
--
--
---
---
---
---
---
--+
--+
--
--
--
--@@ -228,15 +225,8 @@
--
--
--
---
---
---
---
--- 1717469659146
---
---
---
--- 1717469659146
--+
--+
--
--
--
--@@ -622,7 +612,15 @@
--
-- 1722095029521
--
---
--+
--+
--+ 1722095789946
--+
--+
--+
--+ 1722095789946
--+
--+
--
--
--
--@@ -640,7 +638,6 @@
--
--
--
---
--
--
--
--@@ -665,7 +662,8 @@
--
--
--
---
--+
--+
--
--
--
-Index: .idea/workspace.xml
-IDEA additional info:
-Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
-<+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n {\n "lastFilter": {\n "state": "OPEN",\n "assignee": "Robert-M-Lucas"\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n {\n "selectedUrlAndAccountId": {\n "url": "https://github.com/Robert-M-Lucas/whython-8.git",\n "accountId": "dcb8df19-0b39-47e1-9073-4a54f7034be8"\n }\n}\n \n \n \n \n \n \n {\n "customColor": "",\n "associatedIndex": 4\n}\n \n \n \n \n \n {\n "keyToString": {\n "Cargo.Build `Run whython-8`.executor": "Run",\n "Cargo.Run whython-8.executor": "Run",\n "Cargo.Test whython-8.executor": "Run",\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "RunOnceActivity.rust.reset.selective.auto.import": "true",\n "Shell Script.Test Asm.executor": "Run",\n "git-widget-placeholder": "dev",\n "ignore.virus.scanning.warn.message": "true",\n "last_opened_file_path": "/home/robertlucas/RustroverProjects/whython-8",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)",\n "nodejs_package_manager_path": "npm",\n "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",\n "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",\n "org.rust.first.attach.projects": "true",\n "settings.editor.selected.configurable": "language.rust.cargo.check",\n "vue.rearranger.settings.migration": "true"\n },\n "keyToStringList": {\n "com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [\n "Rust"\n ]\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n 1714088144106\n \n \n 1714088144106\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1717794747334\n \n \n \n 1717794747334\n \n \n \n 1717819316020\n \n \n \n 1717819316020\n \n \n \n 1717826853448\n \n \n \n 1717826853448\n \n \n \n 1718558711741\n \n \n \n 1718558711741\n \n \n \n 1718558898901\n \n \n \n 1718558898901\n \n \n \n 1718636633009\n \n \n \n 1718636633009\n \n \n \n 1718798005819\n \n \n \n 1718798005819\n \n \n \n 1718798188305\n \n \n \n 1718798188305\n \n \n \n 1718799244388\n \n \n \n 1718799244388\n \n \n \n 1718803787262\n \n \n \n 1718803787262\n \n \n \n 1718805301324\n \n \n \n 1718805301324\n \n \n \n 1718888868217\n \n \n \n 1718888868217\n \n \n \n 1718889832262\n \n \n \n 1718889832262\n \n \n \n 1718895358320\n \n \n \n 1718895358320\n \n \n \n 1718928037028\n \n \n \n 1718928037028\n \n \n \n 1718928163157\n \n \n \n 1718928163157\n \n \n \n 1718963722966\n \n \n \n 1718963722967\n \n \n \n 1718964303334\n \n \n \n 1718964303334\n \n \n \n 1718968546046\n \n \n \n 1718968546046\n \n \n \n 1719323220161\n \n \n \n 1719323220162\n \n \n \n 1719323378191\n \n \n \n 1719323378191\n \n \n \n 1719324580280\n \n \n \n 1719324580280\n \n \n \n 1719324945974\n \n \n \n 1719324945974\n \n \n \n 1719325143424\n \n \n \n 1719325143424\n \n \n \n 1721950132807\n \n \n \n 1721950132807\n \n \n \n 1721951605297\n \n \n \n 1721951605297\n \n \n \n 1721954057479\n \n \n \n 1721954057480\n \n \n \n 1721990519536\n \n \n \n 1721990519536\n \n \n \n 1721996703318\n \n \n \n 1721996703318\n \n \n \n 1721997307152\n \n \n \n 1721997307152\n \n \n \n 1721997775708\n \n \n \n 1721997775708\n \n \n \n 1722095029520\n \n \n \n 1722095029521\n \n \n \n 1722123225852\n \n \n \n 1722123225852\n \n \n \n 1722123289634\n \n \n \n 1722123289634\n \n \n \n 1722203421689\n \n \n \n 1722203421689\n \n \n \n 1722271892516\n \n \n \n 1722271892516\n \n \n \n 1722273039693\n \n \n \n 1722273039693\n \n \n \n 1722274072256\n \n \n \n 1722274072256\n \n \n \n 1722417107473\n \n \n \n 1722417107473\n \n \n \n 1722417154133\n \n \n \n 1722417154133\n \n \n \n 1722426354247\n \n \n \n 1722426354247\n \n \n \n 1722437985882\n \n \n \n 1722437985882\n \n \n \n 1722438273187\n \n \n \n 1722438273187\n \n \n \n 1722438292369\n \n \n \n 1722438292369\n \n \n \n 1722508292781\n \n \n \n 1722508292781\n \n \n \n 1722512295536\n \n \n \n 1722512295536\n \n \n \n 1722592721179\n \n \n \n 1722592721179\n \n \n \n 1722593040036\n \n \n \n 1722593040036\n \n \n \n 1722599152100\n \n \n \n 1722599152100\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
-Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-<+>UTF-8
-===================================================================
-diff --git a/.idea/workspace.xml b/.idea/workspace.xml
---- a/.idea/workspace.xml (revision a072c6e81c1091b995ab0d7dda77e8cc5c7c5f5e)
-+++ b/.idea/workspace.xml (date 1722642752537)
-@@ -7,12 +7,7 @@
-
-
-
--
--
--
--
--
--
-+
-
-
-
-@@ -275,14 +270,7 @@
-
-
-
--
--
--
-- 1717794747334
--
--
--
-- 1717794747334
-+
-
-
-
-@@ -668,7 +656,15 @@
-
- 1722599152100
-
--
-+
-+
-+ 1722640952234
-+
-+
-+
-+ 1722640952234
-+
-+
-
-
-
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024__15_37__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024__15_37__Changes_.xml
deleted file mode 100644
index 89ae3b6..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Checkout_at_06_08_2024__15_37__Changes_.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024,_15_37_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024,_15_37_[Changes]/shelved.patch
deleted file mode 100644
index 8dd88a6..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024,_15_37_[Changes]/shelved.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-Index: .idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024__23_06__Changes_.xml
-===================================================================
-diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024__23_06__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024__23_06__Changes_.xml
-deleted file mode 100644
---- a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024__23_06__Changes_.xml (revision d7abd142d3530f02bec11beab0cb81b23b907ad7)
-+++ /dev/null (revision d7abd142d3530f02bec11beab0cb81b23b907ad7)
-@@ -1,4 +0,0 @@
--
--
--
--
-\ No newline at end of file
-Index: .idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch
-===================================================================
-diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch
-deleted file mode 100644
---- a/.idea/shelf/Uncommitted_changes_before_Update_at_27_07_2024,_23_06_[Changes]/shelved.patch (revision d7abd142d3530f02bec11beab0cb81b23b907ad7)
-+++ /dev/null (revision d7abd142d3530f02bec11beab0cb81b23b907ad7)
-@@ -1,77 +0,0 @@
--Index: .idea/workspace.xml
--IDEA additional info:
--Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
--<+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n {\n "lastFilter": {\n "state": "OPEN",\n "assignee": "Robert-M-Lucas"\n }\n}\n \n \n \n {\n "selectedUrlAndAccountId": {\n "url": "https://github.com/Robert-M-Lucas/whython-8.git",\n "accountId": "dcb8df19-0b39-47e1-9073-4a54f7034be8"\n }\n}\n \n \n \n \n \n \n {\n "customColor": "",\n "associatedIndex": 4\n}\n \n \n \n \n \n {\n "keyToString": {\n "Cargo.Build `Run whython-8`.executor": "Run",\n "Cargo.Run whython-8.executor": "Run",\n "Cargo.Test whython-8.executor": "Run",\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "RunOnceActivity.rust.reset.selective.auto.import": "true",\n "Shell Script.Test Asm.executor": "Run",\n "git-widget-placeholder": "master",\n "ignore.virus.scanning.warn.message": "true",\n "last_opened_file_path": "/home/robertlucas/RustroverProjects/trace",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)",\n "nodejs_package_manager_path": "npm",\n "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",\n "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",\n "org.rust.first.attach.projects": "true",\n "settings.editor.selected.configurable": "preferences.pluginManager",\n "vue.rearranger.settings.migration": "true"\n },\n "keyToStringList": {\n "com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [\n "Rust"\n ]\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n 1714088144106\n \n \n 1714088144106\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1717469659146\n \n \n \n 1717469659146\n \n \n \n 1717473113692\n \n \n \n 1717473113692\n \n \n \n 1717473365560\n \n \n \n 1717473365560\n \n \n \n 1717562697947\n \n \n \n 1717562697947\n \n \n \n 1717570846946\n \n \n \n 1717570846946\n \n \n \n 1717572031837\n \n \n \n 1717572031837\n \n \n \n 1717578308406\n \n \n \n 1717578308406\n \n \n \n 1717598684770\n \n \n \n 1717598684770\n \n \n \n 1717599815108\n \n \n \n 1717599815108\n \n \n \n 1717614243407\n \n \n \n 1717614243407\n \n \n \n 1717614696137\n \n \n \n 1717614696137\n \n \n \n 1717677552390\n \n \n \n 1717677552390\n \n \n \n 1717684897421\n \n \n \n 1717684897422\n \n \n \n 1717705529640\n \n \n \n 1717705529640\n \n \n \n 1717769943602\n \n \n \n 1717769943602\n \n \n \n 1717794101530\n \n \n \n 1717794101530\n \n \n \n 1717794233364\n \n \n \n 1717794233364\n \n \n \n 1717794747334\n \n \n \n 1717794747334\n \n \n \n 1717819316020\n \n \n \n 1717819316020\n \n \n \n 1717826853448\n \n \n \n 1717826853448\n \n \n \n 1718558711741\n \n \n \n 1718558711741\n \n \n \n 1718558898901\n \n \n \n 1718558898901\n \n \n \n 1718636633009\n \n \n \n 1718636633009\n \n \n \n 1718798005819\n \n \n \n 1718798005819\n \n \n \n 1718798188305\n \n \n \n 1718798188305\n \n \n \n 1718799244388\n \n \n \n 1718799244388\n \n \n \n 1718803787262\n \n \n \n 1718803787262\n \n \n \n 1718805301324\n \n \n \n 1718805301324\n \n \n \n 1718888868217\n \n \n \n 1718888868217\n \n \n \n 1718889832262\n \n \n \n 1718889832262\n \n \n \n 1718895358320\n \n \n \n 1718895358320\n \n \n \n 1718928037028\n \n \n \n 1718928037028\n \n \n \n 1718928163157\n \n \n \n 1718928163157\n \n \n \n 1718963722966\n \n \n \n 1718963722967\n \n \n \n 1718964303334\n \n \n \n 1718964303334\n \n \n \n 1718968546046\n \n \n \n 1718968546046\n \n \n \n 1719323220161\n \n \n \n 1719323220162\n \n \n \n 1719323378191\n \n \n \n 1719323378191\n \n \n \n 1719324580280\n \n \n \n 1719324580280\n \n \n \n 1719324945974\n \n \n \n 1719324945974\n \n \n \n 1719325143424\n \n \n \n 1719325143424\n \n \n \n 1721950132807\n \n \n \n 1721950132807\n \n \n \n 1721951605297\n \n \n \n 1721951605297\n \n \n \n 1721954057479\n \n \n \n 1721954057480\n \n \n \n 1721990519536\n \n \n \n 1721990519536\n \n \n \n 1721996703318\n \n \n \n 1721996703318\n \n \n \n 1721997307152\n \n \n \n 1721997307152\n \n \n \n 1721997775708\n \n \n \n 1721997775708\n \n \n \n 1722095029520\n \n \n \n 1722095029521\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
--Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
--<+>UTF-8
--===================================================================
--diff --git a/.idea/workspace.xml b/.idea/workspace.xml
----- a/.idea/workspace.xml (revision f39ebc39f3c1966f09766fcb00b4c79886954a55)
--+++ b/.idea/workspace.xml (date 1722117982574)
--@@ -7,11 +7,8 @@
--
--
--
---
---
---
---
---
--+
--+
--
--
--
--@@ -228,15 +225,8 @@
--
--
--
---
---
---
---
--- 1717469659146
---
---
---
--- 1717469659146
--+
--+
--
--
--
--@@ -622,7 +612,15 @@
--
-- 1722095029521
--
---
--+
--+
--+ 1722095789946
--+
--+
--+
--+ 1722095789946
--+
--+
--
--
--
--@@ -640,7 +638,6 @@
--
--
--
---
--
--
--
--@@ -665,7 +662,8 @@
--
--
--
---
--+
--+
--
--
--
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024__15_37__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024__15_37__Changes_.xml
deleted file mode 100644
index 6ced2b3..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Update_at_06_08_2024__15_37__Changes_.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.o b/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.o
deleted file mode 100644
index 0325874..0000000
Binary files a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.o and /dev/null differ
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.out b/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.out
deleted file mode 100755
index c517ce4..0000000
Binary files a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/out.out and /dev/null differ
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/shelved.patch
deleted file mode 100644
index 2468feb..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024,_15_58_[Changes]/shelved.patch
+++ /dev/null
@@ -1,284 +0,0 @@
-Index: todo.txt
-IDEA additional info:
-Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
-<+>\n- Add array support\n - Move all Type name -> TypeRef resolution to pre-evaluation\n - Add proper size evaluation in GlobalDefinitionsTable for array types\n - Add support for arrays into UnresolvedTypeRefToken\n - Add [int; 12] / &[int; 12] parsing support into UnresolvedTypeRefToken\n - Add support for parsing array literals\n - Add evaluation support for array literals\n- Namespacing\n
-Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-<+>UTF-8
-===================================================================
-diff --git a/todo.txt b/todo.txt
---- a/todo.txt (revision 6a59973c20052dc147b44a0ab3d6d213f79b9664)
-+++ b/todo.txt (date 1722972272185)
-@@ -6,4 +6,6 @@
- - Add [int; 12] / &[int; 12] parsing support into UnresolvedTypeRefToken
- - Add support for parsing array literals
- - Add evaluation support for array literals
-+- Check for circular imports
-+- Restrict characters usable in path
- - Namespacing
-Index: .idea/workspace.xml
-IDEA additional info:
-Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
-<+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n {\n "lastFilter": {\n "state": "OPEN",\n "assignee": "Robert-M-Lucas"\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n {\n "selectedUrlAndAccountId": {\n "url": "https://github.com/Robert-M-Lucas/whython-8.git",\n "accountId": "dcb8df19-0b39-47e1-9073-4a54f7034be8"\n }\n}\n \n \n \n \n \n \n {\n "customColor": "",\n "associatedIndex": 4\n}\n \n \n \n \n \n {\n "keyToString": {\n "Cargo.Build `Run whython-8`.executor": "Run",\n "Cargo.Run whython-8.executor": "Run",\n "Cargo.Test whython-8.executor": "Run",\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "RunOnceActivity.rust.reset.selective.auto.import": "true",\n "Shell Script.Test Asm.executor": "Run",\n "git-widget-placeholder": "dev",\n "ignore.virus.scanning.warn.message": "true",\n "last_opened_file_path": "/home/robertlucas/RustroverProjects/whython-8/src/root/builtin/functions",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)",\n "nodejs_package_manager_path": "npm",\n "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true",\n "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "",\n "org.rust.first.attach.projects": "true",\n "settings.editor.selected.configurable": "language.rust.cargo.check",\n "vue.rearranger.settings.migration": "true"\n },\n "keyToStringList": {\n "com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [\n "Rust"\n ]\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n 1714088144106\n \n \n 1714088144106\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1718798188305\n \n \n \n 1718798188305\n \n \n \n 1718799244388\n \n \n \n 1718799244388\n \n \n \n 1718803787262\n \n \n \n 1718803787262\n \n \n \n 1718805301324\n \n \n \n 1718805301324\n \n \n \n 1718888868217\n \n \n \n 1718888868217\n \n \n \n 1718889832262\n \n \n \n 1718889832262\n \n \n \n 1718895358320\n \n \n \n 1718895358320\n \n \n \n 1718928037028\n \n \n \n 1718928037028\n \n \n \n 1718928163157\n \n \n \n 1718928163157\n \n \n \n 1718963722966\n \n \n \n 1718963722967\n \n \n \n 1718964303334\n \n \n \n 1718964303334\n \n \n \n 1718968546046\n \n \n \n 1718968546046\n \n \n \n 1719323220161\n \n \n \n 1719323220162\n \n \n \n 1719323378191\n \n \n \n 1719323378191\n \n \n \n 1719324580280\n \n \n \n 1719324580280\n \n \n \n 1719324945974\n \n \n \n 1719324945974\n \n \n \n 1719325143424\n \n \n \n 1719325143424\n \n \n \n 1721950132807\n \n \n \n 1721950132807\n \n \n \n 1721951605297\n \n \n \n 1721951605297\n \n \n \n 1721954057479\n \n \n \n 1721954057480\n \n \n \n 1721990519536\n \n \n \n 1721990519536\n \n \n \n 1721996703318\n \n \n \n 1721996703318\n \n \n \n 1721997307152\n \n \n \n 1721997307152\n \n \n \n 1721997775708\n \n \n \n 1721997775708\n \n \n \n 1722095029520\n \n \n \n 1722095029521\n \n \n \n 1722123225852\n \n \n \n 1722123225852\n \n \n \n 1722123289634\n \n \n \n 1722123289634\n \n \n \n 1722203421689\n \n \n \n 1722203421689\n \n \n \n 1722271892516\n \n \n \n 1722271892516\n \n \n \n 1722273039693\n \n \n \n 1722273039693\n \n \n \n 1722274072256\n \n \n \n 1722274072256\n \n \n \n 1722417107473\n \n \n \n 1722417107473\n \n \n \n 1722417154133\n \n \n \n 1722417154133\n \n \n \n 1722426354247\n \n \n \n 1722426354247\n \n \n \n 1722437985882\n \n \n \n 1722437985882\n \n \n \n 1722438273187\n \n \n \n 1722438273187\n \n \n \n 1722438292369\n \n \n \n 1722438292369\n \n \n \n 1722508292781\n \n \n \n 1722508292781\n \n \n \n 1722512295536\n \n \n \n 1722512295536\n \n \n \n 1722592721179\n \n \n \n 1722592721179\n \n \n \n 1722593040036\n \n \n \n 1722593040036\n \n \n \n 1722599152100\n \n \n \n 1722599152100\n \n \n \n 1722955321706\n \n \n \n 1722955321707\n \n \n \n 1722957672545\n \n \n \n 1722957672545\n \n \n \n 1722957687892\n \n \n \n 1722957687892\n \n \n \n 1722959111522\n \n \n \n 1722959111522\n \n \n \n 1722960033973\n \n \n \n 1722960033973\n \n \n \n 1722960050485\n \n \n \n 1722960050486\n \n \n \n 1722960060813\n \n \n \n 1722960060813\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
-Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-<+>UTF-8
-===================================================================
-diff --git a/.idea/workspace.xml b/.idea/workspace.xml
---- a/.idea/workspace.xml (revision 6a59973c20052dc147b44a0ab3d6d213f79b9664)
-+++ b/.idea/workspace.xml (date 1723042691279)
-@@ -7,14 +7,13 @@
-
-
-
--
-+
-
-
-
-
--
--
--
-+
-+
-
-
-
-@@ -278,15 +277,7 @@
-
-
-
--
--
--
--
-- 1718798188305
--
--
--
-- 1718798188305
-+
-
-
-
-@@ -672,7 +663,15 @@
-
- 1722960060813
-
--
-+
-+
-+ 1722971517828
-+
-+
-+
-+ 1722971517828
-+
-+
-
-
-
-@@ -729,7 +728,6 @@
-
-
-
--
-
-
-
-@@ -754,7 +752,8 @@
-
-
-
--
-+
-+
-
-
-
-Index: build/out.asm
-IDEA additional info:
-Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
-<+> global main\n\nsection .text\n\nmain:\n push rbp\n mov rbp, rsp\n sub rsp, 0x0000000000000018\n call _10\n add rsp, 0x0000000000000018\n mov rax, qword [rbp-24]\n mov qword [rbp-8], rax\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-32], rax\n mov qword [rbp-40], 12\n mov rax, qword [rbp-40]\n mov qword [rbp-64], rax\n mov rax, qword [rbp-32]\n mov qword [rbp-72], rax\n sub rsp, 0x0000000000000048\n call _11\n add rsp, 0x0000000000000048\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-64], rax\n mov qword [rbp-72], 7\n mov rax, qword [rbp-72]\n mov qword [rbp-96], rax\n mov rax, qword [rbp-64]\n mov qword [rbp-104], rax\n sub rsp, 0x0000000000000068\n call _11\n add rsp, 0x0000000000000068\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-96], rax\n mov qword [rbp-104], 8\n mov rax, qword [rbp-104]\n mov qword [rbp-128], rax\n mov rax, qword [rbp-96]\n mov qword [rbp-136], rax\n sub rsp, 0x0000000000000088\n call _11\n add rsp, 0x0000000000000088\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-128], rax\n mov rax, qword [rbp-128]\n mov qword [rbp-136], rax\n sub rsp, 0x0000000000000088\n call _14\n add rsp, 0x0000000000000088\n mov rdi, __42_fstr\n mov al, 0\n sub rsp, 128\n extern printf\n call printf\n add rsp, 128\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-144], rax\n mov qword [rbp-152], 1\n mov rax, qword [rbp-152]\n mov qword [rbp-176], rax\n mov rax, qword [rbp-144]\n mov qword [rbp-184], rax\n sub rsp, 0x00000000000000b8\n call _12\n add rsp, 0x00000000000000b8\n mov rax, qword [rbp-168]\n mov qword [rbp-136], rax\n mov rdi, __8_fstr\n mov rsi, [rbp-136]\n mov al, 0\n sub rsp, 168\n extern printf\n call printf\n add rsp, 168\n mov rdi, __42_fstr\n mov al, 0\n sub rsp, 168\n extern printf\n call printf\n add rsp, 168\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-184], rax\n mov rax, qword [rbp-184]\n mov qword [rbp-200], rax\n sub rsp, 0x00000000000000c8\n call _13\n add rsp, 0x00000000000000c8\n mov rax, qword [rbp-192]\n mov qword [rbp-176], rax\n mov rdi, __8_fstr\n mov rsi, [rbp-176]\n mov al, 0\n sub rsp, 192\n extern printf\n call printf\n add rsp, 192\n mov rdi, __42_fstr\n mov al, 0\n sub rsp, 192\n extern printf\n call printf\n add rsp, 192\n mov rax, rbp\n add rax, 0xfffffffffffffff8\n mov qword [rbp-200], rax\n mov rax, qword [rbp-200]\n mov qword [rbp-208], rax\n sub rsp, 0x00000000000000d0\n call _14\n add rsp, 0x00000000000000d0\n mov qword [rbp-208], 8\n mov rax, qword [rbp-208]\n leave\n ret\n\n\n_10:\n push rbp\n mov rbp, rsp\n mov qword [rbp+16], 0\n leave\n ret\n\n\n_11:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-17], rax\n mov rdx, qword [rbp-17]\n mov rax, qword [rdx+0]\n mov qword [rbp-9], rax\n mov rax, qword [rbp-9]\n cmp rax, 0\n jz __36_24\n mov byte [rbp-1], 0\n jmp __36_25\n __36_24:\n mov byte [rbp-1], 1\n __36_25:\n cmp byte [rbp-1], 0\n jz _11_27\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-25], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-41], rax\n mov rax, qword [rbp-41]\n mov qword [rbp-57], rax\n sub rsp, 0x0000000000000039\n call _15\n add rsp, 0x0000000000000039\n mov rax, qword [rbp-49]\n mov qword [rbp-33], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rbp-33]\n mov qword [rdx+0], rax\n jmp _11_26\n _11_27:\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-25], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rdx+0]\n mov qword [rbp-33], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-41], rax\n mov rax, qword [rbp-41]\n mov qword [rbp-65], rax\n mov rax, qword [rbp-33]\n mov qword [rbp-73], rax\n sub rsp, 0x0000000000000049\n call _16\n add rsp, 0x0000000000000049\n _11_28:\n _11_26:\n\nleave\nret\n\n_12:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-8], rax\n mov rdx, qword [rbp-8]\n mov rax, qword [rdx+0]\n mov qword [rbp-16], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-24], rax\n mov rax, qword [rbp-24]\n mov qword [rbp-48], rax\n mov rax, qword [rbp-16]\n mov qword [rbp-56], rax\n sub rsp, 0x0000000000000038\n call _17\n add rsp, 0x0000000000000038\n mov rax, qword [rbp-40]\n mov qword [rbp+32], rax\n leave\n ret\n\n\n_13:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-17], rax\n mov rdx, qword [rbp-17]\n mov rax, qword [rdx+0]\n mov qword [rbp-25], rax\n mov rax, [rbp-25]\n add rax, 0x0000000000000008\n mov qword [rbp-33], rax\n mov rdx, qword [rbp-33]\n mov rax, qword [rdx+0]\n mov qword [rbp-9], rax\n mov rax, qword [rbp-9]\n cmp rax, 0\n jz __36_0\n mov byte [rbp-1], 0\n jmp __36_1\n __36_0:\n mov byte [rbp-1], 1\n __36_1:\n cmp byte [rbp-1], 0\n jz _13_2\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-49], rax\n mov rdx, qword [rbp-49]\n mov rax, qword [rdx+0]\n mov qword [rbp-57], rax\n mov rax, [rbp-57]\n add rax, 0x0000000000000000\n mov qword [rbp-65], rax\n mov rdx, qword [rbp-65]\n mov rax, qword [rdx+0]\n mov qword [rbp-41], rax\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-81], rax\n mov rdx, qword [rbp-81]\n mov rax, qword [rdx+0]\n mov qword [rbp-73], rax\n mov rdi, qword [rbp-73]\n sub rsp, 81\n extern free\n call free\n add rsp, 81\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-89], rax\n mov qword [rbp-97], 0\n mov rdx, qword [rbp-89]\n mov rax, qword [rbp-97]\n mov qword [rdx+0], rax\n mov rax, qword [rbp-41]\n mov qword [rbp+24], rax\n leave\n ret\n _13_3:\n _13_2:\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-41], rax\n mov rdx, qword [rbp-41]\n mov rax, qword [rdx+0]\n mov qword [rbp-49], rax\n mov rax, qword [rbp-49]\n mov qword [rbp-65], rax\n sub rsp, 0x0000000000000041\n call _18\n add rsp, 0x0000000000000041\n mov rax, qword [rbp-57]\n mov qword [rbp+24], rax\n leave\n ret\n\n\n_14:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-18], rax\n mov rdx, qword [rbp-18]\n mov rax, qword [rdx+0]\n mov qword [rbp-10], rax\n mov rax, qword [rbp-10]\n cmp rax, 0\n jz __36_4\n mov byte [rbp-2], 0\n jmp __36_5\n __36_4:\n mov byte [rbp-2], 1\n __36_5:\n mov al, byte [rbp-2]\n cmp al, 0\n jz __23_6\n mov byte [rbp-1], 0\n jmp __23_7\n __23_6:\n mov byte [rbp-1], 1\n __23_7:\n cmp byte [rbp-1], 0\n jz _14_8\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-26], rax\n mov rdx, qword [rbp-26]\n mov rax, qword [rdx+0]\n mov qword [rbp-34], rax\n mov rax, qword [rbp-34]\n mov qword [rbp-42], rax\n sub rsp, 0x000000000000002a\n call _19\n add rsp, 0x000000000000002a\n _14_9:\n _14_8:\n\nleave\nret\n\n_15:\n push rbp\n mov rbp, rsp\n mov rax, qword [rbp+16]\n mov qword [rbp-16], rax\n mov qword [rbp-8], 0\n mov rdi, 16\n sub rsp, 16\n extern malloc\n call malloc\n add rsp, 16\n mov qword [rbp-24], rax\n mov rdx, qword [rbp-24]\n mov rax, qword [rbp-16]\n mov qword [rdx+0], rax\n mov rax, qword [rbp-8]\n mov qword [rdx+8], rax\n mov rax, qword [rbp-24]\n mov qword [rbp+24], rax\n leave\n ret\n\n\n_16:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-17], rax\n mov rdx, qword [rbp-17]\n mov rax, qword [rdx+0]\n mov qword [rbp-9], rax\n mov rax, qword [rbp-9]\n cmp rax, 0\n jz __36_29\n mov byte [rbp-1], 0\n jmp __36_30\n __36_29:\n mov byte [rbp-1], 1\n __36_30:\n cmp byte [rbp-1], 0\n jz _16_32\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-25], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-41], rax\n mov rax, qword [rbp-41]\n mov qword [rbp-57], rax\n sub rsp, 0x0000000000000039\n call _15\n add rsp, 0x0000000000000039\n mov rax, qword [rbp-49]\n mov qword [rbp-33], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rbp-33]\n mov qword [rdx+0], rax\n jmp _16_31\n _16_32:\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-25], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rdx+0]\n mov qword [rbp-33], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-41], rax\n mov rax, qword [rbp-41]\n mov qword [rbp-65], rax\n mov rax, qword [rbp-33]\n mov qword [rbp-73], rax\n sub rsp, 0x0000000000000049\n call _16\n add rsp, 0x0000000000000049\n _16_33:\n _16_31:\n\nleave\nret\n\n_17:\n push rbp\n mov rbp, rsp\n mov rax, qword [rbp+24]\n mov qword [rbp-9], rax\n mov qword [rbp-17], 0\n mov rax, qword [rbp-9]\n cmp rax, qword [rbp-17]\n jz __16_20\n mov byte [rbp-1], 0\n jmp __16_21\n __16_20:\n mov byte [rbp-1], 1\n __16_21:\n cmp byte [rbp-1], 0\n jz _17_22\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-25], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rdx+0]\n mov qword [rbp+32], rax\n leave\n ret\n _17_23:\n _17_22:\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-25], rax\n mov rdx, qword [rbp-25]\n mov rax, qword [rdx+0]\n mov qword [rbp-33], rax\n mov rax, qword [rbp+24]\n mov qword [rbp-49], rax\n mov qword [rbp-57], 1\n mov rax, qword [rbp-49]\n sub rax, qword [rbp-57]\n mov qword [rbp-41], rax\n mov rax, qword [rbp-41]\n mov qword [rbp-81], rax\n mov rax, qword [rbp-33]\n mov qword [rbp-89], rax\n sub rsp, 0x0000000000000059\n call _17\n add rsp, 0x0000000000000059\n mov rax, qword [rbp-73]\n mov qword [rbp+32], rax\n leave\n ret\n\n\n_18:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-17], rax\n mov rdx, qword [rbp-17]\n mov rax, qword [rdx+0]\n mov qword [rbp-25], rax\n mov rax, [rbp-25]\n add rax, 0x0000000000000008\n mov qword [rbp-33], rax\n mov rdx, qword [rbp-33]\n mov rax, qword [rdx+0]\n mov qword [rbp-9], rax\n mov rax, qword [rbp-9]\n cmp rax, 0\n jz __36_16\n mov byte [rbp-1], 0\n jmp __36_17\n __36_16:\n mov byte [rbp-1], 1\n __36_17:\n cmp byte [rbp-1], 0\n jz _18_18\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-49], rax\n mov rdx, qword [rbp-49]\n mov rax, qword [rdx+0]\n mov qword [rbp-57], rax\n mov rax, [rbp-57]\n add rax, 0x0000000000000000\n mov qword [rbp-65], rax\n mov rdx, qword [rbp-65]\n mov rax, qword [rdx+0]\n mov qword [rbp-41], rax\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-81], rax\n mov rdx, qword [rbp-81]\n mov rax, qword [rdx+0]\n mov qword [rbp-73], rax\n mov rdi, qword [rbp-73]\n sub rsp, 81\n extern free\n call free\n add rsp, 81\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-89], rax\n mov qword [rbp-97], 0\n mov rdx, qword [rbp-89]\n mov rax, qword [rbp-97]\n mov qword [rdx+0], rax\n mov rax, qword [rbp-41]\n mov qword [rbp+24], rax\n leave\n ret\n _18_19:\n _18_18:\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-41], rax\n mov rdx, qword [rbp-41]\n mov rax, qword [rdx+0]\n mov qword [rbp-49], rax\n mov rax, qword [rbp-49]\n mov qword [rbp-65], rax\n sub rsp, 0x0000000000000041\n call _18\n add rsp, 0x0000000000000041\n mov rax, qword [rbp-57]\n mov qword [rbp+24], rax\n leave\n ret\n\n\n_19:\n push rbp\n mov rbp, rsp\n mov rax, [rbp+16]\n add rax, 0x0000000000000000\n mov qword [rbp-16], rax\n mov rdx, qword [rbp-16]\n mov rax, qword [rdx+0]\n mov qword [rbp-8], rax\n mov rdi, __8_fstr\n mov rsi, [rbp-8]\n mov al, 0\n sub rsp, 16\n extern printf\n call printf\n add rsp, 16\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-34], rax\n mov rdx, qword [rbp-34]\n mov rax, qword [rdx+0]\n mov qword [rbp-26], rax\n mov rax, qword [rbp-26]\n cmp rax, 0\n jz __36_10\n mov byte [rbp-18], 0\n jmp __36_11\n __36_10:\n mov byte [rbp-18], 1\n __36_11:\n mov al, byte [rbp-18]\n cmp al, 0\n jz __23_12\n mov byte [rbp-17], 0\n jmp __23_13\n __23_12:\n mov byte [rbp-17], 1\n __23_13:\n cmp byte [rbp-17], 0\n jz _19_14\n mov rax, [rbp+16]\n add rax, 0x0000000000000008\n mov qword [rbp-42], rax\n mov rdx, qword [rbp-42]\n mov rax, qword [rdx+0]\n mov qword [rbp-50], rax\n mov rax, qword [rbp-50]\n mov qword [rbp-58], rax\n sub rsp, 0x000000000000003a\n call _19\n add rsp, 0x000000000000003a\n _19_15:\n _19_14:\n\nleave\nret\n\nsection .data_readonly\n __42_fstr db `\\n`,0\n __8_fstr db `Integer: %ld\\n`,0
-Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-<+>UTF-8
-===================================================================
-diff --git a/build/out.asm b/build/out.asm
---- a/build/out.asm (revision 6a59973c20052dc147b44a0ab3d6d213f79b9664)
-+++ b/build/out.asm (date 1722972940448)
-@@ -139,14 +139,14 @@
- mov qword [rbp-9], rax
- mov rax, qword [rbp-9]
- cmp rax, 0
-- jz __36_24
-+ jz __36_16
- mov byte [rbp-1], 0
-- jmp __36_25
-- __36_24:
-+ jmp __36_17
-+ __36_16:
- mov byte [rbp-1], 1
-- __36_25:
-+ __36_17:
- cmp byte [rbp-1], 0
-- jz _11_27
-+ jz _11_19
- mov rax, [rbp+16]
- add rax, 0x0000000000000000
- mov qword [rbp-25], rax
-@@ -162,8 +162,8 @@
- mov rdx, qword [rbp-25]
- mov rax, qword [rbp-33]
- mov qword [rdx+0], rax
-- jmp _11_26
-- _11_27:
-+ jmp _11_18
-+ _11_19:
- mov rax, [rbp+16]
- add rax, 0x0000000000000000
- mov qword [rbp-25], rax
-@@ -179,8 +179,8 @@
- sub rsp, 0x0000000000000049
- call _16
- add rsp, 0x0000000000000049
-- _11_28:
-- _11_26:
-+ _11_20:
-+ _11_18:
-
- leave
- ret
-@@ -226,14 +226,14 @@
- mov qword [rbp-9], rax
- mov rax, qword [rbp-9]
- cmp rax, 0
-- jz __36_0
-+ jz __36_26
- mov byte [rbp-1], 0
-- jmp __36_1
-- __36_0:
-+ jmp __36_27
-+ __36_26:
- mov byte [rbp-1], 1
-- __36_1:
-+ __36_27:
- cmp byte [rbp-1], 0
-- jz _13_2
-+ jz _13_28
- mov rax, [rbp+16]
- add rax, 0x0000000000000000
- mov qword [rbp-49], rax
-@@ -268,8 +268,8 @@
- mov qword [rbp+24], rax
- leave
- ret
-- _13_3:
-- _13_2:
-+ _13_29:
-+ _13_28:
- mov rax, [rbp+16]
- add rax, 0x0000000000000000
- mov qword [rbp-41], rax
-@@ -365,14 +365,14 @@
- mov qword [rbp-9], rax
- mov rax, qword [rbp-9]
- cmp rax, 0
-- jz __36_29
-+ jz __36_21
- mov byte [rbp-1], 0
-- jmp __36_30
-- __36_29:
-+ jmp __36_22
-+ __36_21:
- mov byte [rbp-1], 1
-- __36_30:
-+ __36_22:
- cmp byte [rbp-1], 0
-- jz _16_32
-+ jz _16_24
- mov rax, [rbp+16]
- add rax, 0x0000000000000008
- mov qword [rbp-25], rax
-@@ -388,8 +388,8 @@
- mov rdx, qword [rbp-25]
- mov rax, qword [rbp-33]
- mov qword [rdx+0], rax
-- jmp _16_31
-- _16_32:
-+ jmp _16_23
-+ _16_24:
- mov rax, [rbp+16]
- add rax, 0x0000000000000008
- mov qword [rbp-25], rax
-@@ -405,8 +405,8 @@
- sub rsp, 0x0000000000000049
- call _16
- add rsp, 0x0000000000000049
-- _16_33:
-- _16_31:
-+ _16_25:
-+ _16_23:
-
- leave
- ret
-@@ -419,14 +419,14 @@
- mov qword [rbp-17], 0
- mov rax, qword [rbp-9]
- cmp rax, qword [rbp-17]
-- jz __16_20
-+ jz __16_0
- mov byte [rbp-1], 0
-- jmp __16_21
-- __16_20:
-+ jmp __16_1
-+ __16_0:
- mov byte [rbp-1], 1
-- __16_21:
-+ __16_1:
- cmp byte [rbp-1], 0
-- jz _17_22
-+ jz _17_2
- mov rax, [rbp+16]
- add rax, 0x0000000000000000
- mov qword [rbp-25], rax
-@@ -435,8 +435,8 @@
- mov qword [rbp+32], rax
- leave
- ret
-- _17_23:
-- _17_22:
-+ _17_3:
-+ _17_2:
- mov rax, [rbp+16]
- add rax, 0x0000000000000008
- mov qword [rbp-25], rax
-@@ -479,14 +479,14 @@
- mov qword [rbp-9], rax
- mov rax, qword [rbp-9]
- cmp rax, 0
-- jz __36_16
-+ jz __36_30
- mov byte [rbp-1], 0
-- jmp __36_17
-- __36_16:
-+ jmp __36_31
-+ __36_30:
- mov byte [rbp-1], 1
-- __36_17:
-+ __36_31:
- cmp byte [rbp-1], 0
-- jz _18_18
-+ jz _18_32
- mov rax, [rbp+16]
- add rax, 0x0000000000000008
- mov qword [rbp-49], rax
-@@ -521,8 +521,8 @@
- mov qword [rbp+24], rax
- leave
- ret
-- _18_19:
-- _18_18:
-+ _18_33:
-+ _18_32:
- mov rax, [rbp+16]
- add rax, 0x0000000000000008
- mov qword [rbp-41], rax
diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024__15_58__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024__15_58__Changes_.xml
deleted file mode 100644
index bd6e261..0000000
--- a/.idea/shelf/Uncommitted_changes_before_Update_at_07_08_2024__15_58__Changes_.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 86fb287..7712e5e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -8,55 +8,33 @@
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
@@ -132,35 +110,35 @@
- {
- "keyToString": {
- "Cargo.Build `Run whython-8`.executor": "Run",
- "Cargo.Run whython-8.executor": "Run",
- "Cargo.Test whython-8.executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.rust.reset.selective.auto.import": "true",
- "Shell Script.Test Asm.executor": "Run",
- "git-widget-placeholder": "dev",
- "ignore.virus.scanning.warn.message": "true",
- "last_opened_file_path": "/home/robertlucas/RustroverProjects/whython-8/src/root/builtin/functions",
- "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": "tasks",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -238,7 +216,7 @@
-
+
@@ -334,6 +312,9 @@
+
+
+
diff --git a/build/out.asm b/build/out.asm
index f8bb0d5..06618a8 100644
--- a/build/out.asm
+++ b/build/out.asm
@@ -2,3 +2,32 @@
section .text
+main:
+ push rbp
+ mov rbp, rsp
+ sub rsp, 0x0000000000000010
+ call _8
+ add rsp, 0x0000000000000010
+ mov qword [rbp-24], 0
+ mov rax, qword [rbp-24]
+ leave
+ ret
+
+
+_8:
+ push rbp
+ mov rbp, rsp
+ mov qword [rbp-8], 7
+ mov rdi, __8_fstr
+ mov rsi, [rbp-8]
+ mov al, 0
+ sub rsp, 8
+ extern printf
+ call printf
+ add rsp, 8
+
+leave
+ret
+
+section .data_readonly
+ __8_fstr db `Integer: %ld\n`,0
\ No newline at end of file
diff --git a/build/out.o b/build/out.o
index d920909..ae5f5fe 100644
Binary files a/build/out.o and b/build/out.o differ
diff --git a/build/out.out b/build/out.out
new file mode 100755
index 0000000..1c35abf
Binary files /dev/null and b/build/out.out differ
diff --git a/main.why b/main.why
index bf9dcb6..c370f2a 100644
--- a/main.why
+++ b/main.why
@@ -1,22 +1,8 @@
-use std/;
-
+import std/;
fn main() -> int {
- let x: LL = LL::new();
- x.push(12);
- x.push(7);
- x.push(8);
- x.print();
- printnl();
-
- printi(x.get(1));
- printnl();
-
- printi(x.pop());
- printnl();
-
- x.print();
+ std::test::foo();
- return 8;
+ return 0;
}
diff --git a/src/root/compiler/compile.rs b/src/root/compiler/compile.rs
index f9f51c1..387977f 100644
--- a/src/root/compiler/compile.rs
+++ b/src/root/compiler/compile.rs
@@ -1,10 +1,9 @@
-#[cfg(debug_assertions)]
-use itertools::Itertools;
use std::collections::HashMap;
-use std::io::{stdout, Write};
-use std::thread;
use std::time::{Duration, Instant};
+#[cfg(debug_assertions)]
+use itertools::Itertools;
+
use crate::root::compiler::compile_function::compile_function;
use crate::root::compiler::global_tracker::GlobalTracker;
use crate::root::errors::WErr;
@@ -44,6 +43,16 @@ pub fn compile(
continue; // Inline function
};
+ let file_id = current_function_token.location().file_id().unwrap();
+ global_table.scope_namespace(
+ file_id,
+ global_tracker
+ .path_storage()
+ .get_file(file_id)
+ .scope()
+ .clone(),
+ );
+
let compiled = compile_function(
current_function,
current_function_token,
diff --git a/src/root/compiler/compile_function.rs b/src/root/compiler/compile_function.rs
index 8ae99e6..328d8cd 100644
--- a/src/root/compiler/compile_function.rs
+++ b/src/root/compiler/compile_function.rs
@@ -31,7 +31,7 @@ pub fn compile_function(
let return_type = if fid.is_main() { None } else { return_type };
let return_type = if let Some(t) = return_type {
- Some(global_table.resolve_to_type_ref(&t)?)
+ Some(global_table.resolve_to_type_ref(&t, None)?)
} else {
None
};
@@ -39,7 +39,7 @@ pub fn compile_function(
let mut param_address = LocalAddress(16);
for (param_name, param_type) in parameters {
- let t = global_table.resolve_to_type_ref(¶m_type)?;
+ let t = global_table.resolve_to_type_ref(¶m_type, None)?;
local_variables.add_existing(
param_name.name().clone(),
@@ -121,6 +121,7 @@ fn recursively_compile_lines(
name.name().clone(),
type_name,
local_variables,
+ global_tracker,
)?;
contents.other(&compile_evaluable_into(
fid,
diff --git a/src/root/compiler/evaluation/function_only.rs b/src/root/compiler/evaluation/function_only.rs
index c311ff6..15854ce 100644
--- a/src/root/compiler/evaluation/function_only.rs
+++ b/src/root/compiler/evaluation/function_only.rs
@@ -18,7 +18,13 @@ pub fn compile_evaluable_function_only<'a>(
) -> Result<(Option<&'a EvaluableToken>, FunctionID, String), WErr> {
Ok(match name.token() {
EvaluableTokens::Name(name, containing_class) => {
- match global_table.resolve_name(name, containing_class.as_ref(), local_variables)? {
+ match global_table.resolve_name(
+ name,
+ None,
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
NameResult::Function(fid) => (None, fid, name.name().clone()),
_ => return WErr::ne(ExpectedFunctionName, name.location().clone()),
}
@@ -27,6 +33,59 @@ pub fn compile_evaluable_function_only<'a>(
parent: inner,
section: access,
} => {
+ // TODO: Make order consistent i.e. check if type exists before checking if file exists
+ match inner.token() {
+ EvaluableTokens::Name(file_name, containing_class) => {
+ if let Some(file) = global_table.get_imported_file(file_name, global_tracker) {
+ return Ok(
+ match global_table.resolve_name(
+ access,
+ Some(file),
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
+ NameResult::Function(fid) => (None, fid, access.name().clone()),
+ _ => {
+ return WErr::ne(ExpectedFunctionName, name.location().clone())
+ }
+ },
+ );
+ };
+ }
+ EvaluableTokens::StaticAccess {
+ parent,
+ section: file_name,
+ } => {
+ if let EvaluableTokens::Name(folder_name, containing_class) = parent.token() {
+ if let Some(file) = global_table.get_file_from_folder(
+ folder_name.name(),
+ file_name.name(),
+ global_tracker,
+ ) {
+ return Ok(
+ match global_table.resolve_name(
+ access,
+ Some(file),
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
+ NameResult::Function(fid) => (None, fid, access.name().clone()),
+ _ => {
+ return WErr::ne(
+ ExpectedFunctionName,
+ name.location().clone(),
+ )
+ }
+ },
+ );
+ }
+ }
+ }
+ _ => (),
+ }
+
let inner_type = compile_evaluable_type_only(
fid,
inner,
diff --git a/src/root/compiler/evaluation/into.rs b/src/root/compiler/evaluation/into.rs
index 524d883..ad115cd 100644
--- a/src/root/compiler/evaluation/into.rs
+++ b/src/root/compiler/evaluation/into.rs
@@ -35,7 +35,13 @@ pub fn compile_evaluable_into(
Ok(match ets {
EvaluableTokens::Name(name, containing_class) => {
- match global_table.resolve_name(name, containing_class.as_ref(), local_variables)? {
+ match global_table.resolve_name(
+ name,
+ None,
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
NameResult::Function(_) => {
return WErr::ne(
EvalErrs::FunctionMustBeCalled(name.name().clone()),
@@ -48,6 +54,12 @@ pub fn compile_evaluable_into(
name.location().clone(),
)
}
+ NameResult::File(_) => {
+ return WErr::ne(
+ EvalErrs::CannotEvaluateStandaloneImportedFile(name.name().clone()),
+ name.location().clone(),
+ )
+ }
NameResult::Variable(address) => {
if address.type_ref() != target.type_ref() {
return WErr::ne(
@@ -405,7 +417,7 @@ pub fn compile_evaluable_into(
ab.finish()
}
EvaluableTokens::StructInitialiser(struct_init) => {
- let t = global_table.resolve_to_type_ref(struct_init.name())?;
+ let t = global_table.resolve_to_type_ref(struct_init.name(), None)?;
if *struct_init.heap_alloc() {
if target.type_ref() != &t.plus_one_indirect() {
diff --git a/src/root/compiler/evaluation/new.rs b/src/root/compiler/evaluation/new.rs
index 8d2ea90..2676ea9 100644
--- a/src/root/compiler/evaluation/new.rs
+++ b/src/root/compiler/evaluation/new.rs
@@ -36,7 +36,13 @@ pub fn compile_evaluable_new(
Ok(match ets {
EvaluableTokens::Name(name, containing_class) => {
- match global_table.resolve_name(name, containing_class.as_ref(), local_variables)? {
+ match global_table.resolve_name(
+ name,
+ None,
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
NameResult::Function(_) => {
return WErr::ne(
EvalErrs::FunctionMustBeCalled(name.name().clone()),
@@ -49,6 +55,12 @@ pub fn compile_evaluable_new(
name.location().clone(),
)
}
+ NameResult::File(_) => {
+ return WErr::ne(
+ EvalErrs::CannotEvaluateStandaloneImportedFile(name.name().clone()),
+ name.location().clone(),
+ )
+ }
NameResult::Variable(address) => {
let target = global_table.add_local_variable_unnamed_base(
address.type_ref().clone(),
@@ -422,7 +434,7 @@ pub fn compile_evaluable_new(
(ab.finish(), return_into)
}
EvaluableTokens::StructInitialiser(struct_init) => {
- let t = global_table.resolve_to_type_ref(struct_init.name())?;
+ let t = global_table.resolve_to_type_ref(struct_init.name(), None)?;
let size = global_table.get_size(&t);
let mut code = AssemblyBuilder::new();
diff --git a/src/root/compiler/evaluation/reference.rs b/src/root/compiler/evaluation/reference.rs
index 3313abf..695e61e 100644
--- a/src/root/compiler/evaluation/reference.rs
+++ b/src/root/compiler/evaluation/reference.rs
@@ -20,7 +20,13 @@ pub fn compile_evaluable_reference(
Ok(match ets {
EvaluableTokens::Name(name, containing_class) => {
- match global_table.resolve_name(name, containing_class.as_ref(), local_variables)? {
+ match global_table.resolve_name(
+ name,
+ None,
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )? {
NameResult::Function(_) => {
return WErr::ne(
EvalErrs::FunctionMustBeCalled(name.name().clone()),
@@ -33,6 +39,12 @@ pub fn compile_evaluable_reference(
name.location().clone(),
)
}
+ NameResult::File(_) => {
+ return WErr::ne(
+ EvalErrs::CannotEvaluateStandaloneImportedFile(name.name().clone()),
+ name.location().clone(),
+ )
+ }
NameResult::Variable(address) => (String::new(), Some(address)),
}
}
diff --git a/src/root/compiler/evaluation/type_only.rs b/src/root/compiler/evaluation/type_only.rs
index 4786190..762b640 100644
--- a/src/root/compiler/evaluation/type_only.rs
+++ b/src/root/compiler/evaluation/type_only.rs
@@ -8,8 +8,36 @@ use crate::root::errors::WErr;
use crate::root::name_resolver::name_resolvers::{GlobalTable, NameResult};
use crate::root::parser::parse_function::parse_evaluable::{EvaluableToken, EvaluableTokens};
use crate::root::parser::parse_function::parse_operator::{OperatorTokens, PrefixOrInfixEx};
+use crate::root::parser::parse_name::SimpleNameToken;
use crate::root::shared::common::{FunctionID, Indirection, TypeRef};
+fn handle_name_result(name: &SimpleNameToken, name_result: NameResult) -> Result {
+ Ok(match name_result {
+ NameResult::Function(_) => {
+ return WErr::ne(
+ EvalErrs::FunctionMustBeCalled(name.name().clone()),
+ name.location().clone(),
+ )
+ }
+ NameResult::Type(t) => {
+ t.immediate_single()
+ // println!("> {}", name.name());
+ // std::process::exit(123);
+ // return WErr::ne(
+ // EvalErrs::CannotEvalStandaloneType(name.name().clone()),
+ // name.location().clone(),
+ // )
+ }
+ NameResult::Variable(address) => address.type_ref().clone(),
+ NameResult::File(_) => {
+ return WErr::ne(
+ EvalErrs::ExpectedTypeNotImportedFile(name.name().clone()),
+ name.location().clone(),
+ )
+ }
+ })
+}
+
/// Evaluates the type `et` evaluates to. Does not generate any assembly.
pub fn compile_evaluable_type_only(
fid: FunctionID,
@@ -21,26 +49,16 @@ pub fn compile_evaluable_type_only(
let ets = et.token();
Ok(match ets {
- EvaluableTokens::Name(name, containing_class) => {
- match global_table.resolve_name(name, containing_class.as_ref(), local_variables)? {
- NameResult::Function(_) => {
- return WErr::ne(
- EvalErrs::FunctionMustBeCalled(name.name().clone()),
- name.location().clone(),
- )
- }
- NameResult::Type(t) => {
- t.immediate_single()
- // println!("> {}", name.name());
- // std::process::exit(123);
- // return WErr::ne(
- // EvalErrs::CannotEvalStandaloneType(name.name().clone()),
- // name.location().clone(),
- // )
- }
- NameResult::Variable(address) => address.type_ref().clone(),
- }
- }
+ EvaluableTokens::Name(name, containing_class) => handle_name_result(
+ name,
+ global_table.resolve_name(
+ name,
+ None,
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )?,
+ )?,
EvaluableTokens::Literal(literal) => {
let tid = literal.literal().default_type();
// TODO: Don't use 0 here
@@ -138,13 +156,54 @@ pub fn compile_evaluable_type_only(
}
}
EvaluableTokens::StaticAccess {
- parent: _,
+ parent: p,
section: n,
} => {
+ match p.token() {
+ EvaluableTokens::Name(file_name, containing_class) => {
+ if let Some(file) = global_table.get_imported_file(file_name, global_tracker) {
+ return handle_name_result(
+ n,
+ global_table.resolve_name(
+ n,
+ Some(file),
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )?,
+ );
+ };
+ }
+ EvaluableTokens::StaticAccess {
+ parent,
+ section: file_name,
+ } => {
+ if let EvaluableTokens::Name(folder_name, containing_class) = parent.token() {
+ if let Some(file) = global_table.get_file_from_folder(
+ folder_name.name(),
+ file_name.name(),
+ global_tracker,
+ ) {
+ return handle_name_result(
+ n,
+ global_table.resolve_name(
+ n,
+ Some(file),
+ containing_class.as_ref(),
+ local_variables,
+ global_tracker,
+ )?,
+ );
+ }
+ }
+ }
+ _ => (),
+ }
+
return WErr::ne(
NRErrs::CannotFindConstantAttribute(n.name().clone()),
n.location().clone(),
- )
+ );
} // Accessed methods must be called
EvaluableTokens::FunctionCall {
function: inner,
@@ -165,7 +224,7 @@ pub fn compile_evaluable_type_only(
return_type
}
EvaluableTokens::StructInitialiser(struct_init) => {
- let mut t = global_table.resolve_to_type_ref(struct_init.name())?;
+ let mut t = global_table.resolve_to_type_ref(struct_init.name(), None)?;
if *struct_init.heap_alloc() {
t = t.plus_one_indirect();
}
diff --git a/src/root/errors/evaluable_errors.rs b/src/root/errors/evaluable_errors.rs
index 196ed64..c6a03dd 100644
--- a/src/root/errors/evaluable_errors.rs
+++ b/src/root/errors/evaluable_errors.rs
@@ -50,4 +50,8 @@ pub enum EvalErrs {
WrongAttributeNameInInit(String, String),
#[error("Expected ({0}) attributes to be initialised - found ({1})")]
WrongAttributeCount(usize, usize),
+ #[error("Expected type, not imported file ({0})")]
+ ExpectedTypeNotImportedFile(String),
+ #[error("Cannot evaluate a standalone imported file ({0})")]
+ CannotEvaluateStandaloneImportedFile(String),
}
diff --git a/src/root/errors/name_resolver_errors.rs b/src/root/errors/name_resolver_errors.rs
index e6f28f6..fb2e0e2 100644
--- a/src/root/errors/name_resolver_errors.rs
+++ b/src/root/errors/name_resolver_errors.rs
@@ -26,7 +26,7 @@ pub enum NRErrs {
ExpectedTypeNotMethodOrAttribute,
#[error("Cannot find name ({0})")]
CannotFindName(String),
- #[error("Cannot find constant attribute ({0})")]
+ #[error("Cannot find constant attribute ({0}) - are you trying to use the contents of a file you haven't imported?")]
CannotFindConstantAttribute(String),
#[error("Method ({0}) not implemented for type ({1}) required for operator ({2})")]
OpMethodNotImplemented(String, String, String),
diff --git a/src/root/name_resolver/name_resolvers.rs b/src/root/name_resolver/name_resolvers.rs
index ba33efb..62331c6 100644
--- a/src/root/name_resolver/name_resolvers.rs
+++ b/src/root/name_resolver/name_resolvers.rs
@@ -1,6 +1,12 @@
+use derive_getters::Getters;
+use std::collections::HashMap;
+
+use itertools::Itertools;
+
use crate::root::builtin::{BuiltinInlineFunction, InlineFnGenerator};
use crate::root::compiler::assembly::heap::free_function;
use crate::root::compiler::assembly::null::{is_null_function, null_function};
+use crate::root::compiler::global_tracker::GlobalTracker;
use crate::root::compiler::local_variable_table::LocalVariableTable;
use crate::root::errors::name_resolver_errors::NRErrs;
use crate::root::errors::WErr;
@@ -13,13 +19,10 @@ use crate::root::parser::parse_function::parse_operator::{OperatorToken, PrefixO
use crate::root::parser::parse_function::FunctionToken;
use crate::root::parser::parse_name::SimpleNameToken;
use crate::root::parser::parse_struct::StructToken;
-use crate::root::parser::path_storage::{FileID, FolderID, Scope};
+use crate::root::parser::path_storage::{FileID, Scope};
use crate::root::shared::common::{AddressedTypeRef, ByteSize, FunctionID, TypeID, TypeRef};
use crate::root::shared::types::Type;
-use crate::root::unrandom::new_hashmap;
use crate::root::POINTER_SIZE;
-use derive_new::new;
-use std::collections::HashMap;
#[derive(Debug)]
enum NameTreeEntry {
@@ -52,12 +55,19 @@ struct TopLevelNameTree {
impl TopLevelNameTree {
pub fn get_tree_mut(&mut self, file_id: FileID) -> &mut NameTree {
self.table.entry(file_id).or_default();
-
self.table.get_mut(&file_id).unwrap()
}
}
+pub enum NameResult {
+ Function(FunctionID),
+ Type(TypeID),
+ Variable(AddressedTypeRef),
+ File(FileID),
+}
+
/// Tables containing all global, unchanging definitions from name resolution step
+// #[derive(Getters)]
pub struct GlobalTable {
id_counter: isize,
type_definitions: HashMap>,
@@ -67,15 +77,10 @@ pub struct GlobalTable {
builtin_type_name_table: HashMap,
builtin_function_name_table: HashMap,
builtin_inline_functions: HashMap,
+ current_file: FileID,
scope: Scope,
}
-pub enum NameResult {
- Function(FunctionID),
- Type(TypeID),
- Variable(AddressedTypeRef),
-}
-
impl Default for GlobalTable {
fn default() -> Self {
Self::new()
@@ -93,14 +98,42 @@ impl GlobalTable {
builtin_type_name_table: Default::default(),
builtin_function_name_table: Default::default(),
builtin_inline_functions: Default::default(),
+ current_file: FileID::main_file(),
scope: Default::default(),
}
}
- pub fn scope_namespace(&mut self, scope: Scope) {
+ pub fn scope_namespace(&mut self, current_file: FileID, scope: Scope) {
+ self.current_file = current_file;
self.scope = scope;
}
+ pub fn get_file_from_folder(
+ &self,
+ folder: &str,
+ file: &str,
+ global_tracker: &GlobalTracker,
+ ) -> Option {
+ self.scope
+ .folders_imported()
+ .iter()
+ .find_map(|(f, _)| {
+ if global_tracker.path_storage().get_folder(*f).current() == folder {
+ Some(*f)
+ } else {
+ None
+ }
+ })
+ .and_then(|f| {
+ global_tracker
+ .path_storage()
+ .get_folder(f)
+ .child_files()
+ .get(file)
+ .copied()
+ })
+ }
+
/// Registers a builtin type
pub fn register_builtin_type(&mut self, t: Box) {
let id = t.id();
@@ -184,7 +217,12 @@ impl GlobalTable {
ft: &FunctionToken,
containing_class: Option,
) -> FunctionID {
- let id = if ft.name().name() == "main" {
+ let id = if ft.name().name() == "main"
+ && ft
+ .location()
+ .file_id()
+ .is_some_and(|f| f == FileID::main_file())
+ {
FunctionID(0)
} else {
self.id_counter += 1;
@@ -240,7 +278,11 @@ impl GlobalTable {
}
/// Takes a name and resolves it to a type (or error)
- pub fn resolve_to_type_ref(&mut self, name: &UnresolvedTypeRefToken) -> Result {
+ pub fn resolve_to_type_ref(
+ &mut self,
+ name: &UnresolvedTypeRefToken,
+ from_imported_file: Option,
+ ) -> Result {
let (indirection, full_name) = (name.indirection(), name.inner());
fn find_error_point(name: &FullNameToken, prev_location: &Location) -> Location {
@@ -275,21 +317,33 @@ impl GlobalTable {
})
};
- // TODO
- if let Some(r) = process_tree(
- self.name_table
- .get_tree_mut(full_name.location().file_id().unwrap()),
- ) {
+ // Search in imported file
+ if let Some(import_file) = from_imported_file {
+ debug_assert!(self
+ .scope
+ .files_imported()
+ .iter()
+ .map(|(f, _)| *f)
+ .contains(&import_file));
+
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(import_file)) {
+ return r;
+ }
+
+ return WErr::ne(
+ NRErrs::TypeNotFound(name.name().clone()),
+ full_name.location().clone(),
+ );
+ }
+
+ // Search current file
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(self.current_file)) {
return r;
}
- for (_, tree) in self
- .name_table
- .table
- .iter()
- .filter(|(p, _)| **p != full_name.location().file_id().unwrap())
- {
- if let Some(r) = process_tree(tree) {
+ // Used files
+ for (use_file, _) in self.scope.files_used() {
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(*use_file)) {
return r;
}
}
@@ -337,7 +391,7 @@ impl GlobalTable {
t: &UnresolvedTypeRefToken,
local_variable_table: &mut LocalVariableTable,
) -> Result {
- let t = self.resolve_to_type_ref(t)?;
+ let t = self.resolve_to_type_ref(t, None)?;
Ok(self.add_local_variable_unnamed_base(t, local_variable_table))
}
@@ -347,8 +401,9 @@ impl GlobalTable {
name: String,
t: &UnresolvedTypeRefToken,
local_variable_table: &mut LocalVariableTable,
+ global_tracker: &GlobalTracker,
) -> Result {
- let t = self.resolve_to_type_ref(t)?;
+ let t = self.resolve_to_type_ref(t, None)?;
let size = self.get_size(&t);
let address = local_variable_table.add_new_unnamed(size);
let address = AddressedTypeRef::new(address, t);
@@ -383,17 +438,33 @@ impl GlobalTable {
)
}
+ pub fn get_imported_file(
+ &self,
+ name: &SimpleNameToken,
+ global_tracker: &GlobalTracker,
+ ) -> Option {
+ for (imported_file, _) in self.scope.files_imported() {
+ if global_tracker
+ .path_storage()
+ .get_file(*imported_file)
+ .current()
+ == name.name()
+ {
+ return Some(*imported_file);
+ }
+ }
+ None
+ }
+
/// Returns what a name resolves to
pub fn resolve_name(
&mut self,
name: &SimpleNameToken,
+ from_imported_file: Option,
_containing_class: Option<&SimpleNameToken>,
local_variable_table: &LocalVariableTable,
+ global_tracker: &GlobalTracker,
) -> Result {
- if let Some(variable) = local_variable_table.get(name.name()) {
- return Ok(NameResult::Variable(variable));
- }
-
let process_tree = |tree: &NameTree| -> Option<_> {
tree.get_entry(name.name()).map(|val| match val {
NameTreeEntry::Type(t) => Ok(NameResult::Type(*t)),
@@ -401,38 +472,72 @@ impl GlobalTable {
})
};
- // TODO
- if let Some(r) = process_tree(
- self.name_table
- .get_tree_mut(name.location().file_id().unwrap()),
- ) {
+ let failed_to_find_error = || {
+ WErr::ne(
+ NRErrs::CannotFindName(name.name().clone()),
+ name.location().clone(),
+ )
+ };
+
+ // Search in imported file
+ if let Some(import_file) = from_imported_file {
+ debug_assert!(
+ self.scope
+ .files_imported()
+ .iter()
+ .map(|(f, _)| *f)
+ .contains(&import_file)
+ ||
+ self.scope
+ .folders_imported()
+ .iter()
+ .any(|(f, _)| global_tracker
+ .path_storage()
+ .get_folder(*f)
+ .child_files()
+ .values()
+ .contains(&import_file))
+ );
+
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(import_file)) {
+ return r;
+ }
+
+ return failed_to_find_error();
+ }
+
+ if let Some(variable) = local_variable_table.get(name.name()) {
+ return Ok(NameResult::Variable(variable));
+ }
+
+ // Own tree
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(self.current_file)) {
return r;
}
- // TODO
- for (_, tree) in self
- .name_table
- .table
- .iter()
- .filter(|(p, _)| **p != name.location().file_id().unwrap())
- {
- if let Some(r) = process_tree(tree) {
+ // Used files
+ for (use_file, _) in self.scope.files_used() {
+ if let Some(r) = process_tree(self.name_table.get_tree_mut(*use_file)) {
return r;
}
}
+ // Imported files
+ if let Some(file) = self.get_imported_file(name, global_tracker) {
+ return Ok(NameResult::File(file));
+ }
+
+ // Builtin types
if let Some(r) = self.builtin_type_name_table.get(name.name()) {
return Ok(NameResult::Type(*r));
}
+ // Builtin functions
if let Some(r) = self.builtin_function_name_table.get(name.name()) {
return Ok(NameResult::Function(*r));
}
- WErr::ne(
- NRErrs::CannotFindName(name.name().clone()),
- name.location().clone(),
- )
+ failed_to_find_error()
}
/// Gets the corresponding function for an operator
diff --git a/src/root/name_resolver/resolve.rs b/src/root/name_resolver/resolve.rs
index cfb9497..2c163da 100644
--- a/src/root/name_resolver/resolve.rs
+++ b/src/root/name_resolver/resolve.rs
@@ -8,6 +8,7 @@ use crate::root::parser::parse_function::FunctionToken;
use crate::root::parser::parse_toplevel::TopLevelTokens;
use crate::root::parser::path_storage::{FileID, PathStorage};
use crate::root::shared::common::FunctionID;
+use crate::root::unrandom::new_hashmap;
use itertools::Itertools;
use std::collections::{HashMap, HashSet};
@@ -21,14 +22,14 @@ pub fn resolve(
register_builtin(&mut global_table);
let mut ast = ast;
- let mut unprocessed_functions = HashMap::new();
+ let mut unprocessed_functions = new_hashmap();
let mut processed_files = HashSet::new();
let mut process_order = Vec::new();
- let f = *ast.keys().next().unwrap();
- let (file, first) = ast.remove_entry(&f).unwrap();
+ let (file, first) = ast.remove_entry(&FileID::main_file()).unwrap();
resolve_file(
file,
+ true,
first,
&mut ast,
&mut global_table,
@@ -47,6 +48,7 @@ pub fn resolve(
fn resolve_file(
file_id: FileID,
+ main_file: bool,
tokens: Vec,
ast: &mut HashMap>,
global_table: &mut GlobalTable,
@@ -86,9 +88,8 @@ fn resolve_file(
}
}
- global_table.scope_namespace(scope);
-
- resolve_names(tokens, global_table)?;
+ global_table.scope_namespace(file_id, scope);
+ resolve_names(tokens, global_table, unprocessed_functions)?;
processed_files.insert(file_id);
process_order.pop();
@@ -112,6 +113,7 @@ fn process_if_needed(
if let Some((file_id, tokens)) = ast.remove_entry(&file_id) {
resolve_file(
file_id,
+ false,
tokens,
ast,
global_table,
diff --git a/src/root/name_resolver/resolve_function_signatures.rs b/src/root/name_resolver/resolve_function_signatures.rs
index 2aa8c02..954af5b 100644
--- a/src/root/name_resolver/resolve_function_signatures.rs
+++ b/src/root/name_resolver/resolve_function_signatures.rs
@@ -1,3 +1,4 @@
+use crate::root::compiler::global_tracker::GlobalTracker;
use crate::root::errors::WErr;
use crate::root::name_resolver::name_resolvers::GlobalTable;
use crate::root::parser::parse_function::FunctionToken;
@@ -53,7 +54,7 @@ pub fn resolve_function_signature(
let mut args = Vec::new();
let return_type = if let Some(type_name) = function_token.return_type() {
- Some(global_table.resolve_to_type_ref(type_name)?)
+ Some(global_table.resolve_to_type_ref(type_name, None)?)
} else {
None
};
@@ -61,7 +62,7 @@ pub fn resolve_function_signature(
for (arg_name, arg_type) in function_token.parameters() {
args.push((
arg_name.clone(),
- global_table.resolve_to_type_ref(arg_type)?,
+ global_table.resolve_to_type_ref(arg_type, None)?,
))
}
diff --git a/src/root/name_resolver/resolve_names.rs b/src/root/name_resolver/resolve_names.rs
index 62988df..f6a8c75 100644
--- a/src/root/name_resolver/resolve_names.rs
+++ b/src/root/name_resolver/resolve_names.rs
@@ -1,3 +1,4 @@
+use crate::root::compiler::global_tracker::GlobalTracker;
use crate::root::errors::evaluable_errors::EvalErrs;
use crate::root::errors::name_resolver_errors::NRErrs;
use crate::root::errors::WErr;
@@ -85,7 +86,8 @@ impl Type for UserType {
pub fn resolve_names(
ast: Vec,
global_table: &mut GlobalTable,
-) -> Result, WErr> {
+ unprocessed_functions: &mut HashMap,
+) -> Result<(), WErr> {
let mut ast = ast;
// ? User types > 1; Builtin Types < -1
@@ -107,7 +109,6 @@ pub fn resolve_names(
}
let mut unsized_final_types: HashMap = new_hashmap();
- let mut unprocessed_functions: HashMap = new_hashmap();
for symbol in ast {
match symbol {
@@ -117,7 +118,7 @@ pub fn resolve_names(
let mut p_attributes: Vec<(SimpleNameToken, TypeRef)> = Vec::new();
for (name, type_name) in attributes {
- let type_ref = global_table.resolve_to_type_ref(&type_name)?;
+ let type_ref = global_table.resolve_to_type_ref(&type_name, None)?;
for (e_name, _) in &p_attributes {
if e_name.name() == name.name() {
@@ -140,6 +141,7 @@ pub fn resolve_names(
.resolve_to_type_ref(
&FullNameToken::new(location.clone(), FullNameTokens::Name(name, None))
.with_no_indirection(),
+ None,
)?
.type_id();
@@ -191,5 +193,5 @@ pub fn resolve_names(
}
// (final_types, type_names, unprocessed_functions)
- Ok(unprocessed_functions)
+ Ok(())
}
diff --git a/src/root/parser/parse.rs b/src/root/parser/parse.rs
index 7507c27..323cc69 100644
--- a/src/root/parser/parse.rs
+++ b/src/root/parser/parse.rs
@@ -14,7 +14,6 @@ use crate::root::parser::parse_imports::parse_imports;
use crate::root::parser::parse_toplevel;
use crate::root::parser::parse_toplevel::TopLevelTokens;
use crate::root::parser::path_storage::{FileID, PathStorage};
-use crate::root::shared::common::FunctionID;
pub type Span<'a> = LocatedSpan<&'a str, FileID>;
diff --git a/std/linked_list.why b/std/linked_list.why
index 507144c..1e3d05a 100644
--- a/std/linked_list.why
+++ b/std/linked_list.why
@@ -1,5 +1,3 @@
-use /std/linked_list;
-
struct LL {
first: &Node
}
diff --git a/std/test.why b/std/test.why
new file mode 100644
index 0000000..a450f16
--- /dev/null
+++ b/std/test.why
@@ -0,0 +1,4 @@
+
+fn foo() {
+ printi(7);
+}
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index 3b24420..c04088d 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,10 +1,7 @@
-- Add proper imports
+- Add proper imports ?
- Make the name resolver create a HashMap, Vec)>
- - Make the name resolver support uses and imports
- - Have the open set be a HashMap
- Select the FileID with the most functions to compile and do all of those first
- - When switching between files being compiled, rebuild the Tree used to find types when compiling
- Improve type system