diff options
Diffstat (limited to 'js/scripting-lang/final_table_case_test.txt')
-rw-r--r-- | js/scripting-lang/final_table_case_test.txt | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/js/scripting-lang/final_table_case_test.txt b/js/scripting-lang/final_table_case_test.txt deleted file mode 100644 index 50c33a8..0000000 --- a/js/scripting-lang/final_table_case_test.txt +++ /dev/null @@ -1,82 +0,0 @@ -/* Final comprehensive test of tables and case expressions */ - -/* ===== BASIC TABLE FUNCTIONALITY ===== */ -/* 1. Table creation and access */ -numbers : {1: 10, 2: 20, 3: 30}; -person : {name: "Alice", age: 30, active: true}; - -/* 2. Table access works */ -first : numbers[1]; -name : person.name; -age : person.age; -active : person.active; - -/* ===== CASE EXPRESSIONS WITH TABLES ===== */ -/* 3. Case expressions work with table values */ -result1 : case age of - 0 : 30 : "Person is 30" - 1 : _ : "Person is different age" -; - -/* 4. Case expressions work with boolean values */ -result2 : case active of - 0 : true : "Person is active" - 1 : false : "Person is inactive" -; - -/* 5. Case expressions work with array-like access */ -result3 : case numbers[2] of - 0 : 20 : "Second element is 20" - 1 : _ : "Unexpected second element" -; - -/* ===== FUNCTION REFERENCES IN TABLES ===== */ -/* 6. Functions can be stored in tables (but not called directly) */ -add : x y -> x + y; -multiply : x y -> x * y; -math_ops : {add: add, multiply: multiply}; - -/* ===== NESTED TABLES ===== */ -/* 7. Nested table access works */ -config : { - user: {name: "Bob", preferences: {theme: "dark"}}, - settings: {debug: true} -}; - -nested_name : config.user.name; -nested_theme : config.user.preferences.theme; -nested_debug : config.settings.debug; - -/* 8. Case expressions with nested table access */ -result4 : case nested_theme of - 0 : "dark" : "Dark theme enabled" - 1 : "light" : "Light theme enabled" - 2 : _ : "Unknown theme" -; - -result5 : case nested_debug of - 0 : true : "Debug mode enabled" - 1 : false : "Debug mode disabled" -; - -/* ===== OUTPUT RESULTS ===== */ -..out "Basic table access:"; -..out first; -..out name; -..out age; -..out active; - -..out "Case expressions with tables:"; -..out result1; -..out result2; -..out result3; -..out result4; -..out result5; - -..out "Nested table access:"; -..out nested_name; -..out nested_theme; -..out nested_debug; - -..out "Function references in tables (shows current limitation):"; -..out math_ops.add; \ No newline at end of file |