Skip to content

Commit 6fc4906

Browse files
author
Florian Thake
committed
VERSION: 0.13.0 - Buffer, U8, U64, bit ops, UTF-8 Iterator, hex integrals, MPL-2.0
1 parent 6976e23 commit 6fc4906

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4849
-1968
lines changed

COPYRIGHT.TXT

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ Except where otherwise noted all files included are copyrighted by Florian Thake
33
Copyright (C) 2024 Florian Thake <contact |at| tea-age.solutions>.
44

55

6-
The TeaScript C++ Library as well as the TeaScript Host Application
7-
are licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
8-
See included LICENSE.TXT or <https://www.gnu.org/licenses/>.
9-
If you cannot or don't want use this AGPL license,
10-
you may ask for a different license via the contact information below.
6+
The TeaScript C++ Library
7+
is licensed under the Mozilla Public License 2.0
8+
See included LICENSE.TXT or <https://www.mozilla.org/en-US/MPL/2.0/>
9+
10+
The TeaScript Host Application
11+
is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
12+
See included LICENSE_AGPL.TXT or <https://www.gnu.org/licenses/>.
1113

1214

1315
Some distribution packages (e.g. the TeaScript Host for Linux) might use other (A)GPL software.
@@ -26,7 +28,13 @@ All files marked with
2628
SPDX-License-Identifier: AGPL-3.0-only
2729
are licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
2830

29-
See included LICENSE.TXT or <https://www.gnu.org/licenses/>.
31+
See included LICENSE_AGPL.TXT or <https://www.gnu.org/licenses/>.
32+
33+
All files marked with
34+
SPDX-License-Identifier: MPL-2.0
35+
are licensed under the Mozilla Public License 2.0
36+
37+
See included LICENSE.TXT or <https://www.mozilla.org/en-US/MPL/2.0/>
3038

3139
All files marked with
3240
SPDX-License-Identifier: MIT
Lines changed: 45 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,72 @@
11
TeaScript Breaking Changes in the actual release
22
=================================================
33

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.
3920

21+
Parser::Num() throws exception::parsing_error instead of std::out_of_range
4022

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+
4132
Visibility of Core Library functions
4233
------------------------------------
4334
The following Core Library functions moved up to Level CoreReduced:
4435

45-
The following Core Library functions moved up to Level Core:
36+
_f64toi64
4637

47-
eval_file
38+
The following Core Library functions moved up to Level Core:
4839

4940
The following Core Library functions moved up to Level Util:
5041

5142
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-
7643

7744

7845
TeaScript list of deprecated parts
7946
=================================================
8047

8148
The following deprecated parts have been finally removed from this release:
8249

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.
8552

53+
func eval( sth_unspecified ) from TeaScript Core Library (use the not confusing _eval( code_string ) variant instead)
8654

55+
8756
The following parts are now deprecated and will be removed in some future release:
8857

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.
9061

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.
9370

71+
Context( VariableStorage const &init, TypeSystem && rMovedSys, bool const booting )
72+
Please, uses a different constructor instead.

Known_Issues.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ TeaScript Known Issues
33

44
Beside feature incompleteness there are the following known issues which will be fixed in a later (pre-)release.
55
NOTE: The numbers stay same, solved items will (usually) be removed in the next release from this list.
6+
67

7-
1.) [PLATFORM: any] Solved in 0.12 (floating point literals can use decimal point and exponent the same time, e.g.: 123.456e-10 )
8+
3.) [PLATFORM: any] Solved in 0.13 (explicit cast to variuos number types is posible now with the as operator
9+
e.g., n as i64 or x as f64 )
810

911

10-
2.) [PLATFORM: any] Solved in 0.12 (floating point to string conversion now uses default conversion via std::format/fmt::to_string)
11-
12-
13-
3.) [PLATFORM: any]
14-
Actually, there are neither implicit number type conversions nor any cast operators.
15-
For convert f64 to i64 you must use the function _f64toi64 (or to_i64).
16-
For convert i64 to f64 you can either use to_f64 or simply add 0.0 for f64 promotion.
17-
18-
1912
5.) [PLATFORM: Windows]
2013
Echo'ed(!) input of Unicode might be broken on Windows for the case if the Unicode glyph is
2114
assembled as a surrogate pair in it's UTF-16 representation. This is a bug (or missing feature)
@@ -57,5 +50,5 @@ NOTE: The numbers stay same, solved items will (usually) be removed in the next
5750
WORKAROUND: since 0.11.0 Subscript Operator is implemented, use tup[0].1 or tup[0][1] as a workaround.
5851

5952

60-
12.) [PLATFORM: any] Solved in 0.12 (trunc does not work with the full range of f64 (but only with the range of i64))
53+
13.) -
6154

0 commit comments

Comments
 (0)