From 922fd32a01dd4060a9670a44971a14610e2ffd1a Mon Sep 17 00:00:00 2001 From: Sayantan Dasgupta Date: Sun, 8 Oct 2023 13:54:02 +0530 Subject: [PATCH 01/20] Made initial structure --- web/thesauruses/_meta/language_basics.json | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 web/thesauruses/_meta/language_basics.json diff --git a/web/thesauruses/_meta/language_basics.json b/web/thesauruses/_meta/language_basics.json new file mode 100644 index 000000000..09c15f191 --- /dev/null +++ b/web/thesauruses/_meta/language_basics.json @@ -0,0 +1,39 @@ +{ + "meta": { + "structure": "language_basics", + "structure_name": "Basics of A Programming Language" + }, + "categories": { + "Typing Systems": { + "statically_typed": "The programming language may be statically typed", + "dynamically_typed": "The programming language may be dynamically typed" + }, + "Paradigm Category": { + "procedural_language": "Language extensively uses procedures to explicitly detail how tasks are performed", + "functional_language": "Language extensively uses functions, emphasize immutability", + "object_oriented_language": "Language extensively uses the concept of objects, which encapsulate data and behaviour" + }, + "Level of Abstraction": { + "low_level_language": "Language provides minimal abstraction from the hardware architecture of the computer", + "high_level_language": "Language provides a more abstract and user-friendly interface for software development" + }, + "Execution Method": { + "compiled_language": "Language is translated into machine code or an intermediate form by a compiler before execution", + "interpreted_language": "Language is executed line by line by an interpreter at runtime withot a separate compilation step" + }, + "Application Domain": { + "general_purpose_language": "Language is designed to be versatile and applicable to a wide range of tasks and applications", + "domain_specific_language": "Language is designed to address specific application domains or industries" + }, + "Historical Perspective": { + "first_generation_language": "First generation of programming language providing minimal to no abstraction over computer hardware", + "second_generation_language": "Use mnemonic code and symbols to represent machine-level instructions, providing a more human-readable way to program", + "third_generation_language": "High level programming language designed for general purpose programming, providing a higher level of abstraction and greater ease of use", + "fourth_generation_language": "High level programming language designed for specific applications or domains, often using natural language-like syntax and focusing on rapid application development" + }, + "Memory Management": { + "manual_management": "Languages where memory has to be managed by the programmer manually", + "automatic_management": "Languages with an extensive support of automatic memory management" + } + } +} \ No newline at end of file From 57cccace13c119f732942d3f21bc5f80a0122119 Mon Sep 17 00:00:00 2001 From: Sayantan Dasgupta Date: Thu, 12 Oct 2023 09:04:56 +0530 Subject: [PATCH 02/20] Made a basic structure for language basics --- web/thesauruses/_meta/language_basics.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/web/thesauruses/_meta/language_basics.json b/web/thesauruses/_meta/language_basics.json index 09c15f191..8f07f2c08 100644 --- a/web/thesauruses/_meta/language_basics.json +++ b/web/thesauruses/_meta/language_basics.json @@ -25,12 +25,6 @@ "general_purpose_language": "Language is designed to be versatile and applicable to a wide range of tasks and applications", "domain_specific_language": "Language is designed to address specific application domains or industries" }, - "Historical Perspective": { - "first_generation_language": "First generation of programming language providing minimal to no abstraction over computer hardware", - "second_generation_language": "Use mnemonic code and symbols to represent machine-level instructions, providing a more human-readable way to program", - "third_generation_language": "High level programming language designed for general purpose programming, providing a higher level of abstraction and greater ease of use", - "fourth_generation_language": "High level programming language designed for specific applications or domains, often using natural language-like syntax and focusing on rapid application development" - }, "Memory Management": { "manual_management": "Languages where memory has to be managed by the programmer manually", "automatic_management": "Languages with an extensive support of automatic memory management" From 877686086d997f0410e297f791f8be92dde597ac Mon Sep 17 00:00:00 2001 From: Sayantan Dasgupta Date: Thu, 12 Oct 2023 20:31:24 +0530 Subject: [PATCH 03/20] Resolved meta_info issue, and added another feature for language basics --- web/thesauruses/_meta/language_basics.json | 6 ++++++ web/thesauruses/meta_info.json | 1 + 2 files changed, 7 insertions(+) diff --git a/web/thesauruses/_meta/language_basics.json b/web/thesauruses/_meta/language_basics.json index 8f07f2c08..8410bb735 100644 --- a/web/thesauruses/_meta/language_basics.json +++ b/web/thesauruses/_meta/language_basics.json @@ -28,6 +28,12 @@ "Memory Management": { "manual_management": "Languages where memory has to be managed by the programmer manually", "automatic_management": "Languages with an extensive support of automatic memory management" + }, + "Generation": { + "first_generation": "Language consists of binary code directly understood and executed by a computer's central processing unit (CPU) and represent the lowest level of programming abstraction", + "second_generation": "Language uses mnemonic codes and symbols to represent machine-level instructions, providing a more human-readable way to program and interact with a computer's hardware.", + "third_generation": "High-level programming languages designed for general-purpose software development, offering a higher level of abstraction and greater ease of use compared to low-level languages like assembly.", + "fourth_generation": "High-level programming languages designed for specific applications or domains, often using natural language-like syntax and focusing on rapid application development." } } } \ No newline at end of file diff --git a/web/thesauruses/meta_info.json b/web/thesauruses/meta_info.json index d04d4cd99..cc41fb3a2 100644 --- a/web/thesauruses/meta_info.json +++ b/web/thesauruses/meta_info.json @@ -31,6 +31,7 @@ "exception_handling": "Exception Handling", "functions": "Functions, Methods, and Subroutines", "io": "Input and Output", + "language_basics": "Basics of A Programming Language", "lists": "Lists, Arrays, and Hashed Lists", "operators": "Logical and Mathematical/Arithmetic Operators", "queues_stacks": "Queues and Stacks", From f4f04b348683f120ea889610ebaed763ccac9a03 Mon Sep 17 00:00:00 2001 From: Sayantan Dasgupta Date: Wed, 18 Oct 2023 13:28:11 +0530 Subject: [PATCH 04/20] Added some more features to language basics --- web/thesauruses/_meta/language_basics.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/web/thesauruses/_meta/language_basics.json b/web/thesauruses/_meta/language_basics.json index 8410bb735..0de09acf0 100644 --- a/web/thesauruses/_meta/language_basics.json +++ b/web/thesauruses/_meta/language_basics.json @@ -34,6 +34,24 @@ "second_generation": "Language uses mnemonic codes and symbols to represent machine-level instructions, providing a more human-readable way to program and interact with a computer's hardware.", "third_generation": "High-level programming languages designed for general-purpose software development, offering a higher level of abstraction and greater ease of use compared to low-level languages like assembly.", "fourth_generation": "High-level programming languages designed for specific applications or domains, often using natural language-like syntax and focusing on rapid application development." + }, + "Entry Point": { + "main_function": "Entry point of the program is the main function of the file", + "custom_function": "In some programming languages, custom functions can be made to be the entry point of a program", + "script_file": "Entry point of the program is the top of the script file" + }, + "Comments": { + "single_line": "Single line comments are used for brief explanations. Most common indicators of single line comments are // and #", + "multi_line": "Multi line comments span multiple lines. Used for longer explanations, or for commenting out code which you do not intend to execute. Usually multi line comments are enclosed within /* ... */, ''' ... ''' or \"\"\" ... \"\"\" ", + "documentation": "Some programming languages have specific comment syntax for generating documentation. For example, Javadoc comments can be generated using /** ", + "special": "Some programming languages have a special comment syntax for specific purposes" + }, + "Library and Framework support": { + "standard_libraries": "Programming Language is supported by an extensive network of standard libraries which are not required to be imported externally", + "extensive_frameworks": "Language has a strong network of external frameworks for supporting additional functionalities. Usually the external libraries are installed into the project using a package manager, and imported into the required file using the `import` keyword" + }, + "Minimal Program": { + "hello_world": "The most minimal program to understand all the basics is the Hello World program. Here you only need to print \"Hello World\" to the console/output of the programming language of your choice." } } } \ No newline at end of file From 5178fffe741f63c814b99cd343e66b89b2d63fe7 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sat, 28 Oct 2023 16:49:51 +0530 Subject: [PATCH 05/20] Added data types in lua --- web/thesauruses/lua/5/data_types.json | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 web/thesauruses/lua/5/data_types.json diff --git a/web/thesauruses/lua/5/data_types.json b/web/thesauruses/lua/5/data_types.json new file mode 100644 index 000000000..6c1ae86cc --- /dev/null +++ b/web/thesauruses/lua/5/data_types.json @@ -0,0 +1,72 @@ +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "data_types", + "language_version": "5.1" + }, + "concepts": { + "boolean": { + "name": "Boolean", + "not-implemented": true, + "comment": "The type boolean has two values, false and true and both nil and false make a condition false." + }, + "signed_integer_16_bit": { + "name": "Signed 16-bit integer", + "not-implemented": true + }, + "signed_integer_32_bit": { + "name": "Signed 32-bit integer", + "not-implemented": true + }, + "signed_integer_64_bit": { + "name": "Signed 64-bit integer", + "not-implemented": true + }, + "signed_integer_as_object": { + "name": "Signed object-based Integer", + "not-implemented": true, + "comment":"Lua does not have a built-in concept of distinct signed, object-based integers with the full range of operations and methods that you might find in languages like C++ or Java." + + }, + "signed_float_16_bit": { + "name": "Signed 16-bit floating point", + "not-implemented": true + }, + "signed_float_32_bit": { + "name": "Signed 32-bit floating point", + "not-implemented": true + }, + "signed_float_64_bit": { + "name": "Signed 64-bit floating point", + "not-implemented": true + }, + "signed_float_as_object": { + "name": "Signed object-based floating point", + "not-implemented": true, + "comment":"Same as integer applies here too." + }, + "string_as_object": { + "name": "String as an object", + "not-implemented": true, + "comment":"In Lua, strings are typically treated as sequences of characters and do not have built-in support for being 'signed' or 'object-based' in the same way that numbers do not." + }, + "string_as_array": { + "name": "String as an array of characters", + "not-implemented": true + }, + "complex_as_object": { + "name": "Complex Number as an object", + "not-implemented": true, + "comment":"In Lua, you can work with complex numbers by implementing your own data structure using tables or userdata, and define the necessary operations and methods for working with them." + }, + "real_number_part": { + "name": "Complex number real part", + "not-implemented": true + }, + "imaginary_number_part": { + "name": "Complex number imaginary part", + "not-implemented": true + } + } +} \ No newline at end of file From 57a283335d7dad4d88c5a8a0517699075cc8fb40 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sat, 28 Oct 2023 22:17:26 +0530 Subject: [PATCH 06/20] Update data_types.json --- web/thesauruses/lua/5/data_types.json | 130 +++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 5 deletions(-) diff --git a/web/thesauruses/lua/5/data_types.json b/web/thesauruses/lua/5/data_types.json index 6c1ae86cc..b45e08a98 100644 --- a/web/thesauruses/lua/5/data_types.json +++ b/web/thesauruses/lua/5/data_types.json @@ -8,65 +8,185 @@ "concepts": { "boolean": { "name": "Boolean", + "code": [ + "" + ], "not-implemented": true, "comment": "The type boolean has two values, false and true and both nil and false make a condition false." }, + "signed_integer_8_bit": { + "name": "Signed 8-bit integer", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_integer_8_bit": { + "name": "Unsigned 8-bit integer", + "code": [ + "" + ], + "not-implemented": true + }, "signed_integer_16_bit": { "name": "Signed 16-bit integer", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_integer_16_bit": { + "name": "Unsigned 16-bit integer", + "code": [ + "" + ], "not-implemented": true }, "signed_integer_32_bit": { "name": "Signed 32-bit integer", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_integer_32_bit": { + "name": "Unsigned 32-bit integer", + "code": [ + "" + ], "not-implemented": true }, "signed_integer_64_bit": { "name": "Signed 64-bit integer", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_integer_64_bit": { + "name": "Unsigned 64-bit integer", + "code": [ + "" + ], "not-implemented": true }, "signed_integer_as_object": { "name": "Signed object-based Integer", + "code": [ + "" + ], "not-implemented": true, "comment":"Lua does not have a built-in concept of distinct signed, object-based integers with the full range of operations and methods that you might find in languages like C++ or Java." - + }, + "unsigned_integer_as_object": { + "name": "Unsigned object-based Integer", + "code": [ + "" + ], + "not-implemented": true }, "signed_float_16_bit": { "name": "Signed 16-bit floating point", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_float_16_bit": { + "name": "Unsigned 16-bit floating point", + "code": [ + "" + ], "not-implemented": true }, "signed_float_32_bit": { "name": "Signed 32-bit floating point", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_float_32_bit": { + "name": "Unsigned 32-bit floating point", + "code": [ + "" + ], "not-implemented": true }, "signed_float_64_bit": { "name": "Signed 64-bit floating point", + "code": [ + "" + ], + "not-implemented": true + }, + "unsigned_float_64_bit": { + "name": "Unsigned 64-bit floating point", + "code": [ + "" + ], "not-implemented": true }, "signed_float_as_object": { "name": "Signed object-based floating point", + "code": [ + "" + ], "not-implemented": true, "comment":"Same as integer applies here too." }, + "unsigned_float_as_object": { + "name": "Unsigned object-based floating point", + "code": [ + "" + ], + "not-implemented": true + }, + "character": { + "name": "Character", + "code": [ + "" + ], + "not-implemented": true + }, "string_as_object": { "name": "String as an object", + "code": [ + "" + ], "not-implemented": true, - "comment":"In Lua, strings are typically treated as sequences of characters and do not have built-in support for being 'signed' or 'object-based' in the same way that numbers do not." + "comment":"In Lua, strings are not treated as objects in the same way that some other programming languages, like Python or JavaScript" }, "string_as_array": { "name": "String as an array of characters", - "not-implemented": true + "code": + [ + "local myString = 'Hello, World!'\nlocal firstChar = myString:sub(1, 1) -- Access the first character\nlocal fifthChar = myString:sub(5, 5) -- Access the fifth character\nprint(firstChar) -- Output: 'H'\nprint(fifthChar) -- Output: 'o'" + ], + "comment":"In Lua, strings are treated as arrays of characters." }, "complex_as_object": { "name": "Complex Number as an object", + "code": [ + "" + ], "not-implemented": true, - "comment":"In Lua, you can work with complex numbers by implementing your own data structure using tables or userdata, and define the necessary operations and methods for working with them." + "comment":"Lua does not have built-in support for complex numbers as a distinct data type like some other languages, such as Python." + }, "real_number_part": { "name": "Complex number real part", + "code": [ + "" + ], "not-implemented": true }, "imaginary_number_part": { "name": "Complex number imaginary part", + "code": [ + "" + ], "not-implemented": true } } -} \ No newline at end of file +} From c69bb1c06160a4a44590ffac21e7b3d96eab804f Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sat, 28 Oct 2023 22:26:36 +0530 Subject: [PATCH 07/20] Update data_types.json --- web/thesauruses/lua/5/data_types.json | 72 --------------------------- 1 file changed, 72 deletions(-) diff --git a/web/thesauruses/lua/5/data_types.json b/web/thesauruses/lua/5/data_types.json index b45e08a98..6dc5a20be 100644 --- a/web/thesauruses/lua/5/data_types.json +++ b/web/thesauruses/lua/5/data_types.json @@ -8,152 +8,89 @@ "concepts": { "boolean": { "name": "Boolean", - "code": [ - "" - ], "not-implemented": true, "comment": "The type boolean has two values, false and true and both nil and false make a condition false." }, "signed_integer_8_bit": { "name": "Signed 8-bit integer", - "code": [ - "" - ], "not-implemented": true }, "unsigned_integer_8_bit": { "name": "Unsigned 8-bit integer", - "code": [ - "" - ], "not-implemented": true }, "signed_integer_16_bit": { "name": "Signed 16-bit integer", - "code": [ - "" - ], "not-implemented": true }, "unsigned_integer_16_bit": { "name": "Unsigned 16-bit integer", - "code": [ - "" - ], "not-implemented": true }, "signed_integer_32_bit": { "name": "Signed 32-bit integer", - "code": [ - "" - ], "not-implemented": true }, "unsigned_integer_32_bit": { "name": "Unsigned 32-bit integer", - "code": [ - "" - ], "not-implemented": true }, "signed_integer_64_bit": { "name": "Signed 64-bit integer", - "code": [ - "" - ], "not-implemented": true }, "unsigned_integer_64_bit": { "name": "Unsigned 64-bit integer", - "code": [ - "" - ], "not-implemented": true }, "signed_integer_as_object": { "name": "Signed object-based Integer", - "code": [ - "" - ], "not-implemented": true, "comment":"Lua does not have a built-in concept of distinct signed, object-based integers with the full range of operations and methods that you might find in languages like C++ or Java." }, "unsigned_integer_as_object": { "name": "Unsigned object-based Integer", - "code": [ - "" - ], "not-implemented": true }, "signed_float_16_bit": { "name": "Signed 16-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "unsigned_float_16_bit": { "name": "Unsigned 16-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "signed_float_32_bit": { "name": "Signed 32-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "unsigned_float_32_bit": { "name": "Unsigned 32-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "signed_float_64_bit": { "name": "Signed 64-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "unsigned_float_64_bit": { "name": "Unsigned 64-bit floating point", - "code": [ - "" - ], "not-implemented": true }, "signed_float_as_object": { "name": "Signed object-based floating point", - "code": [ - "" - ], "not-implemented": true, "comment":"Same as integer applies here too." }, "unsigned_float_as_object": { "name": "Unsigned object-based floating point", - "code": [ - "" - ], "not-implemented": true }, "character": { "name": "Character", - "code": [ - "" - ], "not-implemented": true }, "string_as_object": { "name": "String as an object", - "code": [ - "" - ], "not-implemented": true, "comment":"In Lua, strings are not treated as objects in the same way that some other programming languages, like Python or JavaScript" }, @@ -167,25 +104,16 @@ }, "complex_as_object": { "name": "Complex Number as an object", - "code": [ - "" - ], "not-implemented": true, "comment":"Lua does not have built-in support for complex numbers as a distinct data type like some other languages, such as Python." }, "real_number_part": { "name": "Complex number real part", - "code": [ - "" - ], "not-implemented": true }, "imaginary_number_part": { "name": "Complex number imaginary part", - "code": [ - "" - ], "not-implemented": true } } From 5c31037fd741d0dfea71920df29fd82f787a992a Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Sat, 28 Oct 2023 23:25:35 +0200 Subject: [PATCH 08/20] Init github action check docker build Now on pull request only --- .github/workflows/check-docker-build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/check-docker-build.yml diff --git a/.github/workflows/check-docker-build.yml b/.github/workflows/check-docker-build.yml new file mode 100644 index 000000000..22732c34e --- /dev/null +++ b/.github/workflows/check-docker-build.yml @@ -0,0 +1,13 @@ +name: Check Docker Build + +on: + pull_request: + +jobs: + check: + name: Check Docker Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Docker Compose Build + run: docker-compose build \ No newline at end of file From e5667140cdf48456ebdaeb30ee152264e06a649c Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Sun, 29 Oct 2023 11:37:32 +0100 Subject: [PATCH 09/20] Added powershell as new langage with classes as first concept --- web/thesauruses/meta_info.json | 1 + web/thesauruses/powershell/7/classes.json | 159 ++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 web/thesauruses/powershell/7/classes.json diff --git a/web/thesauruses/meta_info.json b/web/thesauruses/meta_info.json index d04d4cd99..da2b9b303 100644 --- a/web/thesauruses/meta_info.json +++ b/web/thesauruses/meta_info.json @@ -15,6 +15,7 @@ "objectivec": "Objective-C", "perl": "Perl", "php": "PHP", + "powershell": "PowerShell", "python": "Python", "r":"R", "ruby": "Ruby", diff --git a/web/thesauruses/powershell/7/classes.json b/web/thesauruses/powershell/7/classes.json new file mode 100644 index 000000000..e0e53d57e --- /dev/null +++ b/web/thesauruses/powershell/7/classes.json @@ -0,0 +1,159 @@ +{ + "meta": { + "language": "powershell", + "language_name": "Powershell", + "structure": "classes", + "language_version": "7" + }, + "concepts": { + "normal_class": { + "name": "Normal class", + "code": [ + "class ClassName {", + " # class body", + "}" + ] + }, + "abstract_class": { + "name": "Abstract class", + "not-implemented": true + }, + "interface": { + "name": "Interface", + "not-implemented": true + }, + "read_only_class": { + "name": "Read-only class", + "not-implemented": true + }, + "static_class": { + "name": "Static class", + "not-implemented": true + }, + "inner_class": { + "name": "Inner class", + "not-implemented": true + }, + "packages": { + "name": "Packages", + "code": [ + "using namespace Your.Package" + ] + }, + "class_with_generic_type": { + "name": "Class with a generic type", + "not-implemented": true + }, + "private_variables": { + "name": "Defining private variables", + "code": [ + "class ClassName {", + " hidden [string] $privateVariable = \"private\";", + "}" + ], + "comment": "It's not possible to define private variables in Powershell. The closest approximation is to define a hidden variable." + }, + "protected_variables": { + "name": "Defining protected variables", + "not-implemented": true + }, + "public_variables": { + "name": "Defining public variables", + "code": [ + "class ClassName {", + " [string] $publicVariable = \"public\";", + "}" + ] + }, + "static_variables": { + "name": "Defining static variables", + "code": [ + "class ClassName {", + " static [string] $staticVariable = \"static\";", + "}" + ] + }, + "private_functions": { + "name": "Defining private functions", + "code": [ + "class ClassName {", + " hidden [string] privateFunction() {", + " return \"private\";", + " }", + "}" + ], + "comment": "It's not possible to define private functions in Powershell. The closest approximation is to define a hidden function." + }, + "protected_functions": { + "name": "Defining protected functions", + "not-implemented": true + }, + "public_functions": { + "name": "Defining public functions", + "code": [ + "class ClassName {", + " [string] publicFunction() {", + " return \"public\";", + " }", + "}" + ] + }, + "static_functions": { + "name": "Defining static functions", + "code": [ + "class ClassName {", + " static [string] staticFunction() {", + " return \"static\";", + " }", + "}" + ] + }, + "extends_class": { + "name": "Class that inherits/extends another class", + "code": [ + "class ClassName : BaseClass {", + " # class body", + "}" + ] + }, + "extending_interface": { + "name": "Class/Interface that inherits/extends another class/interface", + "not-implemented": true + }, + "calling_superclass_functions": { + "name": "Calling a superclass function", + "code": [ + "" + ] + }, + "overriding_superclass_functions": { + "name": "Overriding a superclass function", + "not-implemented": true + }, + "instantiating_object": { + "name": "Instantiating a new object", + "code": [ + "$object = [ClassName]::new()", + "$object = New-Object ClassName" + ] + }, + "instantiating_polymorphic_object": { + "name": "Instantiating a polymorphic object", + "not-implemented": true + }, + "implement_constructor": { + "name": "Implementing a class constructor", + "code": [ + "class ClassName {", + " ClassName() {", + " # constructor body", + " }", + "}" + ] + }, + "implement_deconstructor": { + "name": "Implementing a class deconstructor", + "not-implemented": true + } + } +} \ No newline at end of file From 224eb983d6527b2cb930eea27a75c59a87cb066c Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:10:47 +0530 Subject: [PATCH 10/20] Add files via upload --- web/thesauruses/lua/5/functions.json | 118 +++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 web/thesauruses/lua/5/functions.json diff --git a/web/thesauruses/lua/5/functions.json b/web/thesauruses/lua/5/functions.json new file mode 100644 index 000000000..5ae70a75b --- /dev/null +++ b/web/thesauruses/lua/5/functions.json @@ -0,0 +1,118 @@ +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "functions", + "language_version": "5.1" + }, + "concepts": { + "void_function_no_parameters": { + "name": "Function that does not return a value and takes no parameters", + "code": [ + "function greet()\n\tprint(\"Hello, world!\")\nend\n\n-- Calling the function\ngreet()" + ] + }, + "void_function_with_parameters": { + "name": "Function that does not return a value and that takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\n\tlocal sum = a + b\n\treturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)" + ] + }, + "void_function_with_keyword_parameters": { + "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", + "code": [ + "function myFunction(params)\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\t-- Your code here, using param1, param2, param3\n\tprint(\"param1: \" .. param1)\n\tprint(\"param2: \" .. param2)\n\tprint(\"param3: \" .. param3)\nend\n\n-- Calling the function with keyword parameters\nmyFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",\n}\nmyFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",\n}\n\n-- OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ], + "comment":"Lua doesn't have built-in support for named or keyword parameters like some other programming languages do, such as Python. However, you can emulate keyword parameters using a table (Lua's equivalent to dictionaries or maps) and passing named values within that table as above." + + }, + "void_function_variable_parameters": { + "name": "Function that does not return a value and function that takes an unknown number of parameters", + "code": [ + "function myFunction(...)\n\tlocal params = {...}\n\tfor i, v in ipairs(params) do\n\t\tprint(\"Parameter \" .. i .. \": \" .. v)\n\tend\nend\n\n-- Calling the function with different numbers of parameters\nmyFunction(1, 2, 3)\nmyFunction(\"apple\", \"banana\")\nmyFunction(\"cat\")\n\n--OutPut:\nParameter 1: 1\nParameter 2: 2\nParameter 3: 3\nParameter 1: apple\nParameter 2: banana\nParameter 1: cat" + ] + }, + "return_value_function_no_parameters": { + "name": "Function that returns a value and takes no parameters", + "code": [ + "function generateRandomNumber()\n\treturn math.random(1, 100)\nend\n\n-- Calling the function and storing the result in a variable\nlocal randomValue = generateRandomNumber()\nprint(\"Random number: \" .. randomValue)" + ] + }, + "return_value_function_with_parameters": { + "name": "Function that returns a value and takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\nlocal sum = a + b\nreturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)\n\n-- OutPut:\nThe sum is: 8" + ] + }, + "return_value_function_with_keyword_parameters": { + "name": "Function that returns a value and takes 0 or more defined keyword parameters", + "code": [ + "function myFunction(params)\n\t-- Access parameters using named fields\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\n\t-- Perform some operations\n\tlocal result = param1 .. \", \" .. param2 .. \", \" .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Calling the function with a table containing named parameters\nlocal output1 = myFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",}\n\nlocal output2 = myFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",}\n\nprint(\"Output 1: \" .. output1)\nprint(\"Output 2: \" .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" + ], + "comment":"In Lua, you can't use keyword parameters as you would in some other programming languages like Python. However, you can achieve a similar effect by passing a table with named fields as a single parameter to the function as above." + }, + "return_value_function_variable_parameters": { + "name": "Function that returns a value and takes an unknown number of parameters", + "code": [ + "function sum(...)\n\tlocal result = 0\n\n\tfor i, v in ipairs({...}) do\n\t\tresult = result + v\n\tend\n\n\treturn result\nend\n\n-- Calling the function with different numbers of parameters\nlocal result1 = sum(1, 2, 3)\nlocal result2 = sum(5, 10, 15, 20)\n\nprint(\"Result 1: \" .. result1)\nprint(\"Result 2: \" .. result2)\n\n--OutPut\nResult 1: 6\nResult 2: 50" + ] + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": [ + "local myFunction = function()\n\tprint(\"Anonymous function with no parameters\")\nend\n\nmyFunction()\n--OutPut\n\nAnonymous function with no parameters" + ] + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": [ + "local add = function(a, b)\n\treturn a + b\nend\n\nlocal result = add(5, 3)\nprint(\"The sum is: \" .. result)\n--OutPut:\nThe sum is: 8" + ] + }, + "anonymous_function_with_keyword_parameters": { + "name": "Anonymous function that takes 0 or more defined keyword parameters", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n--OutPut\n\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ] + }, + "anonymous_function_variable_parameters": { + "name": "Anonymous function that takes an unknown number of parameters", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n--OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ], + "comment":"In Lua, anonymous functions (also known as closures or lambdas) typically do not natively support keyword parameters as in some other programming languages. However, you can achieve a similar effect by passing a table with named fields as a single argument to the anonymous function as above." + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": [ + "local myFunction = function()\n\treturn 'Hello from the anonymous function!'\nend\n\n-- Call the anonymous function and capture the result\nlocal result = myFunction()\n\n-- Print the result\nprint(result)\n\nOutPut:\nHello from the anonymous function!" + ] + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": [ + "local add = function(a, b)\n\treturn a + b\nend\n\n-- Call the anonymous function with parameters and capture the result\nlocal result = add(5, 3)\n\n-- Print the result\nprint('The sum is: ' .. result)\n\n--OutPut:\nThe sum is: 8" + ] + }, + "anonymous_function_with_keyword_parameters_with_return": { + "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tlocal result = param1 .. ', ' .. param2 .. ', ' .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Call the anonymous function with keyword parameters and capture the result\nlocal output1 = myFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nlocal output2 = myFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n-- Print the results\nprint('Output 1: ' .. output1)\nprint('Output 2: ' .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" + ] + }, + "anonymous_function_variable_parameters_with_return": { + "name": "Anonymous function that takes an unknown number of parameters and returns a value", + "code": [ + "local myFunction = function(...)\n\tlocal params = {...}\n\tlocal result = 'Parameters: '\n\n\tfor i, v in ipairs(params) do\n\t\tresult = result .. 'Parameter ' .. i .. ': ' .. v .. ' '\n\tend\n\n\treturn result\nend\n\n-- Call the anonymous function with different numbers of parameters and capture the result\nlocal result1 = myFunction(1, 2, 3)\nlocal result2 = myFunction('apple', 'banana')\nlocal result3 = myFunction('cat')\n\n-- Print the results\nprint(result1)\nprint(result2)\nprint(result3)\n\n--OutPut:\nParameters: Parameter 1: 1 Parameter 2: 2 Parameter 3: 3 \nParameters: Parameter 1: apple Parameter 2: banana \nParameters: Parameter 1: cat" + ] + }, + "call_subroutine": { + "name": "Call subroutine", + "not-implemented": "true" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "not-implemented": "true" + } + } +} \ No newline at end of file From 83bc19add814ac1801b553aa421551429792e5e3 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:13:45 +0530 Subject: [PATCH 11/20] Delete web/thesauruses/lua/5/functions.json --- web/thesauruses/lua/5/functions.json | 118 --------------------------- 1 file changed, 118 deletions(-) delete mode 100644 web/thesauruses/lua/5/functions.json diff --git a/web/thesauruses/lua/5/functions.json b/web/thesauruses/lua/5/functions.json deleted file mode 100644 index 5ae70a75b..000000000 --- a/web/thesauruses/lua/5/functions.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "meta": { - "language": "lua", - "language_name": "Lua", - "structure": "functions", - "language_version": "5.1" - }, - "concepts": { - "void_function_no_parameters": { - "name": "Function that does not return a value and takes no parameters", - "code": [ - "function greet()\n\tprint(\"Hello, world!\")\nend\n\n-- Calling the function\ngreet()" - ] - }, - "void_function_with_parameters": { - "name": "Function that does not return a value and that takes 1 or more defined parameters", - "code": [ - "function addNumbers(a, b)\n\tlocal sum = a + b\n\treturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)" - ] - }, - "void_function_with_keyword_parameters": { - "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", - "code": [ - "function myFunction(params)\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\t-- Your code here, using param1, param2, param3\n\tprint(\"param1: \" .. param1)\n\tprint(\"param2: \" .. param2)\n\tprint(\"param3: \" .. param3)\nend\n\n-- Calling the function with keyword parameters\nmyFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",\n}\nmyFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",\n}\n\n-- OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ], - "comment":"Lua doesn't have built-in support for named or keyword parameters like some other programming languages do, such as Python. However, you can emulate keyword parameters using a table (Lua's equivalent to dictionaries or maps) and passing named values within that table as above." - - }, - "void_function_variable_parameters": { - "name": "Function that does not return a value and function that takes an unknown number of parameters", - "code": [ - "function myFunction(...)\n\tlocal params = {...}\n\tfor i, v in ipairs(params) do\n\t\tprint(\"Parameter \" .. i .. \": \" .. v)\n\tend\nend\n\n-- Calling the function with different numbers of parameters\nmyFunction(1, 2, 3)\nmyFunction(\"apple\", \"banana\")\nmyFunction(\"cat\")\n\n--OutPut:\nParameter 1: 1\nParameter 2: 2\nParameter 3: 3\nParameter 1: apple\nParameter 2: banana\nParameter 1: cat" - ] - }, - "return_value_function_no_parameters": { - "name": "Function that returns a value and takes no parameters", - "code": [ - "function generateRandomNumber()\n\treturn math.random(1, 100)\nend\n\n-- Calling the function and storing the result in a variable\nlocal randomValue = generateRandomNumber()\nprint(\"Random number: \" .. randomValue)" - ] - }, - "return_value_function_with_parameters": { - "name": "Function that returns a value and takes 1 or more defined parameters", - "code": [ - "function addNumbers(a, b)\nlocal sum = a + b\nreturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)\n\n-- OutPut:\nThe sum is: 8" - ] - }, - "return_value_function_with_keyword_parameters": { - "name": "Function that returns a value and takes 0 or more defined keyword parameters", - "code": [ - "function myFunction(params)\n\t-- Access parameters using named fields\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\n\t-- Perform some operations\n\tlocal result = param1 .. \", \" .. param2 .. \", \" .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Calling the function with a table containing named parameters\nlocal output1 = myFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",}\n\nlocal output2 = myFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",}\n\nprint(\"Output 1: \" .. output1)\nprint(\"Output 2: \" .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" - ], - "comment":"In Lua, you can't use keyword parameters as you would in some other programming languages like Python. However, you can achieve a similar effect by passing a table with named fields as a single parameter to the function as above." - }, - "return_value_function_variable_parameters": { - "name": "Function that returns a value and takes an unknown number of parameters", - "code": [ - "function sum(...)\n\tlocal result = 0\n\n\tfor i, v in ipairs({...}) do\n\t\tresult = result + v\n\tend\n\n\treturn result\nend\n\n-- Calling the function with different numbers of parameters\nlocal result1 = sum(1, 2, 3)\nlocal result2 = sum(5, 10, 15, 20)\n\nprint(\"Result 1: \" .. result1)\nprint(\"Result 2: \" .. result2)\n\n--OutPut\nResult 1: 6\nResult 2: 50" - ] - }, - "anonymous_function_no_parameters": { - "name": "Anonymous function that takes no parameters", - "code": [ - "local myFunction = function()\n\tprint(\"Anonymous function with no parameters\")\nend\n\nmyFunction()\n--OutPut\n\nAnonymous function with no parameters" - ] - }, - "anonymous_function_with_parameters": { - "name": "Anonymous function that takes 1 or more defined parameters", - "code": [ - "local add = function(a, b)\n\treturn a + b\nend\n\nlocal result = add(5, 3)\nprint(\"The sum is: \" .. result)\n--OutPut:\nThe sum is: 8" - ] - }, - "anonymous_function_with_keyword_parameters": { - "name": "Anonymous function that takes 0 or more defined keyword parameters", - "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n--OutPut\n\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ] - }, - "anonymous_function_variable_parameters": { - "name": "Anonymous function that takes an unknown number of parameters", - "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n--OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ], - "comment":"In Lua, anonymous functions (also known as closures or lambdas) typically do not natively support keyword parameters as in some other programming languages. However, you can achieve a similar effect by passing a table with named fields as a single argument to the anonymous function as above." - }, - "anonymous_function_no_parameters_with_return": { - "name": "Anonymous function that takes no parameters and returns a value", - "code": [ - "local myFunction = function()\n\treturn 'Hello from the anonymous function!'\nend\n\n-- Call the anonymous function and capture the result\nlocal result = myFunction()\n\n-- Print the result\nprint(result)\n\nOutPut:\nHello from the anonymous function!" - ] - }, - "anonymous_function_with_parameters_with_return": { - "name": "Anonymous function that takes 1 or more defined parameters and returns a value", - "code": [ - "local add = function(a, b)\n\treturn a + b\nend\n\n-- Call the anonymous function with parameters and capture the result\nlocal result = add(5, 3)\n\n-- Print the result\nprint('The sum is: ' .. result)\n\n--OutPut:\nThe sum is: 8" - ] - }, - "anonymous_function_with_keyword_parameters_with_return": { - "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", - "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tlocal result = param1 .. ', ' .. param2 .. ', ' .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Call the anonymous function with keyword parameters and capture the result\nlocal output1 = myFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nlocal output2 = myFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n-- Print the results\nprint('Output 1: ' .. output1)\nprint('Output 2: ' .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" - ] - }, - "anonymous_function_variable_parameters_with_return": { - "name": "Anonymous function that takes an unknown number of parameters and returns a value", - "code": [ - "local myFunction = function(...)\n\tlocal params = {...}\n\tlocal result = 'Parameters: '\n\n\tfor i, v in ipairs(params) do\n\t\tresult = result .. 'Parameter ' .. i .. ': ' .. v .. ' '\n\tend\n\n\treturn result\nend\n\n-- Call the anonymous function with different numbers of parameters and capture the result\nlocal result1 = myFunction(1, 2, 3)\nlocal result2 = myFunction('apple', 'banana')\nlocal result3 = myFunction('cat')\n\n-- Print the results\nprint(result1)\nprint(result2)\nprint(result3)\n\n--OutPut:\nParameters: Parameter 1: 1 Parameter 2: 2 Parameter 3: 3 \nParameters: Parameter 1: apple Parameter 2: banana \nParameters: Parameter 1: cat" - ] - }, - "call_subroutine": { - "name": "Call subroutine", - "not-implemented": "true" - }, - "return_from_subroutine": { - "name": "Return from subroutine", - "not-implemented": "true" - } - } -} \ No newline at end of file From 9d74e8a9d962cdcbdc3fd4c7c29a30102c5000d2 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Sun, 29 Oct 2023 22:58:58 +0530 Subject: [PATCH 12/20] Add files via upload --- web/thesauruses/lua/5/functions.json | 118 +++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 web/thesauruses/lua/5/functions.json diff --git a/web/thesauruses/lua/5/functions.json b/web/thesauruses/lua/5/functions.json new file mode 100644 index 000000000..5ae70a75b --- /dev/null +++ b/web/thesauruses/lua/5/functions.json @@ -0,0 +1,118 @@ +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "functions", + "language_version": "5.1" + }, + "concepts": { + "void_function_no_parameters": { + "name": "Function that does not return a value and takes no parameters", + "code": [ + "function greet()\n\tprint(\"Hello, world!\")\nend\n\n-- Calling the function\ngreet()" + ] + }, + "void_function_with_parameters": { + "name": "Function that does not return a value and that takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\n\tlocal sum = a + b\n\treturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)" + ] + }, + "void_function_with_keyword_parameters": { + "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", + "code": [ + "function myFunction(params)\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\t-- Your code here, using param1, param2, param3\n\tprint(\"param1: \" .. param1)\n\tprint(\"param2: \" .. param2)\n\tprint(\"param3: \" .. param3)\nend\n\n-- Calling the function with keyword parameters\nmyFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",\n}\nmyFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",\n}\n\n-- OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ], + "comment":"Lua doesn't have built-in support for named or keyword parameters like some other programming languages do, such as Python. However, you can emulate keyword parameters using a table (Lua's equivalent to dictionaries or maps) and passing named values within that table as above." + + }, + "void_function_variable_parameters": { + "name": "Function that does not return a value and function that takes an unknown number of parameters", + "code": [ + "function myFunction(...)\n\tlocal params = {...}\n\tfor i, v in ipairs(params) do\n\t\tprint(\"Parameter \" .. i .. \": \" .. v)\n\tend\nend\n\n-- Calling the function with different numbers of parameters\nmyFunction(1, 2, 3)\nmyFunction(\"apple\", \"banana\")\nmyFunction(\"cat\")\n\n--OutPut:\nParameter 1: 1\nParameter 2: 2\nParameter 3: 3\nParameter 1: apple\nParameter 2: banana\nParameter 1: cat" + ] + }, + "return_value_function_no_parameters": { + "name": "Function that returns a value and takes no parameters", + "code": [ + "function generateRandomNumber()\n\treturn math.random(1, 100)\nend\n\n-- Calling the function and storing the result in a variable\nlocal randomValue = generateRandomNumber()\nprint(\"Random number: \" .. randomValue)" + ] + }, + "return_value_function_with_parameters": { + "name": "Function that returns a value and takes 1 or more defined parameters", + "code": [ + "function addNumbers(a, b)\nlocal sum = a + b\nreturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)\n\n-- OutPut:\nThe sum is: 8" + ] + }, + "return_value_function_with_keyword_parameters": { + "name": "Function that returns a value and takes 0 or more defined keyword parameters", + "code": [ + "function myFunction(params)\n\t-- Access parameters using named fields\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\n\t-- Perform some operations\n\tlocal result = param1 .. \", \" .. param2 .. \", \" .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Calling the function with a table containing named parameters\nlocal output1 = myFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",}\n\nlocal output2 = myFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",}\n\nprint(\"Output 1: \" .. output1)\nprint(\"Output 2: \" .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" + ], + "comment":"In Lua, you can't use keyword parameters as you would in some other programming languages like Python. However, you can achieve a similar effect by passing a table with named fields as a single parameter to the function as above." + }, + "return_value_function_variable_parameters": { + "name": "Function that returns a value and takes an unknown number of parameters", + "code": [ + "function sum(...)\n\tlocal result = 0\n\n\tfor i, v in ipairs({...}) do\n\t\tresult = result + v\n\tend\n\n\treturn result\nend\n\n-- Calling the function with different numbers of parameters\nlocal result1 = sum(1, 2, 3)\nlocal result2 = sum(5, 10, 15, 20)\n\nprint(\"Result 1: \" .. result1)\nprint(\"Result 2: \" .. result2)\n\n--OutPut\nResult 1: 6\nResult 2: 50" + ] + }, + "anonymous_function_no_parameters": { + "name": "Anonymous function that takes no parameters", + "code": [ + "local myFunction = function()\n\tprint(\"Anonymous function with no parameters\")\nend\n\nmyFunction()\n--OutPut\n\nAnonymous function with no parameters" + ] + }, + "anonymous_function_with_parameters": { + "name": "Anonymous function that takes 1 or more defined parameters", + "code": [ + "local add = function(a, b)\n\treturn a + b\nend\n\nlocal result = add(5, 3)\nprint(\"The sum is: \" .. result)\n--OutPut:\nThe sum is: 8" + ] + }, + "anonymous_function_with_keyword_parameters": { + "name": "Anonymous function that takes 0 or more defined keyword parameters", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n--OutPut\n\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ] + }, + "anonymous_function_variable_parameters": { + "name": "Anonymous function that takes an unknown number of parameters", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n--OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" + ], + "comment":"In Lua, anonymous functions (also known as closures or lambdas) typically do not natively support keyword parameters as in some other programming languages. However, you can achieve a similar effect by passing a table with named fields as a single argument to the anonymous function as above." + }, + "anonymous_function_no_parameters_with_return": { + "name": "Anonymous function that takes no parameters and returns a value", + "code": [ + "local myFunction = function()\n\treturn 'Hello from the anonymous function!'\nend\n\n-- Call the anonymous function and capture the result\nlocal result = myFunction()\n\n-- Print the result\nprint(result)\n\nOutPut:\nHello from the anonymous function!" + ] + }, + "anonymous_function_with_parameters_with_return": { + "name": "Anonymous function that takes 1 or more defined parameters and returns a value", + "code": [ + "local add = function(a, b)\n\treturn a + b\nend\n\n-- Call the anonymous function with parameters and capture the result\nlocal result = add(5, 3)\n\n-- Print the result\nprint('The sum is: ' .. result)\n\n--OutPut:\nThe sum is: 8" + ] + }, + "anonymous_function_with_keyword_parameters_with_return": { + "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", + "code": [ + "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tlocal result = param1 .. ', ' .. param2 .. ', ' .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Call the anonymous function with keyword parameters and capture the result\nlocal output1 = myFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nlocal output2 = myFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n-- Print the results\nprint('Output 1: ' .. output1)\nprint('Output 2: ' .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" + ] + }, + "anonymous_function_variable_parameters_with_return": { + "name": "Anonymous function that takes an unknown number of parameters and returns a value", + "code": [ + "local myFunction = function(...)\n\tlocal params = {...}\n\tlocal result = 'Parameters: '\n\n\tfor i, v in ipairs(params) do\n\t\tresult = result .. 'Parameter ' .. i .. ': ' .. v .. ' '\n\tend\n\n\treturn result\nend\n\n-- Call the anonymous function with different numbers of parameters and capture the result\nlocal result1 = myFunction(1, 2, 3)\nlocal result2 = myFunction('apple', 'banana')\nlocal result3 = myFunction('cat')\n\n-- Print the results\nprint(result1)\nprint(result2)\nprint(result3)\n\n--OutPut:\nParameters: Parameter 1: 1 Parameter 2: 2 Parameter 3: 3 \nParameters: Parameter 1: apple Parameter 2: banana \nParameters: Parameter 1: cat" + ] + }, + "call_subroutine": { + "name": "Call subroutine", + "not-implemented": "true" + }, + "return_from_subroutine": { + "name": "Return from subroutine", + "not-implemented": "true" + } + } +} \ No newline at end of file From e88de6252ed1f615edc6a50578deeac9b9697862 Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD <11415595+ulyssear@users.noreply.github.com> Date: Sun, 29 Oct 2023 20:27:59 +0100 Subject: [PATCH 13/20] Added not implemented for superclass function --- web/thesauruses/powershell/7/classes.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/thesauruses/powershell/7/classes.json b/web/thesauruses/powershell/7/classes.json index e0e53d57e..5ee3121ae 100644 --- a/web/thesauruses/powershell/7/classes.json +++ b/web/thesauruses/powershell/7/classes.json @@ -122,9 +122,7 @@ }, "calling_superclass_functions": { "name": "Calling a superclass function", - "code": [ - "" - ] + "not-implemented": true }, "overriding_superclass_functions": { "name": "Overriding a superclass function", @@ -156,4 +154,4 @@ "not-implemented": true } } -} \ No newline at end of file +} From 356e4b6cd4646a022030e91f16220fa962c40241 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Mon, 30 Oct 2023 02:02:54 +0530 Subject: [PATCH 14/20] Update functions.json --- web/thesauruses/lua/5/functions.json | 48 +++++++++++----------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/web/thesauruses/lua/5/functions.json b/web/thesauruses/lua/5/functions.json index 5ae70a75b..7bbabf3c5 100644 --- a/web/thesauruses/lua/5/functions.json +++ b/web/thesauruses/lua/5/functions.json @@ -9,101 +9,89 @@ "void_function_no_parameters": { "name": "Function that does not return a value and takes no parameters", "code": [ - "function greet()\n\tprint(\"Hello, world!\")\nend\n\n-- Calling the function\ngreet()" + "function greet()\nend" ] }, "void_function_with_parameters": { "name": "Function that does not return a value and that takes 1 or more defined parameters", "code": [ - "function addNumbers(a, b)\n\tlocal sum = a + b\n\treturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)" + "function addNumbers(a, b)\nend" ] }, "void_function_with_keyword_parameters": { "name": "Function that does not return a value and that takes 0 or more defined keyword parameters", - "code": [ - "function myFunction(params)\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\t-- Your code here, using param1, param2, param3\n\tprint(\"param1: \" .. param1)\n\tprint(\"param2: \" .. param2)\n\tprint(\"param3: \" .. param3)\nend\n\n-- Calling the function with keyword parameters\nmyFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",\n}\nmyFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",\n}\n\n-- OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ], - "comment":"Lua doesn't have built-in support for named or keyword parameters like some other programming languages do, such as Python. However, you can emulate keyword parameters using a table (Lua's equivalent to dictionaries or maps) and passing named values within that table as above." - + "not-implemented": "true" }, "void_function_variable_parameters": { "name": "Function that does not return a value and function that takes an unknown number of parameters", "code": [ - "function myFunction(...)\n\tlocal params = {...}\n\tfor i, v in ipairs(params) do\n\t\tprint(\"Parameter \" .. i .. \": \" .. v)\n\tend\nend\n\n-- Calling the function with different numbers of parameters\nmyFunction(1, 2, 3)\nmyFunction(\"apple\", \"banana\")\nmyFunction(\"cat\")\n\n--OutPut:\nParameter 1: 1\nParameter 2: 2\nParameter 3: 3\nParameter 1: apple\nParameter 2: banana\nParameter 1: cat" + "function myFunction(...)\nend" ] }, "return_value_function_no_parameters": { "name": "Function that returns a value and takes no parameters", "code": [ - "function generateRandomNumber()\n\treturn math.random(1, 100)\nend\n\n-- Calling the function and storing the result in a variable\nlocal randomValue = generateRandomNumber()\nprint(\"Random number: \" .. randomValue)" + "function generateRandomNumber()\nreturn true\nend" ] }, "return_value_function_with_parameters": { "name": "Function that returns a value and takes 1 or more defined parameters", "code": [ - "function addNumbers(a, b)\nlocal sum = a + b\nreturn sum\nend\n\n-- Calling the function and storing the result in a variable\nlocal result = addNumbers(5, 3)\nprint(\"The sum is: \" .. result)\n\n-- OutPut:\nThe sum is: 8" + "function addNumbers(a, b)\nreturn a,b\nend" ] }, "return_value_function_with_keyword_parameters": { "name": "Function that returns a value and takes 0 or more defined keyword parameters", - "code": [ - "function myFunction(params)\n\t-- Access parameters using named fields\n\tlocal param1 = params.param1 or \"default_value1\"\n\tlocal param2 = params.param2 or \"default_value2\"\n\tlocal param3 = params.param3 or \"default_value3\"\n\n\t-- Perform some operations\n\tlocal result = param1 .. \", \" .. param2 .. \", \" .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Calling the function with a table containing named parameters\nlocal output1 = myFunction{\n\tparam1 = \"value1\",\n\tparam2 = \"value2\",}\n\nlocal output2 = myFunction{\n\tparam2 = \"value2\",\n\tparam3 = \"value3\",}\n\nprint(\"Output 1: \" .. output1)\nprint(\"Output 2: \" .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" - ], - "comment":"In Lua, you can't use keyword parameters as you would in some other programming languages like Python. However, you can achieve a similar effect by passing a table with named fields as a single parameter to the function as above." + "not-implemented": "true" }, "return_value_function_variable_parameters": { "name": "Function that returns a value and takes an unknown number of parameters", "code": [ - "function sum(...)\n\tlocal result = 0\n\n\tfor i, v in ipairs({...}) do\n\t\tresult = result + v\n\tend\n\n\treturn result\nend\n\n-- Calling the function with different numbers of parameters\nlocal result1 = sum(1, 2, 3)\nlocal result2 = sum(5, 10, 15, 20)\n\nprint(\"Result 1: \" .. result1)\nprint(\"Result 2: \" .. result2)\n\n--OutPut\nResult 1: 6\nResult 2: 50" + "function sum(...)\nreturn...\nend" ] }, "anonymous_function_no_parameters": { "name": "Anonymous function that takes no parameters", "code": [ - "local myFunction = function()\n\tprint(\"Anonymous function with no parameters\")\nend\n\nmyFunction()\n--OutPut\n\nAnonymous function with no parameters" + "local myFunction = function()\nend" ] }, "anonymous_function_with_parameters": { "name": "Anonymous function that takes 1 or more defined parameters", "code": [ - "local add = function(a, b)\n\treturn a + b\nend\n\nlocal result = add(5, 3)\nprint(\"The sum is: \" .. result)\n--OutPut:\nThe sum is: 8" + "local add = function(a, b)\nend" ] }, "anonymous_function_with_keyword_parameters": { "name": "Anonymous function that takes 0 or more defined keyword parameters", - "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n--OutPut\n\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ] + "not-implemented": "true" }, "anonymous_function_variable_parameters": { "name": "Anonymous function that takes an unknown number of parameters", "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tprint('param1: ' .. param1)\n\tprint('param2: ' .. param2)\n\tprint('param3: ' .. param3)\nend\n\n-- Call the anonymous function with keyword parameters\nmyFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nmyFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n--OutPut:\nparam1: value1\nparam2: value2\nparam3: default_value3\nparam1: default_value1\nparam2: value2\nparam3: value3" - ], - "comment":"In Lua, anonymous functions (also known as closures or lambdas) typically do not natively support keyword parameters as in some other programming languages. However, you can achieve a similar effect by passing a table with named fields as a single argument to the anonymous function as above." + "local add = function(...)\nend" + ] }, "anonymous_function_no_parameters_with_return": { "name": "Anonymous function that takes no parameters and returns a value", "code": [ - "local myFunction = function()\n\treturn 'Hello from the anonymous function!'\nend\n\n-- Call the anonymous function and capture the result\nlocal result = myFunction()\n\n-- Print the result\nprint(result)\n\nOutPut:\nHello from the anonymous function!" + "local myFunction = function()\nreturn true\nend" ] }, "anonymous_function_with_parameters_with_return": { "name": "Anonymous function that takes 1 or more defined parameters and returns a value", "code": [ - "local add = function(a, b)\n\treturn a + b\nend\n\n-- Call the anonymous function with parameters and capture the result\nlocal result = add(5, 3)\n\n-- Print the result\nprint('The sum is: ' .. result)\n\n--OutPut:\nThe sum is: 8" + "local add = function(a, b)\nreturn a,b\nend" ] }, "anonymous_function_with_keyword_parameters_with_return": { "name": "Anonymous function that takes 0 or more defined keyword parameters and returns a value", - "code": [ - "local myFunction = function(params)\n\tlocal param1 = params.param1 or 'default_value1'\n\tlocal param2 = params.param2 or 'default_value2'\n\tlocal param3 = params.param3 or 'default_value3'\n\n\t-- Your code here, using param1, param2, param3\n\tlocal result = param1 .. ', ' .. param2 .. ', ' .. param3\n\n\t-- Return the result\n\treturn result\nend\n\n-- Call the anonymous function with keyword parameters and capture the result\nlocal output1 = myFunction{\n\tparam1 = 'value1',\n\tparam2 = 'value2',\n}\n\nlocal output2 = myFunction{\n\tparam2 = 'value2',\n\tparam3 = 'value3',\n}\n\n-- Print the results\nprint('Output 1: ' .. output1)\nprint('Output 2: ' .. output2)\n\n--OutPut:\nOutput 1: value1, value2, default_value3\nOutput 2: default_value1, value2, value3" - ] + "not-implemented": "true" }, "anonymous_function_variable_parameters_with_return": { "name": "Anonymous function that takes an unknown number of parameters and returns a value", "code": [ - "local myFunction = function(...)\n\tlocal params = {...}\n\tlocal result = 'Parameters: '\n\n\tfor i, v in ipairs(params) do\n\t\tresult = result .. 'Parameter ' .. i .. ': ' .. v .. ' '\n\tend\n\n\treturn result\nend\n\n-- Call the anonymous function with different numbers of parameters and capture the result\nlocal result1 = myFunction(1, 2, 3)\nlocal result2 = myFunction('apple', 'banana')\nlocal result3 = myFunction('cat')\n\n-- Print the results\nprint(result1)\nprint(result2)\nprint(result3)\n\n--OutPut:\nParameters: Parameter 1: 1 Parameter 2: 2 Parameter 3: 3 \nParameters: Parameter 1: apple Parameter 2: banana \nParameters: Parameter 1: cat" + "local myFunction = function(...)\nreturn...\nend" ] }, "call_subroutine": { @@ -115,4 +103,4 @@ "not-implemented": "true" } } -} \ No newline at end of file +} From 8e6465d205f300012e5b948e9cd3917eca16e6b2 Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD Date: Mon, 30 Oct 2023 19:25:08 +0100 Subject: [PATCH 15/20] Added control structures concept for powershell --- .../powershell/7/control_structures.json | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 web/thesauruses/powershell/7/control_structures.json diff --git a/web/thesauruses/powershell/7/control_structures.json b/web/thesauruses/powershell/7/control_structures.json new file mode 100644 index 000000000..2ce40b9b9 --- /dev/null +++ b/web/thesauruses/powershell/7/control_structures.json @@ -0,0 +1,128 @@ +{ + "meta": { + "language": "powershell", + "language_name": "Powershell", + "structure": "control_structures", + "language_version": "7" + }, + "concepts": { + "if_conditional": { + "name": "If conditional", + "code": [ + "if (condition) { ... }" + ] + }, + "if_else_conditional": { + "name": "If/Else conditional", + "code": [ + "if (condition) { ... }", + "else { ... }" + ] + }, + "if_elseif_conditional": { + "name": "If/ElseIf conditional", + "code": [ + "if (condition) { ... }", + "elseif (condition) { ... }" + ] + }, + "if_elseif_else_conditional": { + "name": "If/ElseIf/Else conditional", + "code": [ + "if (condition) { ... }", + "elseif (condition) { ... }", + "else { ... }" + ] + }, + "switch_statement": { + "name": "Switch statement", + "code": [ + "switch (condition) {", + " case 1 { ... }", + " case 2 { ... }", + " default { ... }", + "}" + ] + }, + "ternary_conditional": { + "name": "Ternary conditional", + "code": [ + "condition ? true : false" + ] + }, + "while_loop": { + "name": "While loop", + "code": [ + "while (condition) {", + " ...", + "}" + ] + }, + "do_while_loop": { + "name": "Do/While loop", + "code": [ + "do {", + " ...", + "} while (condition)" + ] + }, + "until_loop": { + "name": "Until loop", + "code": [ + "until (condition) {", + " ...", + "}" + ] + }, + "do_until_loop": { + "name": "Do/Until loop", + "code": [ + "do {", + " ...", + "} until (condition)" + ] + }, + "for_loop": { + "name": "For loop", + "code": [ + "for ($i = 0; $i < 10; $i++) { ... }" + ] + }, + "foreach_loop": { + "name": "Foreach loop", + "code": [ + "foreach ($item in $items) { ... }" + ] + }, + "list_comprehension": { + "name": "List Comprehension", + "not-implemented": true + }, + "each_iteration": { + "name": "Each iteration", + "not-implemented": true + }, + "map_iteration": { + "name": "Map iteration", + "not-implemented": true + }, + "filter_iteration": { + "name": "Filter iteration", + "code": [ + "$items | ? { condition }", + "$items | where { condition }", + "$items | where-object { condition }" + ], + "comment": "The ? operator and the where keyword are aliases for the where-object cmdlet." + }, + "fold_iteration": { + "name": "Fold iteration", + "code": [ + "$items | % { ... }", + "$items | foreach { ... }", + "$items | foreach-object { ... }" + ], + "comment": "The % operator and the foreach keyword are aliases for the foreach-object cmdlet." + } + } +} \ No newline at end of file From d49ed5089c0dfec30ff9e41e7a5c081e3aa128ed Mon Sep 17 00:00:00 2001 From: Ulysse ARNAUD <11415595+ulyssear@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:13:40 +0100 Subject: [PATCH 16/20] Removed all "..." --- .../powershell/7/control_structures.json | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/web/thesauruses/powershell/7/control_structures.json b/web/thesauruses/powershell/7/control_structures.json index 2ce40b9b9..29c193ba4 100644 --- a/web/thesauruses/powershell/7/control_structures.json +++ b/web/thesauruses/powershell/7/control_structures.json @@ -9,38 +9,38 @@ "if_conditional": { "name": "If conditional", "code": [ - "if (condition) { ... }" + "if (condition) {}" ] }, "if_else_conditional": { "name": "If/Else conditional", "code": [ - "if (condition) { ... }", - "else { ... }" + "if (condition) {}", + "else {}" ] }, "if_elseif_conditional": { "name": "If/ElseIf conditional", "code": [ - "if (condition) { ... }", - "elseif (condition) { ... }" + "if (condition) {}", + "elseif (condition) {}" ] }, "if_elseif_else_conditional": { "name": "If/ElseIf/Else conditional", "code": [ - "if (condition) { ... }", - "elseif (condition) { ... }", - "else { ... }" + "if (condition) {}", + "elseif (condition) {}", + "else {}" ] }, "switch_statement": { "name": "Switch statement", "code": [ "switch (condition) {", - " case 1 { ... }", - " case 2 { ... }", - " default { ... }", + " case 1 {}", + " case 2 {}", + " default {}", "}" ] }, @@ -85,13 +85,13 @@ "for_loop": { "name": "For loop", "code": [ - "for ($i = 0; $i < 10; $i++) { ... }" + "for ($i = 0; $i < 10; $i++) {}" ] }, "foreach_loop": { "name": "Foreach loop", "code": [ - "foreach ($item in $items) { ... }" + "foreach ($item in $items) {}" ] }, "list_comprehension": { @@ -118,11 +118,11 @@ "fold_iteration": { "name": "Fold iteration", "code": [ - "$items | % { ... }", - "$items | foreach { ... }", - "$items | foreach-object { ... }" + "$items | % {}", + "$items | foreach {}", + "$items | foreach-object {}" ], "comment": "The % operator and the foreach keyword are aliases for the foreach-object cmdlet." } } -} \ No newline at end of file +} From aa3bd74ff5d9dc73dbfdca1db29720baf288fc02 Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:59:32 -0400 Subject: [PATCH 17/20] Upgrade packages to fix Docker container errors as well as security --- requirements.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 55dced160..b18f64d64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,31 +1,37 @@ asgiref==3.7.2 astroid==2.6.6 +attrs==23.1.0 bleach==4.1.0 colorama==0.4.4 dj-database-url==0.5.0 -Django==4.2.3 +Django==4.2.6 django-markdownify==0.9.0 django-on-heroku==1.1.2 gunicorn==20.1.0 importlib-metadata==4.8.2 isort==5.9.3 +jsonmerge==1.8.0 +jsonschema==4.19.0 +jsonschema-specifications==2023.7.1 lazy-object-proxy==1.6.0 Markdown==3.3.6 mccabe==0.6.1 packaging==21.3 protobuf==3.18.3 -psycopg2-binary==2.9.5 +psycopg2-binary==2.9.9 Pygments==2.15.0 pylint==2.9.6 pyparsing==3.0.6 pytz==2021.1 +referencing==0.30.2 +rpds-py==0.9.2 six==1.16.0 sqlparse==0.4.4 +tinycss2==1.2.1 toml==0.10.2 -typing-extensions==4.7.1 +typing_extensions==4.7.1 tzdata==2021.5 webencodings==0.5.1 whitenoise==5.3.0 wrapt==1.12.1 zipp==3.6.0 -jsonmerge==1.8.0 \ No newline at end of file From 6b0f573306eb8e54c75726bd2c2e6ccfbc779170 Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:20:53 -0400 Subject: [PATCH 18/20] Upgrade more packages --- requirements.txt | 52 ++++++++++++++++++++----------------- web/tests/test_templates.py | 2 +- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/requirements.txt b/requirements.txt index b18f64d64..33591f959 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,37 +1,41 @@ asgiref==3.7.2 -astroid==2.6.6 +astroid==3.0.1 attrs==23.1.0 -bleach==4.1.0 -colorama==0.4.4 -dj-database-url==0.5.0 +bleach==6.1.0 +colorama==0.4.6 +dill==0.3.7 +dj-database-url==2.1.0 Django==4.2.6 -django-markdownify==0.9.0 +django-markdownify==0.9.3 django-on-heroku==1.1.2 -gunicorn==20.1.0 -importlib-metadata==4.8.2 -isort==5.9.3 -jsonmerge==1.8.0 -jsonschema==4.19.0 +gunicorn==21.2.0 +importlib-metadata==6.8.0 +isort==5.12.0 +jsonmerge==1.9.2 +jsonschema==4.19.2 jsonschema-specifications==2023.7.1 -lazy-object-proxy==1.6.0 -Markdown==3.3.6 -mccabe==0.6.1 -packaging==21.3 -protobuf==3.18.3 +lazy-object-proxy==1.9.0 +Markdown==3.5 +mccabe==0.7.0 +packaging==23.2 +platformdirs==3.11.0 +protobuf==4.24.4 psycopg2-binary==2.9.9 -Pygments==2.15.0 -pylint==2.9.6 -pyparsing==3.0.6 -pytz==2021.1 +Pygments==2.16.1 +pylint==3.0.2 +pyparsing==3.1.1 +pytz==2023.3.post1 referencing==0.30.2 -rpds-py==0.9.2 +rpds-py==0.10.6 six==1.16.0 sqlparse==0.4.4 tinycss2==1.2.1 toml==0.10.2 -typing_extensions==4.7.1 -tzdata==2021.5 +tomli==2.0.1 +tomlkit==0.12.1 +typing_extensions==4.8.0 +tzdata==2023.3 webencodings==0.5.1 -whitenoise==5.3.0 -wrapt==1.12.1 +whitenoise==6.6.0 +wrapt==1.15.0 zipp==3.6.0 diff --git a/web/tests/test_templates.py b/web/tests/test_templates.py index 0804a086e..2d8fff4f6 100644 --- a/web/tests/test_templates.py +++ b/web/tests/test_templates.py @@ -85,7 +85,7 @@ def test_concept_card(self): "comment": "I am a humble\nmulti-line comment in the\nform of a haiku" } ).strip() - self.assertEquals( + self.assertEqual( rendered_template_5, "
\n" "
\n" From a3e8ef25b27c59392062275529da1ac03056c6a3 Mon Sep 17 00:00:00 2001 From: PentW0lf <31568025+PentW0lf@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:49:45 +0530 Subject: [PATCH 19/20] Add files via upload --- web/thesauruses/lua/5/operators.json | 244 +++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 web/thesauruses/lua/5/operators.json diff --git a/web/thesauruses/lua/5/operators.json b/web/thesauruses/lua/5/operators.json new file mode 100644 index 000000000..eff61799e --- /dev/null +++ b/web/thesauruses/lua/5/operators.json @@ -0,0 +1,244 @@ +{ + "meta": { + "language": "lua", + "language_name": "Lua", + "structure": "operators", + "language_version": "5.1" + }, + "concepts": { + "addition": { + "name": "Addition operator", + "code": [ + "a + b" + ] + }, + "addition_assignment": { + "name": "Addition and assignment operator", + "not-implemented": true + }, + "subtraction": { + "name": "Subtraction operator", + "code": [ + "a - b" + ] + }, + "subtraction_assignment": { + "name": "Subtraction and assignment operator", + "not-implemented": true + }, + "multiplication": { + "name": "Multiplication operator", + "code": [ + "a * b" + ] + }, + "multiplication_assignment": { + "name": "Multiplication and assignment operator", + "not-implemented": true + }, + "division": { + "name": "Division operator", + "code": [ + "a / b" + ] + }, + "division_assignment": { + "name": "Division and assignment operator", + "not-implemented": true + }, + "integer_division": { + "name": "Integer division operator", + "not-implemented": true + }, + "integer_division_assignment": { + "name": "Integer division and assignment operator", + "not-implemented": true + }, + "modulus": { + "name": "Modulus (remainder) operator", + "code": [ + "a % b" + ] + }, + "modulus_assignment": { + "name": "Modulus and assignment operator", + "not-implemented": true + }, + "unary_plus": { + "name": "Unary plus operator", + "not-implemented": true + }, + "unary_minus": { + "name": "Unary minus operator", + "not-implemented": true + }, + "increment": { + "name": "Increment (add 1) operator", + "not-implemented": true + }, + "decrement": { + "name": "Decrement (subtract 1) operator", + "not-implemented": true + }, + "exponential": { + "name": "Exponential operator", + "code": [ + "a ^ b" + ] + }, + "factorial": { + "name": "Factorial operator", + "not-implemented": true + }, + "absolute_value": { + "name": "Absolute value operator", + "code": [ + "math.abs(a)" + ] + }, + "percentage": { + "name": "Percentage operator", + "not-implemented": true + }, + "equal_to": { + "name": "Equality operator", + "code": [ + "a == b" + ] + }, + "not_equal_to": { + "name": "Not equal to operator", + "code": [ + "a ~= b" + ] + }, + "less_than": { + "name": "Less than operator", + "code": [ + "a < b" + ] + }, + "less_than_or_equal_to": { + "name": "Less than or equal to operator", + "code": [ + "a <= b" + ] + }, + "greater_than": { + "name": "Greater than operator", + "code": [ + "a > b" + ] + }, + "greater_than_or_equal_to": { + "name": "Greater than or equal to operator", + "code": [ + "a >= b" + ] + }, + "null_coalescing": { + "name": "Null coalescing operator", + "not-implemented": true + }, + "is": { + "name": "Is operator", + "not-implemented": true + }, + "is_not": { + "name": "Is not operator", + "not-implemented": true + }, + "logical_and": { + "name": "Logical AND operator", + "code": [ + "a and b" + ] + }, + "logical_or": { + "name": "Logical OR operator", + "code": [ + "a or b" + ] + }, + "logical_not": { + "name": "Logical NOT operator", + "code": [ + "not [condition]" + ] + }, + "bitwise_and": { + "name": "Bitwise AND operator", + "code": [ + "a & b" + ] + }, + "bitwise_and_assignment": { + "name": "Bitwise AND and assignment operator", + "not-implemented": true + }, + "bitwise_or": { + "name": "Bitwise OR operator", + "code": [ + "a | b" + ] + }, + "bitwise_or_assignment": { + "name": "Bitwise OR and assignment operator", + "not-implemented": true + }, + "bitwise_not": { + "name": "Bitwise NOT operator", + "code": [ + "~a" + ] + }, + "not_assignment": { + "name": "Bitwise NOT and assignment operator", + "not-implemented": true + }, + "bitwise_xor": { + "name": "Bitwise XOR operator", + "not-implemented": true + }, + "bitwise_xor_assignment": { + "name": "Bitwise XOR and assignment operator", + "not-implemented": true + }, + "bitwise_xnor": { + "name": "Bitwise XNOR operator", + "not-implemented": true + }, + "bitwise_xnor_assignment": { + "name": "Bitwise XNOR and assignment operator", + "not-implemented": true + }, + "left_shift": { + "name": "Left shift bitwise operator", + "code": [ + "a << b" + ] + }, + "left_shift_assignment": { + "name": "Left shift assignment operator", + "not-implemented": true + }, + "right_shift": { + "name": "Right shift bitwise operator", + "code": [ + "a >> b" + ] + }, + "right_shift_assignment": { + "name": "Right shift assignment operator", + "not-implemented": true + }, + "ternary": { + "name": "Ternary operator", + "not-implemented": true + }, + "null_forgiving": { + "name": "Null forgiving operator", + "not-implemented": true + } + } +} \ No newline at end of file From 2ebf2d7279dae1ec92611844e7d577bebb424c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:03:13 +0000 Subject: [PATCH 20/20] Bump django from 4.2.6 to 4.2.7 Bumps [django](https://github.com/django/django) from 4.2.6 to 4.2.7. - [Commits](https://github.com/django/django/compare/4.2.6...4.2.7) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 33591f959..a31ac2b66 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ bleach==6.1.0 colorama==0.4.6 dill==0.3.7 dj-database-url==2.1.0 -Django==4.2.6 +Django==4.2.7 django-markdownify==0.9.3 django-on-heroku==1.1.2 gunicorn==21.2.0