Commit graph

355 commits

Author SHA1 Message Date
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
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
245427b08e * Get rid of many gcc warnings. 2019-01-02 00:48:58 +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
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
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
bgermann
6e2a9d458f Unify BSD ifdefs 2018-09-09 18:26:38 +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
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
e6028806a0 Fix libltdl workaround for NetBSD 2018-08-29 14:18:33 +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
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
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
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
bgermann
ff8a181667 Make compilation with clang possible
[CONFIGURATION]
* OPT: Compilation with clang is possible
2018-06-13 18:26:06 +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
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
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
58ddc650ad Try to add some more static datatype analysis, but did not succed.
[COMPILER]
* NEW: Try to add some more static datatype analysis, but did not succed.
2018-03-03 03:14:11 +01:00
gambas
b1f4574278 Really fix static datatype analysis of DIV and MOD operators.
[COMPILER]
* BUG: Really fix static datatype analysis of DIV and MOD operators.
2018-02-28 16:54:23 +01:00
gambas
98b4de489c Fix warning on boolean operators and static datatype analysis of DIV and MOD operators.
[COMPILER]
* BUG: Fix warning on boolean operators.
* BUG: Fix static datatype analysis of DIV and MOD operators.
2018-02-28 16:48:39 +01:00
gambas
00b0adb523 Don't raise an error when analyzing the AND, OR or XOR operator. Print a warning instead.
[COMPILER]
* NEW: Don't raise an error when analyzing the AND, OR or XOR operator.
* NEW: Print a warning if the AND, OR or XOR operator mix Boolean and Integer datatypes.
2018-02-28 14:07:24 +01:00
gambas
d5c096f71e Fix parsing of quoted identifiers.
[COMPILER]
* BUG: Fix parsing of quoted identifiers.

[GB.EVAL]
* BUG: Fix parsing of quoted identifiers.
2018-02-17 20:41:39 +01:00
gambas
e39cfbf9da Fix Min() and Max() arguments datatype static checks, and some little differences with compiler sources.
[COMPILER]
* BUG: Fix Min() and Max() arguments datatype static checks.

[GB.EVAL]
* BUG: Fix some little differences with compiler sources.
2018-02-17 16:44:38 +01:00
gambas
a2099dea77 Fix a warning message typo.
[COMPILER]
* BUG: Fix a warning message typo.
2018-02-14 17:07:06 +01:00
gambas
d1f6bc62c4 Add a warning for uninitialized local and private global variables.
[COMPILER]
* NEW: Add a warning for uninitialized local and private global variables.
2018-02-14 17:03:14 +01:00
gambas
09a0573e61 Replace my old sourceforge mail address by the new one.
[CONFIGURATION]
Replace my old sourceforge mail address by the new one.
2018-02-12 02:53:46 +01:00
gambas
df26bab7c4 Correctly raise an error if a quoted identifier starting with '{' has no corresponding '}'.
[COMPILER]
* BUG: Correctly raise an error if a quoted identifier starting with '{' has no corresponding '}'.
2018-01-22 20:10:30 +01:00
gambas
2bb28545a5 LOCK instruction now can be used on existing files without clearing them.
[INTEPRRETER]
* NEW: LOCK instruction now can be used on existing files without clearing them.
2017-12-17 21:21:29 +01:00
gambas
36b16f18b3 Sort the internal project class list to make the contents of object files predictable.
[ARCHIVER]
* BUG: scandir() work is now correctly freed.

[COMPILER]
* NEW: Sort the internal project class list to make the contents of object files predictable.
2017-11-19 23:18:23 +01:00
gambas
39f93ddb37 The archiver now uses a predictable file order when creating an archive.
[ARCHIVER]
* BUG: The archiver now uses a predictable file order when creating an archive.
2017-11-19 02:29:59 +01:00
gambas
5e79f29fdc Fix some gcc compiler warnings.
[COMPILER]
* BUG: Fix some gcc warnings.

[GB.QT4]
* BUG: Clipboard.Paste() correctly converts image to ARGB premultiplied format.

[GB.QT5]
* BUG: Clipboard.Paste() correctly converts image to ARGB premultiplied format.

[GB.PCRE]
* BUG: Fix a gcc warning.
2017-11-10 20:35:27 +01:00
gambas
807f10b92b Allows newlines before a closing ']' in array/collection creation operator.
[COMPILER]
* NEW: Allows newlines before a closing ']' in array/collection creation operator.
2017-10-10 18:45:31 +02:00
gambas
12d51ca863 New syntax for octal numbers: "&Oxxx".
[COMPILER]
* NEW: New syntax for octal numbers: "&Oxxx".

[INTERPRETER]
* NEW: New syntax for octal numbers: "&Oxxx".

[GB.EVAL]
* NEW: New syntax for octal numbers: "&Oxxx".
2017-10-05 03:17:13 +02:00
gambas
65c83f1407 Compile breakpoints for functions whose name begins with a '$'.
[COMPILER]
* BUG: Compile breakpoints for functions whose name begins with a '$'.
2017-09-26 01:49:57 +02:00