Skip to content

Commit 670d16e

Browse files
committed
Fix typos
1 parent fc00dce commit 670d16e

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

Examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following are examples demonstrating how to use TinyExpr++.
55
## Example 1
66

77
```cpp
8-
include "tinyexpr.h"
8+
#include "tinyexpr.h"
99
#include <iostream>
1010

1111
int main(int argc, char *argv[])
@@ -209,5 +209,5 @@ auto result = tep.evaluate("SUM(CELL 0, CELL 1, CELL 2, CELL 3, CELL 4)");
209209

210210
// call the other function, getting the object's max value
211211
// (will be 8)
212-
res = tep.evaluate("CellMax()");
212+
result = tep.evaluate("CellMax()");
213213
```

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Please refer [here](TinyExprChanges.md) for a list of changes from the original
6262

6363
## Building
6464

65-
*TinyExpr++* is self-contained in two files: "tinyexpr.cpp and "tinyexpr.h". To use
65+
*TinyExpr++* is self-contained in two files: "tinyexpr.cpp" and "tinyexpr.h". To use
6666
*TinyExpr++*, simply add those two files to your project.
6767

6868
The documentation can be built using the following:
@@ -332,7 +332,7 @@ auto result = tep.evaluate("SUM(CELL 0, CELL 1, CELL 2, CELL 3, CELL 4)");
332332

333333
// call the other function, getting the object's max value
334334
// (will be 8)
335-
res = tep.evaluate("CellMax()");
335+
result = tep.evaluate("CellMax()");
336336
```
337337
338338
## Non-US Formatted Formulas
@@ -367,11 +367,10 @@ int main(int argc, char *argv[])
367367
tep.set_list_separator(';');
368368
369369
/* This will compile the expression and check for errors. */
370-
auto r = tep.evaluate(expression);
370+
const auto r = tep.evaluate(expression);
371371
372372
if (tep.success())
373373
{
374-
const double r = tep.evaluate(expression);
375374
std::cout << "Result:\n\t" << r << "\n";
376375
}
377376
else

TinyExprChanges.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The following are changes from the original TinyExpr C library:
22

3-
- Compiles as C++17 code.
3+
- Compiles as C++20 code.
44
- `te_*` functions are now wrapped in a `te_parser` class.
55
- `te_interp()`, `te_compile()`, and `te_eval()` have been replaced with `te_parser::compile()`, `te_parser::evaluate()`, and `te_parser::set_variables_and_functions()`.
66
`set_variables_and_functions()` sets your list of custom functions and variables. `compile()` compiles and optimizes an expression.
@@ -10,7 +10,7 @@ The following are changes from the original TinyExpr C library:
1010
The available flags for variables and functions are now just combinations of `TE_DEFAULT`, `TE_PURE`, and `TE_VARIADIC`.
1111
- Formula parsing is now case insensitive.
1212
- Added support for variadic functions (can accept 1-24 arguments); enabled through the `TE_VARIADIC` flag.
13-
(Refer to the `AVERAGE()` function in `tinyexp.cpp` for an example.)
13+
(Refer to the `AVERAGE()` function in `tinyexpr.cpp` for an example.)
1414
- Added support for parsing formulas in non-US format (e.g., `pow(2,2; 2)` instead of `pow(2.2, 2)`). Useful for when the program's locale is non-English.
1515
(Refer to [Example 4](Examples.md) for a demonstration.)
1616
- `te_expr` is now a derivable base class. This means that you can derive from `te_expr`, add new fields to that derived class (e.g., arrays, strings, even other classes)

docs/manual/compile-time-options.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This flag will also disable all bitwise functions and operators.
1515

1616
Compile with `TE_LONG_DOUBLE` defined to use `long double` as the default data type.
1717

18-
Depending on the compiler, this may provide sufficient mantissa precision to represent ``uint64_t`` values exactly.
18+
Depending on the compiler, this may provide sufficient mantissa precision to represent `uint64_t` values exactly.
1919
Call `te_parser::supports_64bit()` (or `SUPPORTS64BIT()` in an expression at runtime) to confirm this.
2020

2121
## `TE_RAND_SEED` {-}

docs/manual/embedded-programming.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void OnInterrupt()
6969
const_cast<te_parser&>(vTep).set_variables_and_functions(
7070
{ {"STRESS_L", 10.1},
7171
{"P_LEVEL", .5} });
72-
const_cast<te_parser&>(vTep).compile(("STRESS_L*P_LEVEL"));
72+
const_cast<te_parser&>(vTep).compile("STRESS_L*P_LEVEL");
7373
7474
if (vTep.success())
7575
{

docs/manual/technical-overview.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ DiagrammeR::grViz("digraph {
5656

5757
<list> = <expr> {(",", ";" [dependent on locale]) <expr>}
5858
<expr> = <term> {("&" | "|") <term>}
59-
<expr> = <term> {("<>" | "!=" | "=" | "<") | "<=" | ">" | ">=") <term>}
59+
<expr> = <term> {("<>" | "!=" | "=" | "<" | "<=" | ">" | ">=") <term>}
6060
<expr> = <term> {("<<" | ">>") <term>}
6161
<expr> = <term> {("+" | "-") <term>}
6262
<term> = <factor> {("*" | "/" | "%") <factor>}
6363
<factor> = <power> {("^" | "**") <power>}
64-
<power> = {("-" | "+")} <base>
64+
<power> = {("-" | "+" | "~")} <base>
6565
<base> = <constant>
6666
| <variable>
6767
| <function-0> {"(" ")"}

docs/manual/unknown-symbol-resolution.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ te_parser tep;
9191
// Create a handler for undefined tokens that will recognize
9292
// dynamic strings like "FY2004" or "FY1997" and convert them to 2004 and 1997.
9393
tep.set_unknown_symbol_resolver(
94-
// Handler should except a string (which will be the unrecognized token)
94+
// Handler should accept a string (which will be the unrecognized token)
9595
// and return a te_type.
9696
[](std::string_view str) -> te_type
9797
{

tinyexpr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class te_string_less
288288

289289
/// @brief A compiled expression.
290290
/// @details Can also be an additional object that can be passed to
291-
/// te_confun0-te_confun7 functions via a te_variable.
291+
/// te_confun0-te_confun24 functions via a te_variable.
292292
class te_expr
293293
{
294294
public:
@@ -338,7 +338,7 @@ class te_variable
338338
te_variant_type m_value;
339339
/// @brief The type that m_value represents.
340340
te_variable_flags m_type{ TE_DEFAULT };
341-
/// If @c m_value is a function pointer of type `te_confun0`-`te_confun7`, then
341+
/// If @c m_value is a function pointer of type `te_confun0`-`te_confun24`, then
342342
/// this is passed to that function when called. This is useful for passing
343343
/// an object which manages additional data to your functions.
344344
te_expr* m_context{ nullptr };

0 commit comments

Comments
 (0)