Commit graph

2416 commits

Author SHA1 Message Date
Benoît Minisini
2f81de1876 When using an intermediate temporary stream, copy the behaviour flags from the original stream.
[INTERPRETER]
* BUG: When using an intermediate temporary stream, copy the behaviour flags from the original stream.
2023-03-24 21:26:45 +01:00
Benoît Minisini
7cd804982b Fix a test that leads to a crash when gcc optimizations are enabled.
[INTERPRETER]
* BUG: Fix a test that leads to a crash when gcc optimizations are enabled.
2023-03-24 20:57:42 +01:00
Benoît Minisini
30c5e0af42 Add implicit conversion of Boolean, Byte and Short values into Pointer.
[INTERPRETER]
* NEW: Add implicit conversion of Boolean, Byte and Short values into Pointer.
2023-03-20 23:31:51 +01:00
Benoît Minisini
44bdb9486f Support for environment variables set at startup.
[INTERPRETER]
* NEW: Set environment variables at startup from the '.environment' file.

[COMPILER]
* NEW: Generate the '.environment' files with the list of environment variables that must be set at startup.

[ARCHIVER]
* NEW: Add the '.environment' file to the archive.
2023-03-18 01:36:19 +01:00
Benoît Minisini
d44be704d3 Sending a void line to the debugger repeats the last command only if the debugger is run from the command line.
[GB.DEBUG]
* NEW: If the 'GB_DEBUG_DEBUG' environment variable is '1', then a message is printed each time the debugger fifo fails and must be reopened.
* NEW: Sending a void line to the debugger repeats the last command only if the debugger is run from the command line.
2023-03-18 01:34:22 +01:00
Benoît Minisini
648b123f07 The support for external debugging now uses the project name, not the executable name, which may be different.
[INTERPRETER]
* BUG: The support for external debugging now uses the project name stored
  in the '.startup' file, not the executable name, which may be different.

[COMPILER]
* NEW: Write the name of the project in the '.startup' file.
2023-03-17 03:12:52 +01:00
Benoît Minisini
6b6c1e75b5 Add an API that inverts an image for the 'gb.image.effect' component.
[GB.IMAGE]
* NEW: Add an API that inverts an image for the 'gb.image.effect' component.
2023-03-17 03:11:30 +01:00
Benoît Minisini
d31e7c7aec Make Image.Invert() compatible with the method with the same name in 'gb.image'.
[GB.IMAGE.EFFECT]
* BUG: Make Image.Invert() compatible with the method with the same name in 'gb.image'.
2023-03-17 03:10:13 +01:00
Benoît Minisini
11db600d2c 'Application.TempDir' is a new property that returns the temporary directory used by the interpreter for the current process.
[INTERPRETER]
* NEW: 'Application.TempDir' is a new property that returns the temporary directory used by the interpreter for the current process.
2023-03-14 19:13:56 +01:00
Benoît Minisini
829a8a16ca Make code compile on older versions of gcc.
[ARCHIVER]
* BUG: Make code compile on older versions of gcc.
2023-03-11 11:19:40 +01:00
Benoît Minisini
e31a2ad2a7 Add a '-p' option to ignore the '.public' directory.
[ARCHIVER]
* BUG: Handle hidden files only in the project root directory.
* NEW: Add a '-p' option to ignore the '.public' directory.
2023-03-11 10:31:34 +01:00
Benoît Minisini
cac1a0f3d0 Make the debugger more robust when writing on a fifo fails. Reopen the fifo if needed.
[GB.DEBUG]
* BUG: Make the debugger more robust when writing on a fifo fails. Reopen the fifo if needed.
2023-03-07 00:09:01 +01:00
Benoît Minisini
78f4986c3c Forked processes now use fast exit, to avoir a possible crash.
[INTERPRETER]
* BUG: Forked processes now use fast exit, to avoir a possible crash.
2023-03-04 17:26:58 +01:00
Benoît Minisini
97534cc720 Delete temporary files when the QUIT instruction is used.
[INTERPRETER]
* BUG: Delete temporary files when the QUIT instruction is used.
2023-02-12 00:29:53 +01:00
Benoît Minisini
203a1db252 Correctly rewrite lines using the 'ERROR' keyword in a one-line 'IF' expression.
[GB.EVAL]
* BUG: Correctly rewrite lines using the 'ERROR' keyword in a one-line 'IF' expression.
2023-02-04 09:29:21 +01:00
Benoît Minisini
54f62f479e 'WAIT' with no argument now behaves as before when no component specific WAIT handler is defined.
[INTERPRETER]
* BUG: 'WAIT' with no argument now behaves as before when no component specific WAIT handler is defined.
2023-02-02 10:05:38 +01:00
Benoît Minisini
ca20ea1cd7 Fix JIT compilation on old compilers that do not support arithmetic overflow check.
[GB.JIT]
* BUG: Fix JIT compilation on old compilers that do not support arithmetic overflow check.
2023-02-02 08:35:20 +01:00
Benoît Minisini
c69f98fdf1 Fix quoting when displaying a string value.
[GB.DEBUG]
* BUG: Fix quoting when displaying a string value.
2023-01-20 15:56:35 +01:00
Benoît Minisini
f7d5eda82c 'gb.image' is now compatible with 'gb.web.gui'.
[GB.IMAGE]
* NEW: Color: ToHTML() is a new method that converts a Gambas color as integer value to an HTML color representation.
2023-01-16 00:54:11 +01:00
Benoît Minisini
57aa63bec2 Fix arithmetic overflow detection on datatype conversion.
[GB.JIT]
* BUG: Fix arithmetic overflow detection on datatype conversion.
2023-01-13 23:20:04 +01:00
Christof Thalhofer
1a8fdb41b7 GambasSelftests integer overflow tests
[DEVELOPMENT ENVIRONMENT]
* NEW: GambasSelftests integer overflow tests
* FIX: GambasSelftests run.sh just tests without JIT

Also refactored GambasSelftests a bit and removed some duplicated code
2023-01-13 11:49:43 +01:00
Benoît Minisini
c2ee9733a4 Fix a compiler warning.
[COMPILER]
* BUG: Fix a compiler warning.
2023-01-13 07:58:34 +01:00
Benoît Minisini
46c13a4b9b 'System.IgnoreOverflow = True' now never raises an error.
[INTERPRETER]
* BUG: 'System.IgnoreOverflow = True' now never raises an error.
2023-01-12 13:22:16 +01:00
Benoît Minisini
246cf40553 Don't use '-O3'. It makes benchmarks sometimes slower than using '-O2'.
[CONFIGURATION]
* BUG: Do not use the default CFLAGS forces by autotools. Either use the CFLAGS provided on the command-line, or the default ones of the project.

[INTERPRETER]
* OPT: Don't use '-O3'. It makes benchmarks sometimes slower than using '-O2'.

[COMPILER]
* OPT: Optimize variable initialization.
2023-01-10 21:55:25 +01:00
Benoît Minisini
b03cfc16bf Enable overflow detection when at least 'gcc 8' is used.
[INTERPRETER]
* BUG: Enable overflow detection when at least 'gcc 8' is used.
2023-01-10 17:08:16 +01:00
Benoît Minisini
caacdd9c2f Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported. Fix reference leak in drag & drop target management of Qt components.
[INTERPRETER]
* NEW: 'GB.Push()' now can handle Variant values.

[GB.GTK]
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.GTK3]
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.QT4]
* BUG: Fix reference leak in drag & drop target management.
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.QT5]
* BUG: Fix reference leak in drag & drop target management.
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.
2023-01-09 02:45:52 +01:00
Benoît Minisini
f05de9b897 Fix rewrite of ERROR instruction.
[GB.EVAL]
* BUG: Fix rewrite of ERROR instruction.
2023-01-05 17:39:29 +01:00
Benoît Minisini
1fd1d16ec8 Convert two global interpreter flags from boolean to bitfield.
[INTERPRETER]
* NEW: Convert two global interpreter flags from boolean to bitfield.
* NEW: Remove a unused JIT API and take the previous into account.

[GB.JIT]
* NEW: Take the boolean to bitfield interpreter flag changes into account.
2023-01-04 18:49:13 +01:00
Benoît Minisini
95574a9170 'System.IgnoreOverflow' is a new property that allows to ignore overflows in arithmetic operations.
[INTERPRETER]
* NEW: 'System.IgnoreOverflow' is a new property that allows to ignore overflows in arithmetic operations.
* OPT: Replace most of boolean global interpreter flags by bitfields.
2023-01-04 17:06:41 +01:00
Benoît Minisini
51a88d26b4 'Error' keyword is now correctly written without spurious spaces around.
[GB.TEST]
* BUG: 'Error' keyword is now correctly written without spurious spaces around.
2023-01-04 17:05:46 +01:00
Benoît Minisini
c24d92c21d Correctly rewrite the 'Error' keyword.
[COMPILER]
* NEW: Synchronize with 'gb.eval' parser.

[GB.EVAL]
* NEW: Synchronize with compiler parser.
* BUG: Correctly rewrite the 'Error' keyword.
2023-01-04 17:04:34 +01:00
Benoît Minisini
7a8610f779 Paint.Rectangle() with a border radius now works as expected with a negative width or height.
[GB.DRAW]
* BUG: Paint.Rectangle() with a border radius now works as expected with a negative width or height.
2023-01-03 14:38:46 +01:00
Benoît Minisini
ffa0611cea Factorize exception management in JIT code.
[GB.JIT]
* OPT: Factorize exception management in JIT code.
2023-01-03 14:25:00 +01:00
Benoît Minisini
3c1a76248b Add Expand() and Shrink() methods to the rectangle classes.
[GB.GEOM]
* NEW: Add Expand() and Shrink() methods to the rectangle classes.
2023-01-02 20:22:30 +01:00
Benoît Minisini
cdece09186 Check all child terminations when we detect that the SIGCHLD handler has been replaced by an idiotic library like 'glib'.
[INTERPRETER]
* BUG: Check all child terminations when we detect that the SIGCHLD handler has been replaced by an idiotic library like 'glib'.
2023-01-01 11:24:44 +01:00
Benoît Minisini
b2e95aa882 Prevent Add(), Remove() and Resize() methods on read-only arrays.
[INTERPRETER]
* BUG: Prevent Add(), Remove() and Resize() methods on read-only arrays.
2022-12-24 14:07:03 +01:00
Benoît Minisini
98fb2a0fc7 Do not check for a project directory when listing archive files.
[ARCHIVER]
* BUG: Do not check for a project directory when listing archive files.
2022-12-23 13:51:20 +01:00
Benoît Minisini
21e72303ab Add the '-l' option to list all files included in an archive.
[ARCHIVER]
* NEW: Add the '-l' option to list all files included in an archive.
2022-12-23 12:31:17 +01:00
Benoît Minisini
b145355b76 The debugger now indicates if the printed information is from the current stack frame or from another one.
[GB.DEBUG]
* NEW: The debugger now indicates if the printed information is from the current stack frame or from another one.
2022-12-16 08:46:17 +01:00
Benoît Minisini
d13471c82a Forgot to commit a source file in commit 76196d2c!
[COMPILER]
* BUG: Forgot to commit a source file in commit 76196d2c!
2022-12-12 16:43:41 +01:00
Benoît Minisini
76196d2cd5 Fix parsing of 'Debug' symbol in preprocessor lines. Don't crash anymore if an error is raised while reading command-line arguments.
[COMPILER]
* BUG: Fix parsing of 'Debug' symbol in preprocessor lines.
* BUG: Don't crash anymore if an error is raised while reading command-line arguments.
2022-12-11 16:44:46 +01:00
Benoît Minisini
7480a9b14c Workaround incorrect use of unsigned color constants by the IDE form editor.
[COMPILER]
* NEW: Workaround incorrect use of unsigned color constants by the IDE form editor.
2022-12-10 20:44:10 +01:00
Benoît Minisini
53cd261647 Fix jump optimization again.
[COMPILER]
* BUG: Fix jump optimization again.
2022-12-10 20:36:49 +01:00
Benoît Minisini
bab0f763c5 Do not run jump optimization on ON GOTO / ON GOSUB, it breaks them.
[COMPILER]
* BUG: Do not run jump optimization on ON GOTO / ON GOSUB, it breaks them.
2022-12-10 19:39:17 +01:00
Benoît Minisini
c10fe0a6c3 Optimization of conditional jumps based on values known to be Boolean.
[COMPILER]
* OPT: Optimization of conditional jumps based on values known to be Boolean.
* BUG: Jump optimization is effective when debugging information is generated.
* BUG: The '/' operator correctly returns a Float if its arguments are Float.

[INTERPRETER]
* OPT: Optimization of conditional jumps based on values known to be Boolean.

[GB.JIT]
* NEW: Support for conditional jumps optimization.
2022-12-10 12:54:42 +01:00
Benoît Minisini
0acbd1979c Ignore jumps to the end of the function when optimizing jumps.
[COMPILER]
* BUG: Ignore jumps to the end of the function when optimizing jumps.
2022-12-10 00:22:17 +01:00
Benoît Minisini
e495a05249 The Image constructor now fills the image data with 'Color.Transparent' color by default.
[GB.IMAGE]
* NEW: The Image constructor now fills the image data with 'Color.Transparent' color by default. To get uninitialized image data, you must specified 'Color.Default' as fill color.
2022-12-10 00:06:50 +01:00
Benoît Minisini
e082046379 Suppression de deux étiquettes inutiles dans la boucle de l'interpréteur.
[INTERPRETER]
* BUG: Suppression de deux étiquettes inutiles dans la boucle de l'interpréteur.
2022-12-09 20:05:39 +01:00
Benoît Minisini
5d0c54bca2 Some fixes in overflow detection.
[INTERPRETER]
* BUG: Fix overflow detection in conversion functions.
* BUG: Check for overflow detection only if the '__has_builtin' pseudo-macro is implemented by the compiler.
2022-12-09 16:07:12 +01:00
Benoît Minisini
af950247c4 Implement overflow detection in JIT compiler. Some jump optimizations in the compiler and the interpreter.
[COMPILER]
* OPT: Optimize jumps pointing at a JUMP instruction.

[INTERPRETER]
* OPT: Avoid conversion to boolean when possible in conditional jumps.

[GB.JIT]
* NEW: Implement overflow detection in integer arithmetic operations. The UNSAFE keyword disable them to get full speed.
2022-12-09 15:00:55 +01:00