You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

12
16
13
-
MathParser.lua is a robust and comprehensive math parser for Lua, designed with a focus on simplicity, elegance, and user-friendliness. Each function in the codebase is well-documented, making it easy to read, understand, and modify. It supports a wide range of mathematical operations, from basic arithmetic to complex expressions, and allows for the addition of custom functions, variables, operators, and operator precedence levels.
17
+
</div>
18
+
19
+
## 🎯 Introduction
20
+
21
+
Welcome to MathParser.lua, a comprehensive math parser tailored specifically for Lua. With its structured design and well-commented code, this parser is accessible to both newcomers and seasoned developers alike.
22
+
23
+
MathParser.lua is capable of handling a wide array of mathematical problems, providing a reliable solution for your computational needs. But it doesn't stop there. It offers a high degree of customization, allowing you to extend its functionality by adding your own functions, variables, and operators. You even have the flexibility to alter the precedence of operations to suit your needs. For instance, you can configure the parser to prioritize addition over multiplication - a level of customization that truly sets MathParser.lua apart from other math parsers.
14
24
15
-
This project boasts a full 100% test coverage. It has been thoroughly tested and confirmed to work seamlessly on Lua versions5.1, 5.2, 5.3, 5.4, as well as on LuaJIT and Luau.
25
+
One of the defining features of MathParser.lua is its thorough test coverage. We've ensured that every line of code is put through rigorous testing, guaranteeing its reliability and robustness. Furthermore, it's compatible with various Lua versions, starting from Lua-5.1, including LuaJIT. It's even compatible with Luau, making it a viable choice for your Roblox projects.
-**Simplicity**: MathParser.lua offers a user-friendly [API](./src/MathParser.lua) that is easy to understand and use.
31
-
-**Lightweight**: Despite its powerful features, MathParser.lua is lightweight and has no external dependencies.
32
-
-**Efficient**: MathParser.lua is also optimized for speed, ensuring fast computations even with complex mathematical expressions.
33
-
-**Customizable**: With MathParser.lua, you have the flexibility to modify operator precedence and add new operators, tailoring the parser to your specific needs.
41
+
## 🎁 Features
34
42
35
-
## Usage
43
+
1.**User-Friendly**: MathParser.lua boasts an intuitive API, making it a breeze to integrate into your projects. Its comprehensive documentation provides clear examples and explanations, while its error messages are designed to pinpoint the exact location of issues, reducing debugging time.
44
+
2.**Safe and Secure**: Safety is a priority with MathParser.lua. It avoids the use of the `load` function, which can execute any Lua code. Instead, it employs a custom parser to process input expressions, ensuring only valid mathematical operations are executed. If an input is invalid or potentially harmful, MathParser.lua throws an error, providing detailed information about the issue.
45
+
3.**Compact and Efficient**: MathParser.lua is a lean project with no external dependencies, making it easy to incorporate into your codebase. Its compact size doesn't compromise its functionality, offering a powerful tool that's easy to understand and modify.
46
+
4.**Highly Customizable**: MathParser.lua offers extensive customization options. You can add custom functions, variables, and operators, and even change the order in which operations are done. This flexibility allows you to tailor MathParser.lua to your specific needs, making it a versatile tool for a wide range of applications.
36
47
37
-
Here's a quick guide on how to use MathParser.lua:
48
+
## 🛠 Usage
38
49
39
-
### Basic Usage
50
+
MathParser.lua is a versatile tool that can handle everything from simple arithmetic to complex mathematical expressions. Whether you're integrating it into a large project or using it for quick calculations, here's a comprehensive guide to get you started.
40
51
52
+
### 🔰 Getting Started
53
+
54
+
Using MathParser.lua is as easy as 1-2-3. Here's a quick example to get you started:
It was just a simple example. For more advanced usage, let's move on to the next section.
72
+
73
+
### 🔱 Advanced Usage
58
74
59
-
In addition to basic arithmetic, MathParser.lua supports custom functionsand operators. Here's an example of how to use these features:
75
+
MathParser.lua is not just a simple math parser, it's a powerful tool that can be customized to suit your needs. It supports the addition of custom functions, variables, and operators, allowing you to extend its functionality beyond basic math operations. Let's use all these features to demonstrate how you can use MathParser.lua in more advanced scenarios.
60
76
77
+
Here's an example code snippet that demonstrates the advanced usage of MathParser.lua:
61
78
```lua
62
79
localMathParser=require("MathParser")
63
-
64
-
-- Create a new parser instance
65
80
localmyParser=MathParser:new()
66
81
67
-
-- Add a new variable with the name "x" and the value 5
This is just a small sample of what MathParser.lua can do. For more information, check out the [documentation](docs/Documentation.md), the source of the [API](src/MathParser.lua), or the [example usage](./example.lua).
114
+
For more details, refer to the [documentation](docs/Documentation.md), the [API source](src/MathParser.lua), or the [full example usage file](./example.lua).
115
+
116
+
## 🛣️ Roadmap
117
+
118
+
MathParser.lua is just getting started. Here are some of the enhancements and features we're planning for future releases:
119
+
120
+
-[ ] Introduce support for internal functions that can modify the evaluator's state at runtime. This includes setting variables and jumping to different parts of the expression.
121
+
-[ ] Package MathParser.lua into a single file for easy distribution and usage. We also plan to make it available on LuaRocks and the project's GitHub releases.
122
+
-[ ] Implement full support for Luau to cater to the Roblox developer community.
123
+
-[ ] Expand the mathematical function library to include advanced functions not available in the standard Lua math library, such as factorial, permutations, and combinations.
124
+
-[ ] Incorporate support for complex numbers to handle more sophisticated mathematical problems.
125
+
-[ ] Optimize MathParser.lua further to enhance speed and reduce memory usage.
126
+
-[ ] Develop optional support for parsing and solving equations and inequalities.
127
+
-[ ] Add optional support for solving differential and integral equations.
128
+
129
+
We welcome feature requests and suggestions for improvements. Feel free to open an issue or a pull request. Your feedback is highly appreciated!
109
130
110
-
## License
131
+
## 📜 License
111
132
112
133
MathParser.lua is (re)licensed under the [MIT License](LICENSE).
0 commit comments