|
1 | 1 | TeaScript Breaking Changes in the actual release |
2 | 2 | ================================================= |
3 | 3 |
|
4 | | - Default constness |
5 | | - ----------------- |
6 | | - Default constness of function parameters changed from mutable (def) to const for copy assigned parameters. |
7 | | - E.g.: func sum( a, b ) { a + b } // a and b are const by default now! |
8 | | - |
9 | | - This does not effect parameters which are shared assigned. |
10 | | - E.g.: func swap( a @=, b @= ) { const tmp := a, a:= b, b := tmp } // a and b are still mutable by default. |
11 | | - |
12 | | - As before you can always explicit set the constness/mutability. |
13 | | - E.g.: func test( const a_is_const @= , def b_is_mutable ) |
14 | | - |
15 | | - This version has several ways to enable the old behavior: |
16 | | - |
17 | | - 1.) For the Host Application launch your scripts with |
18 | | - --old-mutable-parameters |
19 | | - E.g.: |
20 | | - TeaScript.exe --old-mutable-parameters my_script.tea arg1 arg2 |
21 | | - |
22 | | - 2.) For the C++ Library use the high level API of class Engine: |
23 | | - void ActivateDeprecatedDefaultMutableParameters() noexcept; |
24 | | - Please, read also the comments. |
25 | | - |
26 | | - 3.) For C++ Library low level programming: |
27 | | - Overwrite the TeaScript language dialect in the Parser: |
28 | | - void OverwriteDialect( Dialect const dialect ) noexcept; |
29 | | - Please, read also the comments there and in teascript/Dialect.hpp |
30 | | - |
31 | | - 4.) Compile the Library and/or Host Application with |
32 | | - #define TEASCRIPT_DEFAULT_CONST_PARAMETERS false |
33 | | - You can do this from inside Dialect.hpp or define it outside (e.g. your project settings/before include) |
34 | | - Please, read also the comments in teascript/Dialect.hpp |
35 | | - |
36 | | - Point 1 and 2 will be deprecated and removed in later versions! |
37 | | - Point 3 has experimental state for now. (means API is not promoted to official and might be changed/removed.) |
38 | | - All of the points creating a legacy TeaScript language dialect which is not the official standard language! |
| 4 | + Changes in CoreLibrary functionality |
| 5 | + ------------------------------------ |
| 6 | + strat() / CoreLibrary::StrAt() will now return strings of length [0..4] depending on the utf-8 code point char amount. |
| 7 | + It will always return a full and complete utf-8 encoded glyph. If the wanted pos is in the middle |
| 8 | + of an utf-8 code point this complete utf-8 code point will be returned. |
| 9 | + |
| 10 | + readtextfile / CoreLibrary::ReadTextFile() will now do a complete UTF-8 validation of the read input. |
| 11 | + Also, it will not throw anymore but return Bool(false). |
| 12 | + |
| 13 | + |
| 14 | + Changes on C++ API level |
| 15 | + ------------------------------------ |
| 16 | + Util.hpp is splitted in 3 files: Util.hpp, UtilContent.hpp, UtilInternal.hpp. |
| 17 | + Most likely you still only need Util.hpp. |
| 18 | + |
| 19 | + ASTNode::Eval() has been made const. |
39 | 20 |
|
| 21 | + Parser::Num() throws exception::parsing_error instead of std::out_of_range |
40 | 22 |
|
| 23 | + exception::bad_value_cast now inherits from exception::runtime_error (w. SoruceLocation) instead of std::bad_any_cast |
| 24 | + |
| 25 | + Engine::AddVar/AddConst w. unsigned int overload now adds a U64 instead of I64 |
| 26 | + (NOTE: If a future U32/I32 will be added this overloads (and those for int) will change again/as well!) |
| 27 | + |
| 28 | + Tuple is first class citizen now. |
| 29 | + This must be taken into account for a visitor applied to ValueObject::Visit. |
| 30 | + |
| 31 | + |
41 | 32 | Visibility of Core Library functions |
42 | 33 | ------------------------------------ |
43 | 34 | The following Core Library functions moved up to Level CoreReduced: |
44 | 35 |
|
45 | | - The following Core Library functions moved up to Level Core: |
| 36 | + _f64toi64 |
46 | 37 |
|
47 | | - eval_file |
| 38 | + The following Core Library functions moved up to Level Core: |
48 | 39 |
|
49 | 40 | The following Core Library functions moved up to Level Util: |
50 | 41 |
|
51 | 42 | The following Core Library functions moved up to Level Full: |
52 | | - |
53 | | - trunc (check _trunc from LevelUtil) |
54 | | - ceil |
55 | | - floor |
56 | | - sqrt (check _sqrt from LevelUtil) |
57 | | - file_copy |
58 | | - file_copy_newer |
59 | | - readtextfile |
60 | | - writetextfile |
61 | | - create_dir |
62 | | - path_delete |
63 | | - file_exists (check path_exists and file_size from LevelUtil) |
64 | | - readtomlfile |
65 | | - |
66 | | - |
67 | | - |
68 | | - libfmt preferred over C++23 |
69 | | - --------------------------- |
70 | | - If you compile in C++23 mode with the <print> header (for std::vprint_unicode()) |
71 | | - but in your include path is a libfmt (#include "fmt/format.h") then |
72 | | - libfmt will be preferred over the C++23 variant (because more features). |
73 | | - You can disable libfmt with #define TEASCRIPT_DISABLE_FMTLIB 1 |
74 | | - in teascript/Print.hpp |
75 | | - |
76 | 43 |
|
77 | 44 |
|
78 | 45 | TeaScript list of deprecated parts |
79 | 46 | ================================================= |
80 | 47 |
|
81 | 48 | The following deprecated parts have been finally removed from this release: |
82 | 49 |
|
83 | | - virtual void CoreLibrary::Bootstrap( Context &, bool ); |
84 | | - use the new one instead: virtual void Bootstrap( Context &rContext, config::eConfig const config ) |
| 50 | + bool Parser::Int( Content & ) |
| 51 | + use Integer( Content & ) or Num( Content &, bool ) instead. |
85 | 52 |
|
| 53 | + func eval( sth_unspecified ) from TeaScript Core Library (use the not confusing _eval( code_string ) variant instead) |
86 | 54 |
|
| 55 | + |
87 | 56 | The following parts are now deprecated and will be removed in some future release: |
88 | 57 |
|
89 | | - func eval( sth_unspecified ) from TeaScript Core Library (use the not confusing _eval( code_string ) variant instead) |
| 58 | + Engine::ActivateDeprecatedDefaultMutableParameters() |
| 59 | + Please, change your script code to explicit mutable parameters with 'def' keyword. |
| 60 | + More deatails are available in the comment. |
90 | 61 |
|
91 | | - bool Parser::Int( Content & ) |
92 | | - use Integer( Content & ) or Num( Content &, bool ) instead. |
| 62 | + CoreLibrary::DoubleToLongLong() |
| 63 | + This was the implementation for _f64toi64. In C++ just use a static_cast<long long>! |
| 64 | + |
| 65 | + ArithmeticFactory::ApplyBinOp()|ApplyUnOp() |
| 66 | + Please, use ArithmeticFactory::ApplyBinaryOp() and ArithmeticFactory::ApplyUnaryOp() instead. |
| 67 | + |
| 68 | + Context::BulkAdd() |
| 69 | + Please, use InjectVars() instead. |
93 | 70 |
|
| 71 | + Context( VariableStorage const &init, TypeSystem && rMovedSys, bool const booting ) |
| 72 | + Please, uses a different constructor instead. |
0 commit comments