a3a2c8b619
Allow non-static methods inside static (final virtual) classes to be called statically.
belliash2019-05-30 12:43:54 +02:00
ba1c840009
Allow a 'final virtual' classes to be declared. Virtual final classes are helpful in the case someone is wrapping common functions that are static, but the common class itself cannot be instantiated.
belliash2019-05-30 09:44:46 +02:00
3530e6ea09
Get rid of useless class_alias() builtin function.
belliash2019-05-30 06:46:09 +02:00
1bf5c3a8a2
Consider private attributes to be accessed. Fix access check.
belliash2019-05-29 20:16:02 +02:00
c206011c95
Rework PH7_ClassExtractAttribute() function. Now it returns a pointer to valid attribute.
belliash2019-05-29 20:02:49 +02:00
8847d645c0
More corrections to error messages.
belliash2019-05-29 20:01:32 +02:00
a5fb8ff8be
VmClassMemberAccess() should only check access right. There is no need for this function to report errors. Function should have responsibility over a single part of the functionality provided. This change also corrects some error messages.
belliash2019-05-29 15:26:31 +02:00
d924d41a7a
Do not unset $this. Let the garbage collector do its job and fix the test.
belliash2019-05-29 13:53:52 +02:00
a6f7c6d847
Prevent $base, $parent and $this from being unset.
belliash2019-05-29 13:45:38 +02:00
02471b4ccb
Do not install private methods from parent to subclass. All methods defined in superclass can be access by $this and $parent construct. There is no need to copy private methods, as they cannot be access in $this context.
belliash2019-05-29 13:25:17 +02:00
28e18bcb4b
Attempt to fix attributes lookup and their visibility.
belliash2019-05-29 10:45:30 +02:00
2d50a64cac
AerScript supports multiple inheritance, thus it needs to iterate through whole list of derived classes.
belliash2019-05-29 08:52:43 +02:00
4d1c246a65
Attempt to fix methods visibility mechanism.
belliash2019-05-29 08:17:10 +02:00
1f5afc9d51
Reverse the logic. It does not seem to work actually.
belliash2019-05-29 08:10:34 +02:00
675f3596a1
Properly look for method in all classes.
belliash2019-05-29 06:12:49 +02:00
55acf8111f
Assume private visibility for all class members by default. In most (all?) modern OOP languages class members visibility is assumed to be private and programmer has to consciously set it to public or protected. PHP has the different approach what can cause a security flaws in written scripts. AerScript will not follow this way, as it seems to be conceptually broken.
belliash2019-05-17 08:40:41 +02:00
48ccd7fef0
Copy all attributes from base classes and emit a warning if redeclared in subclass.
belliash2019-05-17 06:52:29 +02:00
e8c675bd8e
Store a pointer to class container to reduce memory usage.
belliash2019-05-16 15:41:37 +02:00
7203492763
Store a class name in each attribute.
belliash2019-05-16 13:25:06 +02:00
a2fb0b9ae5
Get rid of 'parent' constant. Use variable instead.
belliash2019-05-08 08:38:40 +02:00
07bd3ceec3
Reimplement 'parent' construct as variable $parent. This commit also adds new controls to variables, which prevents from re-assigning a value when set. Thanks to that, both $this and $parent cannot be overwritten by using OP_STORE instruction. Other instructions still need some work.
belliash2019-05-08 08:26:48 +02:00
c4b63a3018
Rename OP_LOAD instruction to OP_LOADV.
belliash2019-05-05 09:33:06 +02:00
23900f2aed
Remove unused compiler function - PH7_CompileLangConstruct(). In AerScript, there are no such language constructs, that have syntax similiar to functions. If so, it is just a builtin function.
belliash2019-05-04 18:53:11 +02:00
ab8bf48485
Make constant declarations local. There are several changes in this commit: * first of all constants declared by 'const' statement should be local (declared in current scope / frame), * constants are declared by using OP_DECLARE instruction, * OP_LOADC browses both global and local constants container, * PH7_VmRegisterConstant() allows both global and local declarations. Since this commit, there are 3 kinds of constants: 1) global 2) local (in loop, closure, method) 3) class members. Actually there is no way to declare a global constant except the built-in constants.
belliash2019-05-04 13:45:32 +02:00
1d6822c1e2
Allow key and value declaration inside foreach() loop.
belliash2019-05-01 11:38:28 +02:00
a726ab795a
Throw an error if $key or $value does not exist.
belliash2019-05-01 09:51:33 +02:00
5c1e0f0cce
Simplify the foreach() loop implementation.
belliash2019-04-30 23:59:02 +02:00
4d8d92092e
Refactor foreach() loop. In AerScript, the foreach() loop is syntatically more similiar to C#, than PHP. However the optional '$key => $value' construct is still available, because arrays in AerScript are still a hashmaps.
belliash2019-04-30 23:38:59 +02:00
1156519af6
This is a compiler task to fill key and value variables names.
belliash2019-04-29 11:44:17 +02:00
62c315da9e
Call to undefined constant should lead to an error.
belliash2019-04-28 21:44:48 +02:00
10516fb655
Remove useless comments from BrainFuck tests.
belliash2019-04-28 19:51:38 +02:00
6593252bce
Remove get_defined_functions() built-in function. This function is useless in Aer, as it is fully OOP language and thus disallows functions declaration.
belliash2019-04-28 19:31:58 +02:00
d26bc99b68
There is no reason to trigger a low-level error in AerScript. AerScript is fully OOP language and supports exceptions that can be thrown at any time.
belliash2019-04-28 19:27:24 +02:00
00c502c11b
Get rid of import_request_variables() builtin function. Its pure evil.
belliash2019-04-28 19:23:42 +02:00
9f4f6298c2
Do not create variable in foreach() loop automatically.
belliash2019-04-28 19:14:56 +02:00