Commit graph

142 commits

Author SHA1 Message Date
gambas
87100b744a Check special methods return value datatype. Add '_invalid' special variable.
[INTERPRETER]
* NEW: Check special methods return value datatype and raise a dedicated error if it is incorrect.
* NEW: Error.Text, Error.Where and Error.Backtrace are now available inside the Application_Error handler.
* BUG: 'gbx3 -L' now displays the same Gambas version as 'gbx3 -V'.
* NEW: A class can declare a public '_invalid' boolean variable. The value of that variable will indicates if the object is invalid.
2020-01-04 22:11:29 +01:00
gambas
3d956c269c '_read' and '_write' are two new special methods that allow to make any object serializable by the READ and WRITE instructions.
[INTERPRETER]
* NEW: '_read' and '_write' are two new special methods that allow to make any object serializable by the READ and WRITE instructions.
* NEW: Rename macro that convert a Gambas stream object to the internal stream structure and add a macro that does the reverse conversion.
2019-12-21 17:03:42 +01:00
gambas
20a345cec4 Fix compilation of function calls with variable arguments passing.
[COMPILER]
* BUG: Fix compilation of function calls with variable arguments passing.
* BUG: Remove some useless structure packing directives.

[INTERPRETER]
* BUG: Fix compilation of function calls with variable arguments passing.
2019-11-09 11:58:57 +01: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
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
63d9d81bd2 Disabling JIT compiler works correctly again.
[INTERPRETER]
* BUG: Disabling JIT compiler works correctly again.
2019-03-13 12:59:14 +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
ecf3410e99 Fix a crash in exception management.
[INTERPRETER]
* BUG: Fix a crash in exception management.
2018-11-07 17:21:38 +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
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
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
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
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
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
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
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
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
2953ea8d85 Fix error management that could lead to other potential crashes.
[INTERPRETER]
* BUG: Fix error management that could lead to other potential crashes.
2017-09-28 02:05:43 +02:00
Benoît Minisini
b225eba20f [CONFIGURATION]
* NEW: Update copyright year in all source files.


git-svn-id: svn://localhost/gambas/trunk@8056 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2017-01-13 03:29:42 +00:00
Benoît Minisini
c4d22f9d24 [INTERPRETER]
* BUG: Forbid continuing and stay in debugger when an unhandled error is raised. This prevent crashes when an error occurs during variable initialization.


git-svn-id: svn://localhost/gambas/trunk@8031 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-12-31 12:02:58 +00:00
Benoît Minisini
4c3370908c [COMPILER]
* NEW: Work on internal expression datatype analyze has continued.
* OPT: Compiling syntax trees is faster now.

[INTERPRETER]
* OPT: Analyzing objects a method or a property applies to is faster now.
* NEW: Remove an unused method in table symbol implementation.


git-svn-id: svn://localhost/gambas/trunk@7647 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2016-03-20 01:27:31 +00:00
Benoît Minisini
a6f458e05c [INTERPRETER]
* NEW: _ready() is new special method that is called when an object construction is completly finished.

[COMPILER]
* NEW: Remove the call to _load() method in form constructors.

[GB.WEB.FORM]
* BUG: WebExpander: Remove a debugging message.
* NEW: WebForm.Debug is a new static property that, if set, dumps all exchanges between the server and the client in the browser console.
* NEW: Use the new _ready special method.
* NEW: WebLabel: Add the Border property.
* NEW: WebLabel: Alignment is a new property that defines the label horizontal alignment.
* NEW: A few changes in default style sheet.


git-svn-id: svn://localhost/gambas/trunk@7541 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-12-30 18:11:01 +00:00
Benoît Minisini
2a9836fead [INTERPRETER]
* OPT: Optimize access to objects whose class is "simple", i.e. without
  parent, children, special check method, and not virtual.
* OPT: Detect when automatic conversion is useless in arithmetic and
  comparison operators.
* OPT: Optimize a bit inequality comparison operators.


git-svn-id: svn://localhost/gambas/trunk@7476 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-11-14 04:29:43 +00:00
Benoît Minisini
0c9d0a4585 [INTERPRETER]
* OPT: Array accessors have been optimized. The 'sort' benchmark is now 25% 
  faster.


git-svn-id: svn://localhost/gambas/trunk@6605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-11-02 23:09:04 +00:00
Benoît Minisini
403376eedd [INTERPRETER]
* BUG: Fix a string leak in program exit routine.
* BUG: The Param class now can be used while debugging.


git-svn-id: svn://localhost/gambas/trunk@6295 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-30 18:39:40 +00:00
Benoît Minisini
337e7c9329 [COMPILER]
* OPT: Write in the bytecode file if a function uses the IsMissing() native 
  routine.

[INTERPRETER]
* OPT: Don't use a stack slot for missing arguments if the IsMissing() 
  function is not used.


git-svn-id: svn://localhost/gambas/trunk@6274 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-18 13:18:32 +00:00
Benoît Minisini
29d87c9bc2 [INTERPRETER]
* BUG: Use a control variable to store the missing optional argument map,
  so that the JIT compiler is not trapped.


git-svn-id: svn://localhost/gambas/trunk@6264 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-14 15:11:07 +00:00
Benoît Minisini
4c739969ef [COMPILER]
* NEW: IsMissing() is a new function that returns if an optional argument 
  is missing. It always returns FALSE on a non-optional argument.

[INTERPRETER]
* NEW: Support for IsMissing().


git-svn-id: svn://localhost/gambas/trunk@6258 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-08 15:10:21 +00:00
Benoît Minisini
3f9d37a858 [INTERPRETER]
* BUG: Correctly drop arguments when using the new '...' symbol syntax.

[COMPILER]
* BUG: Correctly drop arguments when using the new '...' symbol syntax.


git-svn-id: svn://localhost/gambas/trunk@6252 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-05 20:16:41 +00:00
Benoît Minisini
cbd63b46a8 [INTERPRETER]
* NEW: Support for the new '...' symbol usage in function calls.

[COMPILER]
* NEW: '...' can be used for passing all the variables arguments of the 
  current function to another function. The '...' symbol must be the last
  argument of the function call.


git-svn-id: svn://localhost/gambas/trunk@6251 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-05-05 20:07:00 +00:00
Benoît Minisini
87df43bd18 [DEVELOPMENT ENVIRONMENT]
* NEW: The debugger now can be told to break the program on any error.
* NEW: Statistic tab in the project property dialog.

[INTERPRETER]
* BUG: Don't crash if an unknown option is passed with the '-g' option.
* NEW: The debugger now can be told to break the program on any error.
* NEW: System.BreakOnError is a new property that allows to set the 
  internal "break on error" option at runtime. I don't know if it is 
  actually useful, so I may remove it.

[GB.DEBUG]
* NEW: The debugger now can be told to break the program on any error.


git-svn-id: svn://localhost/gambas/trunk@6011 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-12-18 11:21:01 +00:00
Benoît Minisini
42a089eda6 [DEVELOPMENT ENVIRONMENT]
* NEW: Update Gambas fonts.
* NEW: Project converter: try to not crash if the Gambas 2 project has been 
  partially converted.

[GB.QT4]
* BUG: Mouse.Translate() now has an absolute effect, as in gb.gtk.


git-svn-id: svn://localhost/gambas/trunk@6009 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-12-16 22:23:13 +00:00
Benoît Minisini
c9ca5ab982 [CONFIGURATION]
* NEW: Update copyright year to 2013.

[GB.FORM]
* NEW: ImageView is a new control that allows to view an image inside a 
  scrolled view, at different zoom levels.
* BUG: FileProperties now works correctly if 'gb.desktop' is not used.
* NEW: The FileProperties preview tab now uses an ImageView control and has
  a toolbar to zoom the preview.
* BUG: Add the 'linux' and 'gnu' icon in the stock icon list.


git-svn-id: svn://localhost/gambas/trunk@5770 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-08-03 15:38:01 +00:00
Benoît Minisini
21f0837572 [INTERPRETER]
* BUG: Correctly handle functions with a variable number of arguments when
  an array conversion occurs during argument parsing.
* BUG: The debugger now correctly displays and modifies arguments of 
  functions having a variable number of arguments.

[GB.DEBUG]
* BUG: The debugger now correctly displays and modifies arguments of 
  functions having a variable number of arguments.


git-svn-id: svn://localhost/gambas/trunk@5686 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-05-30 01:10:59 +00:00
Benoît Minisini
daaf410362 [DEVELOPMENT ENVIRONMENT]
* NEW: If the IDE throws an uncatched error, try to save all modified files
  before aborting.

[INTERPRETER]
* NEW: If a static public method named Application_Error() is defined in 
  the startup class, then this method will be called when an unhandled 
  error is thrown, just before the program is aborted.


git-svn-id: svn://localhost/gambas/trunk@5678 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-05-25 14:00:40 +00:00
Benoît Minisini
165be4a66a [INTERPRETER]
* NEW: Clean up object referencement macros.


git-svn-id: svn://localhost/gambas/trunk@5601 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-03-30 13:51:10 +00:00
Benoît Minisini
b8260e2aba [INTERPRETER]
* BUG: Some fixes of bugs detected by Coverity Scan.
* NEW: Raise a 'Filename too long' error now when a too long file path is
  detected inside a file management function.
* NEW: System.TimeZone is a new property that returns the current timezone
  as an offset in seconds that must be added to a local time to get UTC.

[COMPILER]
* BUG: Some fixes of bugs detected by Coverity Scan.

[GB.IMAGE]
* BUG: Some fixes of bugs detected by Coverity Scan.


git-svn-id: svn://localhost/gambas/trunk@5490 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-01-04 23:24:37 +00:00
Benoît Minisini
dbf5689f9a [INTERPRETER]
* BUG: Check process stack pointer with a bigger margin so that we get 
  'Stack overflow' errors instead of segfaults.

[GB.GTK]
* BUG: Fix menu bar layout when the window is shown for the first time.

[GB.GUI.BASE]
* BUG: Don't set the background color of ScrollArea scrollbars.

[GB.QT4]
* NEW: Remove any useless reference to Q3ScrollView.
* OPT: Paint.ClipRect is now optimized when the clipping region is a single
  rectangle.


git-svn-id: svn://localhost/gambas/trunk@5481 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2013-01-01 11:55:40 +00:00
Benoît Minisini
53c284099b [DEVELOPMENT ENVIRONMENT]
* BUG: The name of GridView controls is now always visible in the form
  editor.

[INTERPRETER]
* NEW: Support for new QUIT syntax.
* NEW: Do not display overriding prefix in class names.

[COMPILER]
* NEW: QUIT now can takes an optional argument which is the program return 
  value.

[GB.ARGS]
* BUG: The "--version" option is not "----version" anymore
* NEW: If an error occurs, returns 1 as exit value and not 0.

[GB.FORM]
* BUG: GridView is correctly updated now when the Border property is set.


git-svn-id: svn://localhost/gambas/trunk@5246 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-10-19 21:00:35 +00:00
Benoît Minisini
72ee74e8d4 [DEVELOPMENT ENVIRONMENT]
* NEW: Draw the projet property dialog library list with a GridView.

[INTERPRETER]
* BUG: Fix class overriding routine.

[GB.ARGS]
* NEW: 'gb.args' is a new component that analyzes the command-line options,
  and automatically handles the "--help" option.

[GB.HTTPD]
* BUG: Hide the component.


git-svn-id: svn://localhost/gambas/trunk@5241 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-10-15 10:06:37 +00:00
Benoît Minisini
17a0748815 [CONFIGURATION]
* NEW: Each component installation now generates all information files
  systematically, to fix possible dependencies between components written
  in Gambas.

[DEVELOPMENT ENVIRONMENT]
* NEW: Running a project using the 'gb.web' component now automatically
  starts the embedded HTTP server.

[INTERPRETER]
* NEW: Class overriding is retrospective now.
* NEw: System._Breakpoint() is a new hidden method that raises a 
  breakpoint. Very useful for debugging.

[GB.GTK]
* BUG: The Action.Register() method must not crash when called during class 
  clean-up.

[GB.HTTPD]
* NEW: Define a custom exported HTTP server name.

[GB.JIT]
* BEW: Support for new class overriding (the CLASS structure has lost one 
  field).

[GB.QT4]
* BUG: The Action.Register() method must not crash when called during class 
  clean-up.


git-svn-id: svn://localhost/gambas/trunk@5240 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-10-14 22:42:53 +00:00
Benoît Minisini
0f985417cf [DEVELOPMENT ENVIRONMENT]
* NEW: Use Terminus as default fixed font if it is installed on the system.
* BUG: Don't load a component description if that component has the same 
  name as the current project. This is a temporary incorrect fix!

[INTERPRETER]
* BUG: Fix Classes enumeration.

[GB.DESKTOP]
* BUG: Fix X11 client message sending routine on 64 bits OS.
* BUG: Fix all DesktopWindow properties that read or change the state of 
  the window.

[GB.GTK]
* NEW: Fonts.Exist() is a new method that returns if a specific font family 
  exists.

[GB.QT4]
* NEW: Fonts.Exist() is a new method that returns if a specific font family 
  exists.


git-svn-id: svn://localhost/gambas/trunk@5171 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-09-17 11:13:32 +00:00
Benoît Minisini
1741274a34 [INTERPRETER]
* NEW: Task.Value now raises an error if the background task has failed for
  any reason. Otherwise it normally returns the background task return 
  value.
* BUG: Background tasks do not interfere with the debugger anymore.

[GB.TASK]
* NEW: The component has been moved inside the interpreter.


git-svn-id: svn://localhost/gambas/trunk@5081 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-08-26 16:26:53 +00:00
Benoît Minisini
fc6c3a22bd [INTERPRETER]
* BUG: The Gosub stack pointer is now correctly reset when a error has been 
  intercepted by the Catch instruction.


git-svn-id: svn://localhost/gambas/trunk@5020 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-08-09 01:33:34 +00:00
Benoît Minisini
fa552f69c1 [DEVELOPMENT ENVIRONMENT]
* NEW: New gb.complex component

[INTERPRETER]
* BUG: Automatic array conversion now works with not yet loaded array 
  classes.

[GB.COMPLEX]
* NEW: New component that implements a rudimentary management of complex 
  numbers. This component is automatically loaded if a complex number
  constant is encountered and no loaded component can already handle 
  complex numbers.


git-svn-id: svn://localhost/gambas/trunk@4924 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 15:37:42 +00:00
Benoît Minisini
2402db91f0 [INTERPRETER]
* NEW: Support for imaginary number syntax. For example, using "3i" will 
  automatically load the gb.gsl component, create the corresponding complex 
  number and return it.

[COMPILER]
* NEW: Support for imaginary number syntax.

[GB.EVAL]
* NEW: Support for imaginary number syntax.

[GB.GSL]
* NEW: Support for imaginary number syntax.
* NEW: Vector class is now generic, and has two child classes: FloatVector 
  and ComplexVector, depending on the type of its elements.
* BUG: Support for arithmetic operators on Vector class has been removed. 
  It had too many problems.


git-svn-id: svn://localhost/gambas/trunk@4918 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 23:23:24 +00:00