Commit graph

3024 commits

Author SHA1 Message Date
Benoît Minisini
a5c174d248 [INTERPRETER]
* NEW: Any operators of the _operator interface can be optional now. But
  consequently, division by zero must be raised by the implementation.
* NEW: Implement Vector arithmetic operators.
* NEW: Rename some Matrix methods.
* NEW: Implement Polynomial arithmetic addition and substraction.
* BUG: Fix Polynomial to string conversion.
* NEW: Complex.Handle is a new property that returns the memory address of
  the underlying complex number in memory.


git-svn-id: svn://localhost/gambas/trunk@4947 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-14 15:18:22 +00:00
Benoît Minisini
df89e09b2e [INTERPRETER]
* NEW: '_operators' interface has been renamed as '_operator'.
* NEW: Arithmetic operators now can be applied on two objects with
  different classes. One at least must implement the '_operator' interface.
* NEW: Each class that implements the '_operator' interface has now an 
  automatic priority that follows the load order. When a binary operator 
  has two objects that implement two different '_operator' interface, the
  one having the highest priority is used.
* NEW: Implementing all methods in the '_operators' interface is not 
  mandatory anymore. If one method is not implemented, then it is replaced
  by a function that raises a 'Type mismatch' error.

[GB.GSL]
* NEW: Matrix arithmetic has been implemented.
* NEW: Matrix.Determinant() method.
* NEW: Matrix.Invert() method.
* NEW: Matrix.Transpose() method.
* NEW: Matrix _call special method multiplies a matrix by a vector.
* NEW: Vector <-> Array conversion.


git-svn-id: svn://localhost/gambas/trunk@4946 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-14 02:49:57 +00:00
Benoît Minisini
89d42c3d40 [INTERPRETER]
* NEW: Add a new API to create an object without calling the constructors.

[GB.CRYPT]
* BUG: Fix bad casting of strcmp() return value to boolean. The same 
  security flaw has been found in MySQL recently. See 
  http://seclists.org/oss-sec/2012/q2/493

[GB.GTK]
* BUG: Fix bad casting of strcmp() return value to boolean in the Font 
  management.

[GB.GSL]
* NEW: Matrix class built the same way as the Vector class, i.e. with the 
  ability to switch transparently between Float or Complex elements.


git-svn-id: svn://localhost/gambas/trunk@4945 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-12 23:34:14 +00:00
Benoît Minisini
6d6034e845 [INTERPRETER]
* BUG: Don't optimize the "_operators" interface when using anonymous 
  objects!


git-svn-id: svn://localhost/gambas/trunk@4944 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-11 22:03:54 +00:00
Adrien Prokopowicz
db72947b9f [GB.XML]
* BUG: When parsing data, extra white-spaces at the beginning and the end of text nodes are correctly ignored.
* BUG: When they are null, reading TagName and Prefix properties from XmlElement does not crash anymore.

git-svn-id: svn://localhost/gambas/trunk@4943 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-11 15:14:13 +00:00
Emil Lenngren
139884adb6 [GB.JIT]
* BUG: Properly check stack overflow for GoSubs.


git-svn-id: svn://localhost/gambas/trunk@4942 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 23:10:13 +00:00
Emil Lenngren
6e239510d0 [GB.JIT]
* BUG: Fix static _call calls.


git-svn-id: svn://localhost/gambas/trunk@4941 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 22:40:59 +00:00
Benoît Minisini
6931d13491 [GB.GSL]
* OPT: Optimize Complex arithmetic by avoiding unneeded object creations.


git-svn-id: svn://localhost/gambas/trunk@4940 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 20:33:26 +00:00
Benoît Minisini
c1212ac95e [INTERPRETER]
* OPT: Remove a useless test in the macro that returns the class of an 
  object.
* OPT: Some little optimization in some type checks.


git-svn-id: svn://localhost/gambas/trunk@4939 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 19:57:43 +00:00
Emil Lenngren
372ae57b29 [GB.JIT]
* BUG: Oops. Now functions without GoSubs don't crash anymore ...


git-svn-id: svn://localhost/gambas/trunk@4938 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 19:48:10 +00:00
Emil Lenngren
c3742b189a [GB.JIT]
* OPT: Use the Gambas stack to store GoSub data instead of allocating
  new arrays all the time. Up to 10 times faster!


git-svn-id: svn://localhost/gambas/trunk@4937 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 19:35:36 +00:00
Benoît Minisini
e938c9190d [GB.GSL]
* NEW: Remove the FloatVector and ComplexVector classes. Now the Vector 
  class handle vector of Float or Complex transparently.


git-svn-id: svn://localhost/gambas/trunk@4936 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 15:23:59 +00:00
Benoît Minisini
1d86ebecb1 [INTERPRETER]
* BUG: Fix '_operators' interface negation handling.


git-svn-id: svn://localhost/gambas/trunk@4935 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 15:20:46 +00:00
Emil Lenngren
02239e9c90 [GB.JIT]
* BUG: Temporary fix for powi due to a bug in llvm.


git-svn-id: svn://localhost/gambas/trunk@4934 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 15:12:45 +00:00
Benoît Minisini
55e313b8f5 [INTERPRETER]
* NEW: Put every '_operators' interface related methods in the same source 
  file.

[GB.GSL]
* NEW: Polynomial _call() special method now is a synonymous of its Eval() 
  method. That way, you can write 'P(X)' to get the value of P(X).


git-svn-id: svn://localhost/gambas/trunk@4933 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 14:35:17 +00:00
Adrien Prokopowicz
7d03122fa0 [GB.XML]
* NEW: Added two properties FirstChild and LastChild to XmlElement.

git-svn-id: svn://localhost/gambas/trunk@4932 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 13:53:38 +00:00
Benoît Minisini
a9fbd40cd8 [INTERPRETER]
* NEW: Implement the ^ operator in the '_operators' interface.

[GB.COMPLEX]
* NEW: Implement the ^ operator.

[GB.GSL]
* NEW: Implement the ^ operator in the Complex class.


git-svn-id: svn://localhost/gambas/trunk@4931 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 02:37:39 +00:00
Adrien Prokopowicz
47985d1d8e [GB.XML]
* NEW: Added a new XmlElement.ClearChildren method, that removes all the children of an element.
* BUG: Setting the XmlElment.TextContent property now correctly remove all children of an element.
* BUG: Setting the XmlElment.TextContent with a null string has now no effect, as mentioned in the W3C specifications.

git-svn-id: svn://localhost/gambas/trunk@4930 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 00:17:15 +00:00
Benoît Minisini
a3966cf195 [DEVELOPMENT ENVIRONMENT]
* BUG: Array of classes exported by a component are now correctly handled
  by the component interface analyzer.

[INTERPRETER]
* BUG: The _operators interface now correctly takes into account the
  "Float - Object" case.

[GB.GSL]
* NEW: Redesign of the Polynomial class. Now it implements a polynomial 
  that can switch between real and complex coefficients transparently.
* NEW: The ComplexPolynomial class has been removed.


git-svn-id: svn://localhost/gambas/trunk@4929 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-10 00:13:00 +00:00
Adrien Prokopowicz
fc299f0180 [GB.XML]
* BUG: The TextContent property now correctly ignores the contents of comment nodes, as mentioned in the W3C specifications.

git-svn-id: svn://localhost/gambas/trunk@4928 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 23:33:56 +00:00
Adrien Prokopowicz
159390bc46 [GB.XML]
* BUG: Getting an attribute that doesn't exist doesn't crashes anymore, it returns a null string instead.
* BUG: The string comparison mode argument is now correctly handled by XmlElement.GetAttribute().

git-svn-id: svn://localhost/gambas/trunk@4927 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 22:22:11 +00:00
Benoît Minisini
a036882dcc [GB.GSL]
* NEW: Handle GSL errors.
* NEW: Reimplement the Polynomial class by inheriting Float[].


git-svn-id: svn://localhost/gambas/trunk@4926 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 19:42:49 +00:00
Benoît Minisini
9a46cc0486 [INTERPRETER]
* NEW: Temporary hack in the GB.New() API so that we can pass a number of 
  arguments in some cases.

[GB.COMPLEX]
* OPT: Do not create complex objects during arithmetic operations when we 
  are sure that we can reuse a temporary one. That trick can be used in any
  '_operators' interface.


git-svn-id: svn://localhost/gambas/trunk@4925 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 17:10:21 +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
ad823d98cf [GB.GSL]
* NEW: Add Complex.Neg() to return the negative of a complex number.
* NEW: Add Complex.Inv() to return the inverse of a complex number.


git-svn-id: svn://localhost/gambas/trunk@4923 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 14:30:44 +00:00
Benoît Minisini
c89b8a5011 [GB.GSL]
* NEW: Add a Complex.Conj() method to return the conjugate of a complex number.


git-svn-id: svn://localhost/gambas/trunk@4922 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 14:27:33 +00:00
Laurent Carlier
3045e50490 [GB.GSL]
* BUG: Properly fix library detection.



git-svn-id: svn://localhost/gambas/trunk@4921 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 12:47:55 +00:00
Laurent Carlier
44f737a21d [GB.GSL]
* BUG: Use the proper detection method for gsl library.


git-svn-id: svn://localhost/gambas/trunk@4920 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 09:07:04 +00:00
Benoît Minisini
53d05b0549 [GB.GSL]
* NEW: Work continue on Vector class...


git-svn-id: svn://localhost/gambas/trunk@4919 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-09 02:20:57 +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
Adrien Prokopowicz
e8e480ac39 [GB.XML]
* BUG: The GetAttribute() method now correctly returns the attribute value.

git-svn-id: svn://localhost/gambas/trunk@4917 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 20:27:03 +00:00
Benoît Minisini
fc1c1e5531 [INTERPRETER]
* NEW: When converting an instance of A to the class B, try the conversion 
  interface of A first. If A has no conversion interface, or if it cannot 
  handle the B class, then try the conversion interface of B if any.

[GB.GSL]
* NEW: Vector class has been implemented.

[GB.JIT]
* NEW: SPEC_CONVERT constant has been replaced by a field in the CLASS 
  structure.


git-svn-id: svn://localhost/gambas/trunk@4916 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 20:08:43 +00:00
Adrien Prokopowicz
91b8363562 [GB.XML]
* BUG: The encoding is now correctly specified in the document header.

git-svn-id: svn://localhost/gambas/trunk@4915 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 19:33:17 +00:00
Emil Lenngren
ad81cf629a [GB.JIT]
* NEW: Use VALUE_convert instead of VALUE_convert_object.


git-svn-id: svn://localhost/gambas/trunk@4914 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 18:59:10 +00:00
Benoît Minisini
ef37065297 [INTERPRETER]
* BUG: Correctly raise an error when trying to use NULL on classes 
  implementing the _operators interface.
* NEW: The _convert interface now must handle conversions from any 
  datatype.

[GB.GSL]
* NEW: Automatic conversion from numbers to Complex.
* NEW: Start implementating the Vector class.


git-svn-id: svn://localhost/gambas/trunk@4913 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 16:55:35 +00:00
Benoît Minisini
64505bbb0b [INTERPRETER]
* BUG: Abs() and the negation operator on a null object implementing the 
  '_operators' interface does not crash anymore, and correctly raises an 
  error now.


git-svn-id: svn://localhost/gambas/trunk@4912 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 16:23:40 +00:00
Benoît Minisini
fc19d7bd78 [GB.GSL]
* NEW: Complex class has been cleaned up.
* BUG: Fix array creation in CComplexPolynomial.ComplexSolve().


git-svn-id: svn://localhost/gambas/trunk@4911 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 15:39:38 +00:00
Adrien Prokopowicz
2256d5f5a4 [GB.XML]
* OPT: Do not use the UTF-8 string methods anymore when parsing text opened with the XmlReader.FromString() method, they are too slow. This also may solve UTF-8 chars reading problems.

git-svn-id: svn://localhost/gambas/trunk@4910 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 15:30:42 +00:00
Emil Lenngren
393decb5e1 [GB.JIT]
* NEW: Implement _unknown.
* BUG: Remove some warnings.

[INTERPRETER]
* BUG: Fix exception handling for JIT functions.


git-svn-id: svn://localhost/gambas/trunk@4909 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 14:53:23 +00:00
Benoît Minisini
7bd330aa00 [INTERPRETER]
* NEW: "_operators" is a new interface that allows any native class to be
  used with most of arithmetic operators: +, -, *, /, Abs, =, <> at the 
  moment.
* NEW: The "_convert" interface now allows a class to be converted to any
  datatype, not just other classes.
* NEW: Str() and Print uses the "_convert" interface to print a localized
  string conversion of any object.

[GB.GSL]
* NEW: Use the new "_operators" interface so that complex numbers can be 
  handled by standard arithmetic operators.
* NEW: The Complex class now implements the "_convert" interface.


git-svn-id: svn://localhost/gambas/trunk@4908 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 14:35:58 +00:00
Benoît Minisini
2c631a0874 [INTERPRETER]
* BUG: Do not leak memory if the _unknown method raised an error.


git-svn-id: svn://localhost/gambas/trunk@4907 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 14:29:44 +00:00
Benoît Minisini
a903da98f2 [INTERPRETER]
* BUG: Correctly read unknown properties.


git-svn-id: svn://localhost/gambas/trunk@4906 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 13:27:56 +00:00
Benoît Minisini
7a198731d2 [DEVELOPMENT ENVIRONMENT]
* BUG: Do not display spurious 'missing component' messages in the project 
  property dialog.


git-svn-id: svn://localhost/gambas/trunk@4905 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-08 12:45:20 +00:00
Benoît Minisini
bbe3baa41e [GB.SIGNAL]
* BUG: Remove an apparently useless type definition, and fix compilation on 
  recent Linux kernels.


git-svn-id: svn://localhost/gambas/trunk@4902 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-07 22:18:14 +00:00
Benoît Minisini
95a0f6c319 [DEVELOPMENT ENVIRONMENT]
* BUG: Do not crash when a component required by a library is missing.


git-svn-id: svn://localhost/gambas/trunk@4901 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-07 08:08:15 +00:00
Benoît Minisini
1b28a5f062 [COMPILER]
* BUG: Like can be used in a Case expression just after the Case keyword
  only.



git-svn-id: svn://localhost/gambas/trunk@4900 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-06 21:50:15 +00:00
Benoît Minisini
bbfb58afa4 [GB.WEB]
* NEW: Request.Debug is a new property to activate the debugging mode of 
  the Request class.
* NEW: Request.Post.Contents returns the contents of the last POST request,
  provided that the debugging mode has been activated.


git-svn-id: svn://localhost/gambas/trunk@4899 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-05 16:28:16 +00:00
Benoît Minisini
bee8a886a3 [GB.QT4]
* BUG: ScrollView internal visible flag is correctly set, and so the 
  Hovered property returns the right value.


git-svn-id: svn://localhost/gambas/trunk@4898 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-04 23:32:00 +00:00
Benoît Minisini
fa67280e7a [INTERPRETER]
* NEW: Static unknown properties can be used in a dynamic context now.


git-svn-id: svn://localhost/gambas/trunk@4897 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-04 22:06:19 +00:00
Benoît Minisini
6fd31cfe59 [INTERPRETER]
* BUG: Now the _property special method can be static even if _unknown is 
  dynamic. Anyway, if _unknown is static then all unknown properties and 
  methods must be static, and if _unknown is dynamic, they all must be 
  dynamic.


git-svn-id: svn://localhost/gambas/trunk@4896 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2012-07-04 21:59:16 +00:00