Commit graph

2132 commits

Author SHA1 Message Date
gambas
b02810d025 Fix Find() method on Float, Single, and Long arrays.
[INTERPRETER]
* BUG: Fix Find() method on Float, Single, and Long arrays.
2019-11-09 11:34:43 +01:00
Laurent Carlier
3f099c9b83 Partially revert "Remove register keyword, deprecated, now reserved keyword with C++17"
This partially reverts commit f1deb8e330.

Register keyword can be useful when the interpreter is built with '-Os'
2019-10-30 10:37:29 +01:00
Laurent Carlier
f1deb8e330 Remove register keyword, deprecated, now reserved keyword with C++17
Fixes "warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]"
with clang

https://en.cppreference.com/w/cpp/keyword/register
2019-10-30 06:53:09 +00:00
gambas
d8abac4cce Fix exponent sign printed twice in float to string conversion.
[INTERPRETER]
* BUG: Fix exponent sign printed twice in float to string conversion.
2019-10-29 09:20:41 +01:00
gambas
65d2b783fe Paint.TextHeight is a new property that returns the height of one line of text, and Paint.FontScale is now "transparent".
[GB.DRAW]
* NEW: Paint.TextHeight is a new property that returns the height of one line of text. This is not the same as Paint.Font.Height, as the device resolution is taken into account.

[GB.GTK]
* NEW: Paint.FontScale is now "transparent". Paint.Font.Size is not changed anymore when assigning the Paint.Font property.

[GB.GTK3]
* NEW: Paint.FontScale is now "transparent". Paint.Font.Size is not changed anymore when assigning the Paint.Font property.

[GB.QT4]
* NEW: Paint.FontScale is now "transparent". Paint.Font.Size is not changed anymore when assigning the Paint.Font property.

[GB.QT5]
* NEW: Paint.FontScale is now "transparent". Paint.Font.Size is not changed anymore when assigning the Paint.Font property.
* BUG: Utility windows now kept being in front of their parent window correctly.
2019-10-26 01:06:18 +02:00
gambas
f75de9a70f Fix highlighting of long lines and comments.
[GB.EVAL.HIGHLIGHT]
* BUG: Fix highlighting of long lines and comments.
2019-10-25 15:24:04 +02:00
gambas
8d8c8a71f8 Remove a useless global variable.
[INTERPRETER]
* BUG: Remove a useless global variable.
2019-10-21 09:44:52 +02:00
gambas
8c6f234cf4 Do JIT compilation after class loading. Otherwise the JIT compiler may want to load the class that triggers the compilation again.
[INTERPRETER]
* BUG: Do JIT compilation after class loading. Otherwise the JIT compiler may want to load the class that triggers the compilation again.
2019-10-12 13:06:01 +02:00
gambas
b7f2918fbd Correctly generate metadata file for events so that there is no spurious ByRef arguments anymore.
[COMPILER]
* BUG: Correctly generate metadata file for events so that there is no spurious ByRef arguments anymore.
2019-10-08 09:12:12 +02:00
gambas
e8ae38e098 Forgot to commit common header files.
[INTERPRETER]
* BUG: Forgot to commit common header files.
2019-10-07 22:04:56 +02:00
gambas
719f7967ad System.Trace is a new property that toggles the dump of the position of each executed line.
[INTERPRETER]
* NEW: Add command-line help for the '-t' option.
* NEW: The '-t' command-line option has a '--trace' long version.
* NEW: System.Trace is a new property that toggles the dump of the position of each executed line.
2019-10-05 04:03:32 +02:00
gambas
b73b47aca6 Floating-point number to string conversion is now 1.7 times faster.
[INTEPRETER]
* OPT: Floating-point number to string conversion is now 1.7 times faster.
2019-09-28 21:15:59 +02:00
gambas
28df313554 Add a '-t' option that dumps to the standard error the position of each executed line of code.
[INTERPRETER]
* NEW: Add a '-t' option that dumps to the standard error the position of each executed line of code.
2019-09-28 16:53:48 +02:00
gambas
f08ce22cdc Fix support of read-only arrays.
[INTERPRETER]
* BUG: Read-only arrays are now really read-only.

[GB.JIT]
* BUG: Support for read-only arrays.
2019-09-26 14:25:37 +02:00
gambas
7a49f039b5 Uncatched errors raised from an event handler can be ignored now.
[INTERPRETER]
* NEW: Uncatched errors raised from an event handler can be ignored now.

[GB.GTK]
* NEW: Uncatched errors raised from an event handler can be ignored now.

[GB.GTK3]
* NEW: Uncatched errors raised from an event handler can be ignored now.

[GB.QT4]
* NEW: Uncatched errors raised from an event handler can be ignored now.

[GB.QT5]
* NEW: Uncatched errors raised from an event handler can be ignored now.
2019-09-17 10:10:36 +02:00
gambas
225f2833da Fix again the management of the new new PROPERTY ... USE syntax.
[COMPILER]
* NEW: Don't emit debugging information for generated functions, but emit void sections for backward compatibility.
* NEW: Don't emit source file path in the debugging information.
2019-09-12 03:23:38 +02:00
gambas
133fd6e2d9 Fix again some crash when using the new PROPERTY ... USE syntax.
[COMPILER]
* BUG: Fix again some crash when using the new PROPERTY ... USE syntax.
2019-09-11 19:50:19 +02:00
gambas
51a9a1035d Fix crash when using the new PROPERTY ... USE syntax.
[COMPILER]
* BUG: Fix crash when using the new PROPERTY ... USE syntax.
2019-09-11 19:38:04 +02:00
gambas
d3fdd6fdda Error.Clear() now clears the error flag returned by the ERROR function.
[INTERPRETER]
* NEW: Error.Clear() now clears the error flag returned by the ERROR function.
2019-09-09 23:58:11 +02:00
gambas
a3b14f765b Fix the declaration of static properties using USE.
[COMPILER]
* BUG: Fix the declaration of static properties using USE.
2019-09-05 23:31:19 +02:00
gambas
234c2c690a [GB.DB]
* NEW: Add a driver API that handles debugging messages.
* NEW: Print the current date/time before any debugging message.

[GB.DB.MYSQL]
* NEW: Use the new driver API to print debugging messages.

[GB.DB.ODBC]
* NEW: Use the new driver API to print debugging messages.

[GB.DB.POSTGRESQL]
* NEW: Use the new driver API to print debugging messages.

[GB.DB.SQLITE2]
* NEW: Use the new driver API to print debugging messages.

[GB.DB.SQLITE3]
* NEW: Use the new driver API to print debugging messages.
2019-08-30 09:09:16 +02:00
gambas
56b7b9e322 Forgot a comma in the error message list, making the raise of the last error message crash.
[INTERPRETER]
* BUG: Forgot a comma in the error message list, making the raise of the last error message crash.
2019-08-24 01:57:16 +02:00
gambas
51e271f107 Fix '&/' operator.
[INTERPRETER]
* BUG: Fix '&/' operator.
2019-08-22 12:36:52 +02:00
gambas
abf4dfb110 PROPERTY...USE... is a new syntax to declare a property automatically associated with a private global variable.
[COMPILER]
* NEW: PROPERTY...USE... is a new syntax to declare a property automatically associated with a private global variable.
2019-08-22 03:13:58 +02:00
gambas
7b74fec6cc '&/' operator now automatically converts its arguments to strings.
[INTERPRETER]
* NEW: '&/' operator now automatically converts its arguments to strings.
2019-08-21 22:36:54 +02:00
gambas
411ee75e7d Fix JIT compilation when there are a lot of functions.
[INTERPRETER]
* BUG: Fix JIT compilation when there are a lot of functions.
2019-08-21 22:08:45 +02:00
gambas
4d59c6062d Fix boolean datatype management.
[GB.JIT]
* BUG: Fix boolean datatype management.
2019-08-21 01:23:12 +02:00
gambas
db50637bf4 Static class initializer are now always correctly run in the context of their component.
[INTERPRETER]
* BUG: Static class initializer are now always correctly run in the context of their component.
2019-08-03 00:13:56 +02:00
gambas
b11d422c14 Array.ReadOnly is a new property that make an array read-only. Once set, the property cannot be unset.
[INTERPRETER]
* NEW: Array.ReadOnly is a new property that make an array read-only. Once set, the property cannot be unset.
* NEW: The "Embedded array" error message has been rewritten as "Read-only array".
* NEW: Add two new standard errors: "Multidimensional array" and "Unknown class".
* NEW: Replace some specific error messages by standard errors.
2019-07-31 00:20:13 +02:00
gambas
f6f7f85f8b Add ByRef annotations to the ".info" files generated by the compiler.
[COMPILER]
* NEW: Add ByRef annotations to the ".info" files generated by the compiler. The name of "ByRef" method arguments is now prefixed with a '&' character.
2019-07-15 15:38:52 +02:00
gambas
8e487e5b18 Painting on an already painted device now correctly inherits the Paint.FontScale property.
[GB.DRAW]
* BUG: Painting on an already painted device now correctly inherits the Paint.FontScale property.
2019-07-10 04:22:14 +02:00
gambas
798b1d54cc Add Paint.FontScale, and make gb.gtk and gb.gtk3 printer drawing behave the same as QT components.
[GB.DRAW]
* NEW: Paint: FontScale is a new property that defines a scale applied to the size of the fonts assigned to the Paint.Font property.
* NEW: Paint: Scale() second argument is now optional, and takes the same value as the first argument if omitted.

[GB.GTK]
* NEW: Paint: Implementation of Paint.FontScale.
* BUG: Printer: All printer events are raised between a single Paint.Begin() / Paint.End().

[GB.GTK3]
* NEW: Paint: Implementation of Paint.FontScale.
* BUG: Printer: All printer events are raised between a single Paint.Begin() / Paint.End().
* BUG: Printer: Print() does now crash anymore.
* BUG: Printer: Font sizes now are the same as with QT components.

[GB.QT4]
* NEW: Paint: Implementation of Paint.FontScale.

[GB.QT5]
* NEW: Paint: Implementation of Paint.FontScale.
2019-07-09 19:35:01 +02:00
gambas
01a3106d20 New Highlight.Alternate style, and make the matching braces blink with the cursor.
[GB.EVAL]
* NEW: Highlight.Alternate is a new constant that represents the background style used for coloring code embedded into webpages.

[GB.EVAL.HIGHLIGHT]
* NEW: Support for new Highlight.Alternate style.

[GB.FORM.EDITOR]
* NEW: Support for new Highlight.Alternate style.
* NEW: Matching braces now blink with the cursor.
* BUG: When the cursor moves, the blinking timer is reset so that the cursor blinks only when it is not moving.
2019-06-29 16:11:51 +02:00
gambas
4128a33adf Update library to version 6.4.2.
[GB.CLIPPER]
* NEW: Update library to version 6.4.2.
* BUG: Get rid of a gcc warning.
2019-06-29 16:10:21 +02:00
gambas
23c426857f Don't crash anymore when searching into an archive that failed to load.
[INTERPRETER]
* BUG: Don't crash anymore when searching into an archive that failed to load.
* BUG: The archive path is now a dynamic string.
2019-06-27 12:59:32 +02:00
gambas
bc8223e240 If the current translation does not exist, try to use the first available translation of the same language in another country.
[INTERPRETER]
* NEW: If the current translation does not exist, try to use the first available translation of the same language in another country.
2019-06-22 01:20:38 +02:00
gambas
cfb4a9d2a8 Enumerating an unknown datatype does not raise an error automatically anymore.
[GB.JIT]
* BUG: Enumerating an unknown datatype does not raise an error automatically anymore.
2019-06-18 09:50:56 +02:00
gambas
8d76cc99ba Component.Load() can load a component located at an absolute path now.
[INTERPRETER]
* NEW: Component.Load() can load a component located at an absolute path now.
2019-06-14 01:26:12 +02:00
gambas
ce37d6ff67 Ignore errors when loading a class for the JIT compiler.
[INTERPRETER]
* BUG: Ignore errors when loading a class for the JIT compiler.

[GB.JIT]
* BUG: Loading a class during JIT compilation can fail. Take that into account.
2019-06-11 22:32:12 +02:00
gambas
609e3348dd Stream.Eof is a new property that returns if end of stream has been reached.
[INTERPRETER]
* NEW: Stream.Eof is a new property that returns if end of stream has been reached. It's the same thing as Eof(Stream).
2019-05-20 16:14:17 +02:00
gambas
19b83e535d Fix 'gb.Scientific' number format.
[INTERPRETER]
* BUG: Fix 'gb.Scientific' number format.
2019-05-09 00:04:18 +02:00
gambas
cea4b4d1e4 Fix column computation when compiling expression tree.
[COMPILER]
* BUG: Fix column computation when compiling expression tree.
2019-05-08 15:32:11 +02:00
gambas
beb79ec952 Fix a forgotten '!' that broke the informer.
[INFORMER]
* BUG: Fix a forgotten '!' that broke the informer.
2019-05-08 14:15:01 +02:00
gambas
7ea4fb4ca5 Remove a useless memory allocation in column annotation. The compiler is now just 0.5% slower than before.
[COMPILER]
* OPT: Remove a useless memory allocation in column annotation. The compiler is now just 0.5% slower than before.
2019-05-08 06:27:14 +02:00
gambas
9f2da35cbe Emit column position in almost all error messages.
[COMPILER]
* OPT: Some optimizations in symbol table routines.
* NEW: Emit column position in almost all error messages. It makes the compiler 2.5% slower, even with the optimizations.
2019-05-08 06:20:35 +02:00
bgermann
44e3f4f7a3 Add missing wait header
WIFEXITED and WEXITSTATUS are used, so add sys/wait.h
2019-05-01 11:59:26 +02:00
gambas
7c0a6730cd Complete support for project extra references.
[CONFIGURATION]
* NEW: Update version to 3.13.90.

[DEVELOPMENT ENVIRONMENT]
* NEW: Redone extra references support.

[COMPILER]
* NEW: Take project extra references into account.

[GB.TERM.FORM]
* BUG: Fix project description.
2019-04-23 12:31:10 +02:00
gambas
f23228638b Fix Url$() escaping characters.
[INTERPRETER]
* BUG: Fix Url$() escaping characters.
2019-04-04 23:12:07 +02:00
gambas
3dd1fd493e Fix the JIT compiler: '_init' method, Lock instruction, Object datatype, and DO / REPEAT loops at the beginning of a function now work correctly.
[INTERPRETER]
* BUG: JIT compiler does not run static initializers anymore when loading a class. Otherwise bytecode can be modified before being compiled, leading to a JIT compiler crash.

[COMPILER]
* BUG: Fix LOCK subroutine meta-information.

[GB.JIT]
* NEW: Don't display abortion debugging message if there is no compilation to abort.
* BUG: Object variables are correctly managed now.
* BUG: DO...LOOP and REPEAT...UNTIL at the beginning of the function now is correctly compiled in all cases.
2019-04-04 22:58:06 +02:00
gambas
6c9df4c423 Cosmetic changes in debugger code.
[INTERPRETER]
* NEW: Cosmetic changes in debugger code.

[GB.DEBUG]
* NEW: Cosmetic changes in debugger code.
2019-03-21 23:14:22 +01:00
gambas
2bb7d795b7 Fix Array.Shuffle() on String, Long and Object arrays.
[INTERPRETER]
* BUG: Fix Array.Shuffle() on String, Long and Object arrays.
2019-03-20 19:39:56 +01:00
gambas
a6eb422756 Array.Shuffle() is a new method that randomly shuffles an array using Fisher–Yates algorithm.
[INTERPRETER]
* NEW: Array.Shuffle() is a new method that randomly shuffles an array using Fisher–Yates algorithm.
2019-03-20 15:08:16 +01:00
gambas
faa54caf02 Tasks work again.
[INTERPRETER]
* BUG: Tasks work again.
2019-03-15 19:44:48 +01:00
gambas
9893891365 ASSERT ... PRINT or ERROR allows to use PRINT or ERROR to print a message when the assertion fails.
[COMPILER]
* NEW: ASSERT ... PRINT or ERROR allows to use PRINT or ERROR to print a message when the assertion fails.
2019-03-15 19:36:22 +01:00
gambas
0bbf4761d6 Enhance formatting of unary minus operator.
[GB.EVAL]
* NEW: Enhance formatting of unary minus operator.
2019-03-14 02:47:36 +01:00
gambas
a8bcabb741 Unary minus operator is now sticked to its argument when put between parentheses or brackets.
[GB.EVAL]
* NEW: Unary minus operator is now sticked to its argument when put between parentheses or brackets.
2019-03-14 01:52:37 +01:00
gambas
d3a182aa0e Raise an error if there is not enough local slots for control structures.
[COMPILER]
* BUG: Raise an error if there is not enough local slots for control structures.
2019-03-13 14:25:32 +01:00
gambas
63d9d81bd2 Disabling JIT compiler works correctly again.
[INTERPRETER]
* BUG: Disabling JIT compiler works correctly again.
2019-03-13 12:59:14 +01:00
gambas
a0bcf85bd4 Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop.
[INTERPRETER]
* BUG: Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop. Consequently, a process started before the declaration of the event loop will have its termination signal correctly catched.
* NEW: Use waitpid() instead of wait4().

[GB.GTK]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.GTK3]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT4]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT5]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.
2019-03-12 03:46:30 +01:00
gambas
eb8c871740 Don't try to abort JIT compilation if the JIT component is not loaded.
[INTERPRETER]
* BUG: Don't try to abort JIT compilation if the JIT component is not loaded.
2019-03-11 17:53:18 +01:00
gambas
3f7095bbd9 Run JIT compilation in the background to make programs start faster.
[INTERPRETER]
* OPT: JIT compilation is run in two steps.

[GB.JIT]
* OPT: Run JIT compilation in the background.
* NEW: JIT.Debug is a new property that allows to enable JIT debugging messages at runtime.
2019-03-11 16:34:50 +01:00
gambas
209a8faacf Fix SortUsing() methods public declaration.
[INTERPRETER]
* BUG: Fix SortUsing() methods public declaration.
2019-03-08 21:51:27 +01:00
gambas
f38f1b1657 Variant[].Sort() and Variant[].SortUsing() methods have been added and SortUsing() methods now take an optional sort mode as second argument.
[INTERPRETER]
* NEW: Variant[].Sort() and Variant[].SortUsing() methods have been added.
* NEW: SortUsing() methods now take an optional sort mode as second argument.
2019-03-08 21:42:33 +01:00
gambas
c7d6ddd31f String.Right() does not crash anymore on invalid UTF-8 strings.
[INTERPRETER]
* BUG: String.Right() does not crash anymore on invalid UTF-8 strings.
2019-03-08 12:28:41 +01:00
Tobias Boege
76da51ce70 gb.inotify: Fix Watch.Events[] accessor
[GB.INOTIFY]
* BUG: Watch.Events._put incorrectly reset events outside the given event set and ignored the assigned value.
2019-03-07 08:24:08 +01:00
gambas
d668dadcf5 Array.SortUsing() is a new method that sorts an array according to the sort order defined by another array.
[INTERPRETER]
* NEW: Array.SortUsing() is a new method that sorts an array according to the sort order defined by another array.
2019-03-06 03:55:48 +01:00
gambas
b8af5cf289 Merge branch 'master' of gitlab.com:gambas/gambas 2019-03-04 01:36:35 +01:00
gambas
b257119380 String.Code() now returns -1 on incorrect UTF-8 string.
[INTERPRETER]
* BUG: String.Code() now returns -1 on incorrect UTF-8 string.
2019-03-04 01:35:33 +01:00
gambas
a0302b7f77 Optimize division, thanks to Cedron Dawg.
[GB.COMPLEX]
* OPT: Optimize division, thanks to Cedron Dawg.
2019-03-02 12:50:33 +01:00
gambas
fd7ae28ac9 File.RealPath() is a new statis method that returns the the canonicalized absolute pathname of path, with no symbolic links inside.
[INTERPRETER]
* NEW: File.RealPath() is a new statis method that returns the the canonicalized absolute pathname of path, with no symbolic links inside.
2019-02-28 02:57:25 +01:00
gambas
7c808bbba3 Define a new limit constant, that is the maximum length of the System.Language variable. It is 16 bytes.
[INTERPRETER]
* NEW: Define a new limit constant, that is the maximum length of the System.Language variable. It is 16 bytes.
2019-02-26 21:01:18 +01:00
gambas
3cd80f118d Allocate custom language environment variables statically, because environment is accessed by shared library exit routines, after the interpreter memory allocations have been freed.
[INTERPRETER]
* BUG: Allocate custom language environment variables statically, because environment is accessed by shared library exit routines, after the interpreter memory allocations have been freed.
2019-02-26 20:59:03 +01:00
gambas
1f73946947 Put 'gbh3' back into the git repository.
[CONFIGURATION]
* BUG: Don't put main/tools in .gitignore.

[HELPER]
* BUG: Put 'gbh3' back into the git repository.
2019-02-25 00:20:43 +01:00
gambas
b4a8adf222 Fix string to floating point conversion routine.
[INTERPRETER]
* BUG: Fix string to floating point conversion routine.
2019-02-16 02:00:17 +01:00
gambas
4f72989680 Unused function warnings now point at the beginning of the function.
[COMPILER]
* BUG: Unused function warnings now point at the beginning of the function.
2019-02-08 23:07:47 +01:00
gambas
466a570451 Connection.GetTemplate() and Connection.ApplyTemplate() now take tables without primary key into account correctly.
[GB.DB]
* BUG: Connection.GetTemplate() and Connection.ApplyTemplate() now take tables without primary key into account correctly.
2019-02-06 23:24:08 +01:00
gambas
c0eab6b4c4 Don't crash if a component use NULL as error message argument. Replace it by a void string.
[INTERPRETER]
* BUG: Don't crash if a component use NULL as error message argument. Replace it by a void string.
2019-02-06 23:23:18 +01:00
gambas
5bb2f41b21 Remove '*.mo' files now automatically generated by the compiler, and other filed that should be ignored too. 2019-02-02 01:07:37 +01:00
gambas
245d3d7429 Do not add an extra decimal digit to floating point numbers, it introduces rounding errors.
[INTERPRETER]
* BUG: Do not add an extra decimal digit to floating point numbers, it introduces rounding errors.
2019-01-26 15:24:46 +01:00
gambas
fe55f495f4 Fix the default value of optional Object function arguments.
[GB.JIT]
* BUG: Fix the default value of optional Object function arguments.
2019-01-20 22:50:35 +01:00
gambas
912d804daa Raise the maximum number of decimal digit of a Float value to 16.
[INTERPRETER]
* NEW: Raise the maximum number of decimal digit of a Float value to 16.
2019-01-19 01:06:38 +01:00
gambas
f1ed9011a3 If the option '-t' is specified, the compiler now automatically calls 'msgfmt' to compile the translation files if needed.
[COMPILER]
* NEW: If the option '-t' is specified, the compiler now automatically calls 'msgfmt' to compile the translation files if needed.
2019-01-19 01:03:57 +01:00
gambas
69d864f1d4 Ignore trailing zeros in the decimal part of floating point number constants.
[INTERPRETER]
* NEW: Allow one more decimal digit in floating point number constants.
* BUG: Ignore trailing zeros in the decimal part of floating point number constants. It may introduce rounding differences.
2019-01-16 04:32:44 +01:00
gambas
b97b82133a Make the "./" path equivalent to "." as before, and not a prefix for a component with a null name.
[INTERPRETER]
* BUG: Make the "./" path equivalent to "." as before, and not a prefix for a component with a null name.
2019-01-11 16:02:02 +01:00
gambas
ced4594599 Take care of components that modifiy the 'environ' variable. Using 'gb.httpd' does not crash anymore.
[INTERPRETER]
* BUG: Take care of components that modifiy the 'environ' variable. Using 'gb.httpd' does not crash anymore.
2019-01-11 15:23:50 +01:00
gambas
5c3ce53f61 Fix Debug instruction and support for the new Assert instruction.
[GB.JIT]
* BUG: Fix Debug instruction.
* BUG: Support for the new Assert instruction.
2019-01-11 01:46:13 +01:00
gambas
634b5c4168 Really fix the loop optimization.
[INTERPRETER]
* BUG: Really fix the loop optimization.
2019-01-11 01:14:42 +01:00
gambas
dd551e9bc5 Fix loop optimization that didn't work on loops calling themselves recursively.
[INTERPRETER]
* BUG: Fix loop optimization that didn't work on loops calling themselves recursively.
2019-01-11 01:11:46 +01:00
gambas
26448880a1 Support for 'tcc' compiler.
[GB.JIT]
* NEW: Support for 'tcc' compiler.
2019-01-08 01:53:38 +01:00
gambas
628aa30e54 Take the other requested GUI components into account to choose the toolkit.
[INTERPRETER]
* NEW: Add a API to know if a native component exists on the disk.

[GB.GUI]
* BUG: Take the other requested GUI components into account to choose the toolkit.

[GB.GUI.QT]
* BUG: Take the other requested GUI components into account to choose the toolkit.
2019-01-05 03:57:08 +01:00
gambas
0266ca1f15 InStr() and RInstr() work correctly again when case is ignored and pattern length is at least two characters.
[INTERPRETER]
* BUG: InStr() and RInstr() work correctly again when case is ignored and pattern length is at least two characters.
2019-01-03 19:58:17 +01:00
gambas
17bbc13df6 Do not use loop initial declaration in generated C code for old gcc versions.
[GB.JIT]
* BUG: Do not use loop initial declaration in generated C code for old gcc versions.
2019-01-03 10:29:44 +01:00
gambas
245427b08e * Get rid of many gcc warnings. 2019-01-02 00:48:58 +01:00
gambas
bfc88545c8 Correctly clear observer reference on the observed object when it is freed.
[INTERPRETER]
* BUG: Correctly clear observer reference on the observed object when it is freed.
* BUG: Clear environment variables set by the interpreter, as they can be read by the shared libraries exit routines after main() has been terminated.
2018-12-24 17:57:36 +01:00
gambas
87f88ac88b Fix Debug instruction.
[INTERPRETER]
* BUG: Fix Debug instruction.
2018-12-21 22:40:47 +01:00
gambas
fc41ff0b23 Assertion errors are now really not catchable anymore.
[INTERPRETER]
* BUG: Assertion errors are now really not catchable anymore.
2018-12-21 03:05:32 +01:00
gambas
c2c18510e1 Assertion errors are now not catchable anymore. They always stop the program.
[INTERPRETER]
* BUG: Assertion errors are now not catchable anymore. They always stop the program.
2018-12-21 00:47:34 +01:00
gambas
d91451cf1e Assert is an new instruction that raises an error as soon as its boolean argument is FALSE.
[COMPILER]
* NEW: Assert is an new instruction that raises an error as soon as its boolean argument is FALSE. The associated bytecode is not emitted if the '-x' option is specified.

[INTERPRETER]
* NEW: Assert is an new instruction that raises an error as soon as its boolean argument is FALSE.

[GB.DEBUG]
* BUG: Fix a potential array overflow.
2018-12-16 00:35:46 +01:00
gambas
26117d0fc9 [COMPILER]
* BUG: Compiler messages are prefixed with 'gbc3:', not just 'gbc:'.
* NEW: Make loop variable errors more accurate.
2018-12-14 05:16:24 +01:00
gambas
a1f96a549c Allow loop variables to be declared inside the loop syntax.
[COMPILER]
* NEW: Allow loop variables to be declared inside the loop syntax.
* NEW: Consequently, FOR EACH now can only use local variables.

[INTERPRETER]
* OPT: A little optimization of integer loops. They are about 5% faster now.
2018-12-13 13:15:33 +01:00
gambas
068274ea85 Fix compilation of control structures again.
[COMPILER]
* BUG: Fix compilation of control structures again.
2018-12-12 16:27:02 +01:00
gambas
c947cb1b40 Correctly compile structure controls mixed with variable declarations.
[COMPILER]
* BUG: Correctly compile structure controls mixed with variable declarations.
2018-12-12 01:40:44 +01:00
gambas
82a9dca733 Allow local variable declaration anywhere in the function.
[COMPILER]
* NEW: Allow local variable declaration anywhere in the function. The local symbol still has a function scope, but can be used after its declaration only.
2018-12-11 02:40:14 +01:00
gambas
43350ebfbd Connection.LastInsertId now raises an error instead of crashing when the connection is closed.
[GB.DB]
* BUG: Connection.LastInsertId now raises an error instead of crashing when the connection is closed.
2018-12-10 23:35:21 +01:00
gambas
b897cec6cf Remove the include of <stdio.h> from JIT header file.
[GB.JIT]
* BUG: Remove the include of <stdio.h> from JIT header file.
2018-12-09 03:50:14 +01:00
gambas
df275f7c9b Forgot to call JIT function when the call is dynamic, i.e. if the object owning the method has an anonymous datatype (Object or Variant).
[INTERPRETER]
* BUG: Forgot to call JIT function when the call is dynamic, i.e. if the object owning the method has an anonymous datatype (Object or Variant).

[GB.JIT]
* BUG: Save the initial stack pointer of a function in the function stack instead of using the interpreter stack.
2018-12-07 01:03:47 +01:00
gambas
52c1243c35 Correctly set the stack pointer before raising an exception in JIT code.
[GB.JIT]
* BUG: Correctly set the stack pointer before raising an exception in JIT code.
2018-12-04 00:48:02 +01:00
gambas
b4d3c7612a Really correctly initialize EC register to NULL before calling a compiled fast method.
[INTERPRETER]
* BUG: Really correctly initialize EC register to NULL before calling a compiled fast method.
2018-11-29 09:10:56 +01:00
gambas
3652b82b3e Let the caller always release the function arguments.
[GB.JIT]
* BUG: Let the caller always release the function arguments.
2018-11-27 02:59:21 +01:00
gambas
62d9bf8676 Void optional arguments are compiled correctly again.
[GB.JIT]
* BUG: Void optional arguments are compiled correctly again.
2018-11-26 11:54:39 +01:00
gambas
7fa5bd5220 Set the SP stack pointer before calling the conversion function to workaround the compiler optimizations and prevent a memory leak at function end if the conversion fails and an exception is raised.
[GB.JIT]
* BUG: Set the SP stack pointer before calling the conversion function to workaround the compiler optimizations and prevent a memory leak at function end if the conversion fails and an exception is raised.
2018-11-26 01:20:09 +01:00
gambas
c0c1adaabc Correctly compile variable argument methods.
[GB.JIT]
* BUG: Correctly compile variable argument methods.
2018-11-24 21:33:18 +01:00
gambas
baaf962ab0 JIT now handles "no return value" errors correctly.
[INTERPRETER]
* BUG: Process.Wait() now handles error output correctly.

[GB.JIT]
* BUG: Display compiler error correctly.
* BUG: Handle "no return value" errors correctly.
2018-11-24 20:00:45 +01:00
gambas
7cd9c0b7ad Use 'volatile' to prevent the compiler from optimizing access to stack pointer in exception handling.
[GB.JIT]
* BUG: Use 'volatile' to prevent the compiler from optimizing access to stack pointer in exception handling.
2018-11-23 06:29:50 +01:00
gambas
a8bd754627 Fix optional inotify library detection.
[CONFIGURATION]
* BUG: Fix optional inotify library detection.
2018-11-21 01:49:12 +01:00
gambas
bd8a5fc56e Optionally link to libnotify on non-Linux systems.
[CONFIGURATION]
* BUG: Optionally link to libnotify on non-Linux systems.
2018-11-21 00:11:42 +01:00
gambas
55d9d0aa2d Integer constants are correctly handled on little endian systems (arm, powerpc64...).
[INTERPRETER]
* BUG: Integer constants are correctly handled on little endian systems (arm, powerpc64...).
2018-11-20 23:11:13 +01:00
gambas
9b77965499 Remove the date from the copyright message defined in 'gb_common.h'
[CONFIGURATION]
* NEW: Remove the date from the copyright message defined in 'gb_common.h'
2018-11-19 23:20:51 +01:00
gambas
f0f113da2b Correctly restore EP after it has been used by the translation of the TRY instruction.
[GB.JIT]
* BUG: Correctly restore EP after it has been used by the translation of the TRY instruction.
2018-11-16 01:33:51 +01:00
gambas
9726b53bb3 Add First and Last read-write properties to arrays.
[INTERPRETER]
* NEW: Add First and Last read-write properties to arrays.
2018-11-09 00:06:20 +01:00
gambas
ecf3410e99 Fix a crash in exception management.
[INTERPRETER]
* BUG: Fix a crash in exception management.
2018-11-07 17:21:38 +01:00
gambas
31901d72c9 Fix the LANGUAGE environment variable at startup, and add hebrew to the list of right-to-left written languages
[INTERPRETER]
* BUG: Fix the LANGUAGE environment variable at startup, not just when System.Language is set. This is a temporary fix, as you lost the contents of LANGUAGE.
* NEW: Add hebrew to the list of right-to-left written languages.
2018-11-06 18:11:51 +01:00
gambas
dcac5c2a26 Handle TRY inside JIT functions correctly.
[INTERPRETER]
* BUG: Handle TRY inside JIT functions correctly.

[GB.DEBUG]
* NEW: Add explicit messages when something fails during initialization.

[GB.JIT]
* BUG: Handle TRY correctly.
2018-11-02 21:44:40 +01:00
Benoît Minisini
e0495b2535 Merge branch 'master' into 'master'
Make main compile on Hurd

See merge request gambas/gambas!48
2018-11-01 00:25:01 +00:00
gambas
615ff675d2 Calling a jit function now correctly checks the number of arguments.
[INTERPRETER]
* BUG: Calling a jit function now correctly checks the number of arguments.
* BUG: Fix a panic message.
2018-10-31 01:56:35 +01:00
gambas
9aa856c3a6 Do not use __DATE__ and __TIME__ macros, they prevent reproducible builds.
[INTERPRETER]
* BUG: Do not use __DATE__ and __TIME__ macros, they prevent reproducible builds.

[COMPILER]
* BUG: Do not use __DATE__ and __TIME__ macros, they prevent reproducible builds.

[ARCHIVER]
* BUG: Do not use __DATE__ and __TIME__ macros, they prevent reproducible builds.

[INFORMER]
* BUG: Do not use __DATE__ and __TIME__ macros, they prevent reproducible builds.
2018-10-26 03:05:02 +02:00
bgermann
730bd63a34 Make main compile on Hurd
Replace some BSD-exclusive with Linux-only ifdefs to not pollute term
with Hurd ifdefs
2018-10-17 22:08:50 +02:00
gambas
921067cd34 The IsAlnum() function was never defined in the subroutine symbol table!
[COMPILER]
* NEW: The IsAlnum() function was never defined in the subroutine symbol table!
2018-10-16 19:31:24 +02:00
gambas
1c6a9c1b52 Define the TRUE/FALSE constant in the generated code again.
[GB.JIT]
* NEW: Define the TRUE/FALSE constant in the generated code again.
2018-10-16 19:30:28 +02:00
Benoît Minisini
aab5aecd72 Merge branch 'mipsterm' into 'master'
Fix missing define on MIPS

See merge request gambas/gambas!47
2018-10-16 17:29:38 +00:00
bgermann
1d93023181 Fix missing define on MIPS
More information: http://lists.busybox.net/pipermail/buildroot/2015-October/140931.html
2018-10-15 21:54:31 +02:00
bgermann
dace3b09ac Remove boolean definitions except in gb_common.h 2018-10-15 18:48:01 +02:00
bgermann
a0e95cc0b8 Spelling: catched -> caught 2018-10-14 21:52:07 +02:00
gambas
ad8ea52b64 Don't crash after a buffered file failed to close.
[INTERPRETER]
* BUG: Don't crash after a buffered file failed to close.
2018-10-11 12:30:45 +02:00
gambas
31929e1e44 Overriding public variables is forbidden, and JIT compiler correctly handles public constants.
[INTERPRETER]
* NEW: Overriding public variables was useless, and is now forbidden to help JIT compiler optimizations.

[GB.JIT]
* BUG: Correctly compile dynamic accesses to public constants.
2018-10-08 16:36:38 +02:00
gambas
5c5eede209 Now configure should really fail only if a component is actually disabled.
[CONFIGURATION]
* BUG: Now configure should really fail only if a component is actually disabled.
2018-10-01 14:00:08 +02:00
gambas
a2d936dedb Fix highlighting of strings including '\xXX' escape sequences.
[GB.EVAL]
* BUG: Fix highlighting of strings including '\xXX' escape sequences.
2018-10-01 10:48:24 +02:00
gambas
aa6b7825d8 Do not disable 'gb.crypt' if libcrypt is not found. Let's suppose it is located in the C system library, as on some systems based on musl and busybox.
[CONFIGURATION]
* NEW: Fix some messages

[GB.CRYPT]
* NEW: Do not disable the component if libcrypt is not found. Let's suppose it is located in the C system library, as on some systems.
2018-09-29 04:40:24 +02:00
gambas
1f29f16e32 Fix information about native classes.
[INTERPRETER]
* BUG: Fix information about native classes.
2018-09-23 22:02:56 +02:00
gambas
737b77c387 String value can be used like object.
[INTERPRETER]
* NEW: String value can be used like object.
* NEW: String[X] returns the X-th character of the string, 0 being the first one.
* NEW: String[X, N] returns N characters from the position X, 0 being the first one. IF N is strictly negative, then all characters from the position X, except the last N characters are returned.
* NEW: String.Len returns the length of the string.

[COMPILER]
* NEW: Allow the [] operator to be applied to a string.
2018-09-23 09:15:29 +02:00
gambas
029f3d35c2 Remove the Connection.TimeZone property, it is not used yet.
[GB.DB]
* NEW: Remove the Connection.TimeZone property, it is not used yet.
2018-09-23 09:12:37 +02:00
Benoît Minisini
a79edf23ed Merge branch 'bsd' into 'master'
More BSD changes

See merge request gambas/gambas!38
2018-09-21 22:55:31 +00:00
gambas
46f21a7f7b Strip png files with ImageMagick convert command. 2018-09-19 20:53:00 +02:00
bgermann
846c4bada9 Change __WORDSIZE definition for BSDs 2018-09-15 10:50:10 +02:00
gambas
6ad1333324 Fix String.InStr() and String.RInstr() in ignore case mode, when the starting position is not specified.
[INTERPRETER]
* BUG: Fix String.InStr() and String.RInstr() in ignore case mode, when the starting position is not specified.
2018-09-14 19:17:56 +02:00
gambas
12c0ebda46 String.InStr() starting position is correctly taken into account now.
[INTERPRETER]
* BUG: String.InStr() starting position is correctly taken into account now.
2018-09-12 13:39:05 +02:00
bgermann
0aaee954d6 [GB.TERM] Compatibility with OpenBSD
[GB.TERM]
* NEW: Compatibility with OpenBSD
2018-09-10 22:04:50 +02:00
gambas
88220d483b Let the interpreter correctly manage exceptions when calling non-JIT code from JIT code.
[INTERPRETER]
* BUG: JIT: Let the interpreter correctly manage exceptions when calling non-JIT code from JIT code.

[GB.JIT]
* BUG: Correctly initialize CP during exception handler.
2018-09-10 20:11:59 +02:00
bgermann
6e2a9d458f Unify BSD ifdefs 2018-09-09 18:26:38 +02:00
gambas
f00acc7104 Default value of optional arguments are correctly referenced now.
[GB.JIT]
* BUG: Default value of optional arguments are correctly referenced now.
2018-09-06 07:41:29 +02:00
gambas
d3a145655a Fix compilation of gb.pdf on old gcc, by checking if the '-std=c++11' flag is available.
[INTERPRETER]
* NEW: Write the name of optional libraries in the warning message displayed when not found.

[GB.PDF]
* BUG: Fix compilation of gb.pdf on old gcc, by checking if the '-std=c++11' flag is available.
2018-09-01 20:05:44 +02:00
Benoît Minisini
ce37927180 Merge branch 'netbsd' into 'master'
Improve NetBSD support

See merge request gambas/gambas!37
2018-09-01 10:28:18 +00:00
gambas
847dcd8ebf Remove other files that should not be tracked by git. 2018-09-01 12:23:05 +02:00
gambas
9ffe91c294 Remove files that should not be tracked by git. 2018-09-01 12:21:57 +02:00
gambas
3cb8b1afc6 Highlight.Analyze works correctly again.
[GB.EVAL]
* BUG: Highlight.Analyze works correctly again.
2018-09-01 12:16:24 +02:00
gambas
2374407b4d [DEVELOPMENT ENVIRONMENT]
* NEW: Update highlighting themes by defining the new color constants.
* NEW: Update French translation.
* BUG: Option dialog: The highlighting color panel now takes the editor font size into account.

[GB.EVAL]
* BUG: Fix string highlighting.
2018-09-01 00:46:48 +02:00
gambas
a73c2ed412 Add three new color constants for syntax highlighting: Escape, Label and Constant.
[COMPILER]
* NEW: Rename a macro constant to avoid a symbol clash when compiling the interpreter.

[INTERPRETER]
* NEW: Get rid of a macro trick in 'gbx_eval.h' header.

[GB.EVAL]
* NEW: Highlight: Add three new color constants for syntax highlighting: Escape, Label and Constant.
* NEW: Rename some source files.
* NEW: Rename some constants.
* NEW: Gambas syntax highlighter now use the three new contants for escape characters in strings, for labels, and for language contants (True, False, Null, +Inf and -Inf).

[GB.EVAL.HIGHLIGHT]
* NEW: Support for the new syntax highlighting color constants.

[GB.FORM.EDITOR]
* NEW: Support for the new syntax highlighting color constants.
2018-08-31 15:58:53 +02:00
bgermann
1b7abb97b7 Correct 3e6d9696 2018-08-30 14:07:18 +02:00
bgermann
3e6d969613 Change enum prefix that collides with statvfs 2018-08-30 13:33:13 +02:00
bgermann
3685f21cbf [GB.TERM] Compatiblitity with NetBSD
[GB.TERM]
* NEW: Compatiblitity with NetBSD
2018-08-30 09:35:44 +02:00
bgermann
b1a12236ad Convert from statfs to more portable statvfs
[INTERPRETER]
* NEW: Convert from statfs to more portable statvfs
2018-08-29 23:59:11 +02:00
bgermann
e74adab7c5 Use FreeBSD exp10() fix for all BSDs
[INTERPRETER]
* BUG: The exp10() function works on all BSDs now
2018-08-29 15:36:25 +02:00
bgermann
a3df769268 Use sys/ioctl.h instead of pty.h
pty.h is not needed because its functions are not used.
Use ioctl.h additionally to the already included termios.h to import the
implicitly used functions/constants.
2018-08-29 14:29:54 +02:00
bgermann
e6028806a0 Fix libltdl workaround for NetBSD 2018-08-29 14:18:33 +02:00
gambas
7a680d738b Correctly compile void function arguments.
[GB.JIT]
* BUG: Correctly compile void function arguments.
2018-08-29 11:22:56 +02:00
gambas
fc2cbe819a Rename 'ClassStat' class as '_ClassStat' to avoid a possible name collision.
[GB.JIT]
* NEW: Rename 'ClassStat' class as '_ClassStat' to avoid a possible name collision.
2018-08-28 17:05:11 +02:00
gambas
7d16436c5c Eof() now correctly works on file bigger than 4GB opened in direct mode.
[INTERPRETER]
* BUG: Eof() now correctly works on file bigger than 4GB opened in direct mode.
2018-08-27 23:57:30 +02:00
gambas
c2b2d7d624 If an unknown symbol is called through a parent class reference, the _unknown() method is not called and an error is raised if the unknown symbol exists in the actual child class.
[INTERPRETER]
* NEW: If an unknown symbol is called through a parent class reference, the _unknown() method is not called and an error is raised if the unknown symbol exists in the actual child class.
2018-08-23 12:22:30 +02:00
gambas
706a605cc3 Correctly restore the stack after calling a method through the interpreter, and handle null values as object values having a null address automatically.
[INTERPRETER]
* NEW: Creating a NULL value now clears the object address field so that it can be freely interpreted as a Object value with a null address by the JIT compiled code.

[GB.JIT]
* BUG: Correctly restore stack after calling a method through the interpreter.
2018-08-22 09:30:27 +02:00
gambas
7ab07bd95f Correctly handle optional object arguments.
[GB.JIT]
* BUG: Correctly handle optional object arguments.
2018-08-20 19:57:47 +02:00
gambas
7492efcc0e Always load the class before accessing a static variable, as it may not be ready.
[INTERPRETER]
* BUG: FIx JIT class loading API.

[GB.JIT]
* BUG: Always load the class before accessing a static variable, as it may not be ready.
2018-08-18 15:28:19 +02:00
gambas
07ccec7358 Compile correctly optional arguments initialization.
[GB.JIT]
* BUG: Compile correctly optional arguments initialization.
2018-08-18 12:03:44 +02:00
gambas
d371614662 Correctly compile conversion from object to boolean.
[GB.JIT]
* BUG: Correctly compile conversion from object to boolean.
2018-08-17 01:04:53 +02:00
gambas
979e22f6e9 Correctly load classes from archives other than the main project one during JIT compilation.
[INTERPRETER]
* NEW: When creating a new class, set its component immediately if we know the archive it comes from.

[GB.JIT]
* BUG: Correctly load classes from archives other than the main project one.
2018-08-16 01:50:45 +02:00
gambas
6d35875a56 Correctly raise exceptions on the number of arguments of function calls.
[GB.JIT]
* BUG: Correctly raise exceptions on the number of arguments of function calls.
2018-08-15 08:37:25 +02:00
gambas
0b341e7c91 Compile optional arguments correctly.
[GB.JIT]
* BUG: Compile optional arguments correctly.
2018-08-15 00:01:51 +02:00
gambas
0297c1bafa Load classes without running the _init method, so that the JIT behaviour is closer to the interpreter behaviour.
[INTERPRETER]
* NEW: Add a JIT API for loading classes without running the _init method.

[GB.JIT]
* BUG: Load classes without running the _init method, so that the JIT behaviour is closer to the interpreter behaviour.
2018-08-14 16:46:55 +02:00
gambas
c569a234be Don't leak memory when converting an object to a boolean and correctly pop the arguments from the stack when propagating an exception.
[GB.JIT]
* BUG: Don't leak memory when converting an object to a boolean.
* BUG: Correctly pop the arguments from the stack when propagating an exception.
2018-08-14 12:15:04 +02:00
gambas
ad16238574 Correctly compile subroutines that return an unknown datatype.
[GB.JIT]
* BUG: Correctly compile subroutines that return an unknown datatype.
2018-08-14 10:57:49 +02:00
gambas
698e5dd948 Fix access to objects that can be invalid.
[GB.JIT]
* BUG: Fix access to objects that can be invalid.
2018-08-13 23:01:27 +02:00
gambas
7a129a8d83 Add support fot date variables.
[GB.JIT]
* NEW: Add support fot date variables.
2018-08-13 22:55:01 +02:00
gambas
ffa3cd0875 Correctly read pointer variables.
[GB.JIT]
* BUG: Correctly read pointer variables.
2018-08-13 00:36:33 +02:00
gambas
bdb60ecef7 Correctly compile long public constants.
[GB.JIT]
* BUG: Correctly compile long public constants.
2018-08-13 00:24:38 +02:00
gambas
9c1fa46558 Reading variants from memory is done correctly now.
[GB.JIT]
* BUG: Reading variants from memory is done correctly now.
2018-08-12 09:43:15 +02:00
gambas
a2123c7f27 Accesses to byte global variables are compiled correctly now.
[GB.JIT]
* BUG: Accesses to byte global variables are compiled correctly now.
2018-08-12 00:22:44 +02:00
gambas
0975e520db JIT: Handle function datatype by raising a type mismatch error.
[INTERPRETER]
* NEW: JIT: Add an API for throwing type mismatch errors.
* BUG: Raise a type mismatch error when converting a function to a variant. Don't panic anymore.

[GB.JIT]
* BUG: Handle function datatype by raising a type mismatch error.
2018-08-11 14:06:46 +02:00
gambas
f882946561 Fix conversions of NULL.
[GB.JIT]
* BUG: Fix conversions of NULL.
2018-08-11 07:55:08 +02:00
gambas
0aedbe63a2 Fix an internal common string routine used by thousand separator management.
[INTERPRETER]
* BUG: Fix an internal common string routine used by thousand separator management.
2018-08-11 07:54:22 +02:00
gambas
aa33e0ddad Add a '-j' option to the interpreter that disable the JIT compiler.
[INTERPRETER]
* NEW: Add a '-j' option to the interpreter that disable the JIT compiler.
2018-08-11 07:53:02 +02:00
gambas
28b52f2de0 Val() correctly reads thousand separators again.
[INTERPRETER]
* BUG: Val() correctly reads thousand separators again.
2018-08-10 23:37:55 +02:00
gambas
4e83422f20 Fix optional arguments management.
[INTERPRETER]
* NEW: Fix panic error message again.

[GB.JIT]
* BUG: Fix optional arguments management.
2018-08-10 14:22:49 +02:00
gambas
3966bfbca7 Fix compilation of variant values borrowings and NULL values conversions.
[GB.JIT]
* BUG: Fix compilation of variant values borrowings.
* BUG: Fix NULL values conversions.
2018-08-10 13:53:20 +02:00
gambas
5df6553247 Fix compilation of variant values releases.
[GB.JIT]
* BUG: Fix compilation of variant values releases.
2018-08-10 13:35:20 +02:00
gambas
4209cffa11 [INTERPRETER]
* NEW: Fix panic error message.

[GB.JIT]
* BUG: Load project classes before try to resolve a unknown symbol.
* BUG: Correctly restore the stack pointer in all cases at function exit.
2018-08-10 13:26:54 +02:00
gambas
f5b1c1c03b Format$ now prints the expected number of decimal digits when using exponential format.
[INTERPRETER]
* BUG: Format$ now prints the expected number of decimal digits when using exponential format.
2018-08-10 11:49:12 +02:00
gambas
7b501542a1 Fix thousand separators again.
[INTERPRETER]
* BUG: Fix thousand separators again.
2018-08-09 15:47:29 +02:00
gambas
acf401ba2d Correctly reset the stack pointer when releasing the stack in error handlers.
[INTERPRETER]
* BUG: Do not clear the 'super' field of the object value returned by NEW, as it does not fix actually anything.

[GB.JIT]
* BUG: Correctly reset the stack pointer when releasing the stack in error handlers.
2018-08-09 11:05:51 +02:00
gambas
bb34431646 Fix a crash in JIT relative to SUPER management.
[INTERPRETER]
* BUG: Clear the 'super' field of the object value returned by NEW.

[GB.JIT]
* BUG: Correctly reset EXEC_super in error catching.
2018-08-06 13:26:49 +02:00
gambas
609ef351f8 The interpreter does not crash anymore when using standard streams at the end of the program whereas they have been already freed.
[INTERPRETER]
* BUG: The interpreter does not crash anymore when using standard streams at the end of the program whereas they have been already freed.
2018-07-17 15:33:11 +02:00
gambas
bba1946700 The datatype of object symbols was incorrectly computed.
[GB.JIT]
* BUG: The datatype of object symbols was incorrectly computed.
2018-07-08 08:24:31 +02:00
gambas
e04ec717c7 JIT: Structures and static arrays have been implemented.
[INTERPRETER]
* NEW: JIT: Support for structures and static arrays.

[GB.JIT]
* NEW: Structures and static arrays have been implemented.
2018-07-07 14:54:23 +02:00
gambas
da5c780572 Allow compilation of structure accesses again.
[COMPILER]
* BUG: Allow compilation of structure accesses again.
2018-07-07 02:23:08 +02:00
gambas
ed775d62d4 Correctly handle function values used as arguments.
[GB.JIT]
* BUG: Correctly handle function values used as arguments.
2018-07-07 00:58:55 +02:00
gambas
50dedeb8cb Don't use __attribute__((noreturn)), it makes gcc dizzy and slow as hell.
[GB.JIT]
* BUG: Don't use __attribute__((noreturn)), it makes gcc dizzy and slow as hell.
2018-07-05 07:15:23 +02:00
gambas
d3c93a05e4 Work on new JIT system continues.
[INTERPRETER]
* NEW: Abort if a stack mismatch is detected after a JIT function has been called.

[GB.JIT]
* NEW: The GB_JIT_CC environment variable allows to define the C compiler that will generate the code.
* OPT: Don't call the compiler through a shell anymore.
* NEW: Support for clang.
* BUG: Don't use the "," operator anymore to write JIT code.
* BUG: Correctly free stack when leaving a function whereas we are still inside a GOSUB.
* BUG: Declare all local variables and arguments as volatile as soon the function uses CATCH or FINALLY.
2018-07-05 07:10:31 +02:00
gambas
4a1c81d0aa Jit.Time is a new property that returns the time spent in JIT compilation, in seconds.
[INTERPRETER]
* NEW: Jit is a new static class that allows to deal with the JIT compiler.
* NEW: Jit.Time is a new property that returns the time spent in JIT compilation, in seconds.

[GB.JIT]
* NEW: Support for the Jit.Time property.
2018-07-03 00:52:19 +02:00
gambas
527702ea59 Subroutines returning something that are used as instructions correctly drop their return value now.
[GB.JIT]
* BUG: Subroutines returning something that are used as instructions correctly drop their return value now.
2018-07-02 22:37:33 +02:00
gambas
9cf443a04f [INTERPRETER]
* BUG: Take JIT code into account when displaying current position in DEBUG instruction.

[COMPILER]
* BUG: Fix subroutine metadata.
* BUG: Fix subroutine search function.

[GB.JIT]
* BUG: Fix string referencing.
* NEW: Implement date arrays accessors.
* BUG: Fix error management.
* BUG: Fix mathematic functions implementation.
* NEW: Support of functions with a variable number of arguments.
* BUG: Fix support of Long constants.
* BUG: Fix implementation of Collection array operator.
* BUG: Fix READ, EXEC, SHELL and DEBUG instructions.
* BUG: Fix VarPtr().
* BUG: Fix TRUE constant implementation.
2018-07-02 19:37:37 +02:00
gambas
5f4f12acf3 [COMPILER]
* NEW: UNSAFE is a new keyword used in conjunction with FAST. It tells the JIT compiler not to do any safety check (null objects, division by zero, out of array bounds...). It makes the code a bit faster, but prone to segmentation fault.

[INTERPRETER]
* NEW: Support for the UNSAFE keyword.

[GB.JIT]
* NEW: Support for the UNSAFE keyword.
* NEW: Check validity of objects that can be invalid.
2018-06-29 00:10:31 +02:00
gambas
fe08dfa333 Work continues on new JIT system.
[INTERPRETER]
* NEW: JIT: Support for SUPER.
* NEW: JIT: Support for extern functions.
* NEW: Add a flag in Gambas functions to know if they are static or not.

[GB.JIT]
* NEW: Support for SUPER.
* NEW: Support for extern functions.
* BUG: Fix object arrays access.
* OPT: Optimization of Abs, Sgn, Int, Fix, and Pi subroutines.
2018-06-27 19:35:23 +02:00
gambas
ab3963c99c Fix some bugs detected by clang, and JIT code can now raise events.
[INTERPRETER]
* NEW: JIT: Support for event raising.
* BUG: Fix some bugs detected by clang.

[GB.JIT]
* NEW: Support for event raising.
* OPT: Some optimizations in jit code generation and compilation.
2018-06-25 19:17:44 +02:00
gambas
90700a48ae Remove now unused JIT compilation source files.
[COMPILER]
* BUG: Remove now unused JIT compilation source files.
2018-06-25 19:16:10 +02:00
gambas
06d139920d Work continues on new JIT system.
[INTERPRETER]
* BUG: JIT: No need to support breakpoints.

[GB.JIT]
* BUG: No need to support breakpoints.
2018-06-23 01:37:06 +02:00
gambas
128b5de2f2 [INTERPRETER]
* NEW: JIT: Support for QUIT and STOP EVENT instructions.

[GB.JIT]
* NEW: Implement QUIT and STOP EVENT instructions.
2018-06-23 01:31:39 +02:00
gambas
6502645560 Work continues on new JIT system.
[INTERPRETER]
* BUG: JIT: Fix error handling when calling methods from JIT code.

[GB.JIT]
* NEW: Fix support of CATCH and FINALLY.
* NEW: Support for ON GOTO and ON GOSUB.
2018-06-22 04:49:05 +02:00
gambas
757ecc14eb Fix the clang fix. Compiler messages are visible again.
[COMPILER]
* BUG: Fix the clang fix. Compiler messages are visible again.
2018-06-19 16:09:30 +02:00
Benoît Minisini
9834cc71d9 Merge branch 'clang' into 'master'
Make compilation with clang possible

See merge request gambas/gambas!27
2018-06-19 00:07:32 +00:00
gambas
3bd9dca142 Work on new JIT system continues.
[INTERPRETER]
* NEW: JIT: Complex number support.
* NEW: JIT: LAST support.

[GB.JIT]
* BUG: Fix management of local variable declaration of translated functions.
* NEW: Support for WITH ... END WITH.
* NEW: JIT: Complex number support.
* NEW: JIT: LAST support.
2018-06-19 00:30:12 +02:00
gambas
4ef9c15a1b Support for CATCH and FINALLY.
[INTERPRETER]
* NEW: The NEW implementation routine takes its opcode as argument now, like other subroutines with a variable number of arguments.

[GB.JIT]
* OPT: Call subroutines using their static address. No significative performance gain was detected.
* NEW: Support for CATCH and FINALLY.
2018-06-16 01:12:13 +02:00
gambas
b9a83c8a10 Work continues on new JIT system.
[INTERPRETER]
* NEW: Support for error management in JIT methods.

[COMPILER]
* BUG: Fix Error() function metadata.

[GB.JIT]
* NEW: Support for error management.
* NEW: TRY instruction.
* BUG: Correct support of NULL.
2018-06-14 16:45:05 +02:00
bgermann
ff8a181667 Make compilation with clang possible
[CONFIGURATION]
* OPT: Compilation with clang is possible
2018-06-13 18:26:06 +02:00
gambas
5a1e3b48e9 Fix label generation again.
[GB.JIT]
* BUG: Fix label generation again.
2018-06-13 18:19:32 +02:00
gambas
08c772a290 Fix FOR EACH loops translation.
[GB.JIT]
* BUG: Panic if the stack is not void once a function has been translated.
* BUG: Fix FOR EACH loops translation.
2018-06-13 16:59:56 +02:00
gambas
b8198005db [BENCHMARKS]
* OPT: Little optimization in nbody benchmark.

[GB.JIT]
* BUG: Fix translation of loops.
* BUG: Fix label generation.
2018-06-13 16:55:25 +02:00
gambas
83eed9707d Merge branch 'jit-with-c' 2018-06-13 00:45:19 +02:00
gambas
6b8afd0617 [COMPILER]
* BUG: Fix Left, Mid and Right subroutines metadata.

[GB.JIT]
* BUG: Fix function arguments management.
* BUG: Functions returning objects work correctly now.
* BUG: Fix internal control variables management.
2018-06-13 00:38:18 +02:00
Adrien Prokopowicz
2c9b2dcf03 Add the ability to expose some configuration failures with CI
See merge request gambas/gambas!26
2018-06-12 18:36:26 +00:00
gambas
431be5bcea Fix string search routine optimization and thousand separator.
[INTERPRETER]
* BUG: Fix string search routine optimization.
* BUG: Fix thousand separator.
2018-06-12 16:30:11 +02:00
Laurent Carlier
a5a117fd33 Add a way to track configuration failures with CI
Disable it for main as it's expected.

=> GAMBAS_CONFIG_FAILURE=1 ./configure
.....
checking for gb.db.postgresql headers... no
configure: WARNING: Unable to find file: postgres.h
configure: WARNING: Unable to find file: pg_type.h
checking for gb.db.postgresql libraries... /usr/lib64/
configure: error: Failed to configure gb.db.postgresql
configure: error: ./configure failed for gb.db.postgresql
2018-06-12 16:27:31 +02:00
Tobias Boege
d44b4bd7f2 Chmod reads mode bit string correctly
[INTERPRETER]
* BUG: Fix off-by-one error in FILE_mode_from_string which couldn't read mode bits 's' and 't'
2018-06-12 13:40:44 +02:00
gambas
c671adfd6b Work continues on new JIT system.
[INTERPRETER]
* OPT: String searching (Instr, RInstr and Replace) has been made about 4x faster by searching the first occurence with memchr() and memrchr().

[GB.FORM.TERMINAL]
* BUG: Fix warning messages.

[GB.JIT]
* BUG: Fix byte, short and boolean pushing and popping routines.
* BUG: Fix string values referencing.
* BUG: Fix optional argument management.
* NEW: Optimization of bits management subroutines.

[GB.QT4]
* BUG: Delay hooks initialization, because now socket notifiers must not be used before creating the event loop.

[GB.QT5]
* BUG: Delay hooks initialization, because now socket notifiers must not be used before creating the event loop.
2018-06-11 18:56:39 +02:00
gambas
4e50dec11d Work continues on new JIT system. Translation is now done at runtime.
[INTERPRETER]
* OPT: String routines are now compiled with -O3.
* NEW: Don't display JIT debugging message unless GB_JIT_DEBUG is set to something different from zero.
* NEW: String whose length is greater than 256 now have a growth step of 256 bytes instead of 16.

[GB.JIT]
* NEW: Do many global optimizations as now the class metadata is fully available.
* NEW: Support for optional argument. Still buggy at the moment.
2018-06-09 22:42:35 +02:00
gambas
23be942b6a Work continues on the new JIT system.
[BENCHMARKS]
* NEW: Little meaningless changes.

[INTERPRETER]
* NEW: JIT: Support for FOR EACH loops.
* BUG: JIT: Handle function values that are put on stack before calling them.

[COMPILER]
* NEW: JIT: Optimization of mathematic functions.
* NEW: JIT: Support for FOR EACH loops.
* NEW: JIT: Remove successive POP_x() / PUSH_x().
* NEW: JIT: Optimization of DIV and MOD.
* NEW: JIT: Support of internal control local variables used by SELECT and FOR EACH.
* NEW: JIT: Support for SWAP.

[GB.JIT]
* NEW: Optimization of mathematic functions.
* NEW: Variants management.
* NEW: All conversions are handled now.
* NEW: FOR EACH loops are implemented.
2018-06-05 11:43:39 +02:00
gambas
23081e47c6 Work continues on new JIT system. The "Fractal" example runs!
[INTERPRETER]
* NEW: Implement return value of JIT methods.
* NEW: Support for calling '.' operator from a JIT method.

[COMPILER]
* BUG: JIT: Fix detection of native arrays.
* BUG: JIT: Delete translated file if a class has no fast method anymore.
* BUG: JIT: Prefix JIT method with "jit_" to avoid possible conflicts.
* BUG: JIT: Fix variable initialization.
* NEW: JIT: Complete datatype support.
* NEW: JIT: Support for SWAP.
* NEW: JIT: Support for array operators.
* BUG: JIT: Fix arithmetic operators.
* NEW: JIT: Implement ME and "." operator.
* NEW: JIT: Complete GOSUB / RETURN support.
* NEW: JIT: Support for DIV and MOD operators. Not optimized yet.

[ARCHIVER]
* NEW: Put JIT translation in the archive.

[GB.JIT]
* NEW: Complete datatype support. Variant is not supported yet.
* NEW: Complete GOSUB / RETURN support.
* NEW: Support for ME and '.' operator.
2018-06-02 17:59:47 +02:00
gambas
1d276cdc68 Work continues on new JIT system.
[INTERPRETER]
* BUG: Release arguments after having called a JIT method.
* NEW: Add JIT interface for returning a value.

[COMPILER]
* NEW: JIT: Nicer translation for quick add of negative numbers.
2018-06-01 14:40:07 +02:00
gambas
714b77a10d Work on new JIT system continues.
[CONFIGURATION]
* NEW: Add '.jit' directory to '.gitignore'.

[COMPILER]
* NEW: New '-j' option that disables just in time compilation.
* NEW: JIT: Support for private functions calls.
* NEW: JIT: Support for native arrays accessors.
* BUG: JIT: Fix loop support.
* NEW: JIT: Support for GOSUB.

[GB.JIT]
* NEW: GB_JIT_DEBUG is an environment variable that defines if JIT compilation debugging messages are printed.
* NEW: GB_JIT_CFLAGS is an environment variable that defines the JIT compilation flags. The default is "-O3".
* NEW: Support for native arrays accessors.
2018-06-01 03:50:42 +02:00
gambas
5219fc48d1 Work continues on new JIT system.
[COMPILER]
* BUG: JIT: Fix local variable referencing.
* NEW: JIT: Implement NEW operator and array accessors.

[INTERPRETER]
* NEW: Support for JIT NEW operator and array accessors.

[GB.JIT]
* NEW: Support for object datatypes.
* NEW: Implement NEW operator and array accessors.
2018-05-29 23:25:57 +02:00
gambas
83a2452acb Continue working on new JIT system.
[COMPILER]
* NEW: JIT: Support for FOR...TO...NEXT loops.
* NEW: JIT: Support for Len(), Left$(), Mid$(), and Right$().
* NEW: JIT: Subroutines return values are now hadled correctly.

[GB.JIT]
* NEW: Compile JIT code with -O3.
2018-05-29 03:43:23 +02:00
gambas
a2b64b190a Work on new JIT system continues.
[COMPILER]
* NEW: Internal initialization functions now can be JIT translated.
* NEW: Support of subroutine calling completed. Interpreter subroutines are called if there is no optimization implemented in the JIT translation.

[INTERPRETER]
* NEW: Remove old JIT stuff.

[GB.JIT]
* NEW: Use 'gambas.h' and 'gb.jit.h' to compile translated code.
2018-05-28 03:18:44 +02:00
gambas
d797a545b6 [COMPILER]
* NEW: Work on JIT continues...
* NEW: Better panic errors.

[INTERPRETER]
* NEW: Remove the old JIT stuff.
* NEW: Calls gb.jit at runtime if needed. If a fast function has no jit implementation, the bytecode version is used.
* NEW: Start defining the JIT interface needed by the JIT functions.
* NEW: The common static character buffer is now twice the size of the maximum symbol length, to avoid possible overflows.

[GB.JIT]
* NEW: Compilation starts to work.
* NEW: Debugging messages.
2018-05-26 16:50:00 +02:00
gambas
cdc6d47922 Work continues on new JIT system.
[COMPILER]
* NEW: Work continues on new JIT system.

[INTERPRETER]
* NEW: Make comparison operator true functions so that they can be called by the JIT code.
2018-05-25 21:01:38 +02:00
gambas
e2a53d4a09 't' and 'tt' date format now return the correct timezone.
[INTERPRETER]
* BUG: 't' and 'tt' date format now return the correct timezone.
2018-05-25 12:17:30 +02:00
gambas
35e9859894 Correctly fix the READ instruction without leaking memory.
[INTERPRETER]
* BUG: Correctly fix the READ instruction without leaking memory.
2018-05-24 15:09:51 +02:00
gambas
ebd8963617 Continue working on the new jit system.
[COMPILER]
* NEW: Continue working on the new jit system.
* NEW: Initial support for arithmetic instructions.
2018-05-24 00:31:58 +02:00
gambas
b5edf09de9 Reading a fixed number of bytes with READ does not crash anymore if an "End of file" error is raised.
[INTERPRETER]
* BUG: Reading a fixed number of bytes with READ does not crash anymore if an "End of file" error is raised.
2018-05-23 20:39:16 +02:00
gambas
dfeb4243ab Continue working on the new jit system.
[COMPILER]
* NEW: Continue working on the new jit system.
2018-05-18 02:19:28 +02:00
gambas
f39f7063ef Start working on the new jit system.
[COMPILER]
* NEW: Start working on the new jit system.

[GB.JIT]
* NEW: Rename the component as 'gb.jit.llvm'.
2018-05-17 01:13:56 +02:00
gambas
14614f4e67 Check if the "-flto" link time optimzation flag is available.
[CONFIGURATION]
* BUG: Check if the "-flto" link time optimzation flag is available.
2018-05-08 18:44:31 +02:00
Tobias Boege
6a77f9f2c5 Only use tag in trunk_version.h if it is *exactly* that commit
[CONFIGURATION]
* BUG: Only use tag in trunk_version.h if it is *exactly* that commit
2018-05-05 18:07:50 +02:00
Tobias Boege
9ed904241f Print git tag instead of branch name in trunk_version.h if available
[CONFIGURATION]
* NEW: Print git tag instead of branch name in trunk_version.h if available
2018-05-05 17:56:29 +02:00