Fix #5: Included files content is unavailable during compilation #21

Manually merged
belliash merged 20 commits from include_fix into master 2018-08-01 16:18:03 +02:00

20 Commits

Author SHA1 Message Date
Rafal Kupiec 765ec4d074
This is not needed anymore 2018-07-28 00:02:48 +02:00
Rafal Kupiec 72f2cc2c1b
Remove useless fields, free some memory. 2018-07-27 23:41:51 +02:00
Rafal Kupiec bdf053a205
Implement a fix also for interface. This commit also adds initial and partial support for multiple inheritance. 2018-07-27 23:28:34 +02:00
Rafal Kupiec a6a43b5f3b
This is useless now 2018-07-27 21:19:59 +02:00
Rafal Kupiec db93fd8b25
Make a use of our internal allocator instead of malloc() 2018-07-27 21:16:50 +02:00
Rafal Kupiec caf9126f0b
Several changes:
* small code cleanup
 * implement new structure for storing information about class inheritance
 * implement PH7_NewClassInfo()
 * make a use of smaller ph7_class_info instead of ph7_class, to reduce memory usage
2018-07-27 21:05:54 +02:00
Rafal Kupiec e47eef7d97
Fix error reporting 2018-07-27 20:01:45 +02:00
Rafal Kupiec 4bf46f1a87
I hate typos 2018-07-27 19:00:29 +02:00
Rafal Kupiec 33ab488ace
Removing a debug printf calls and improve error handling. 2018-07-27 18:52:32 +02:00
Rafal Kupiec 9e885b3196
Generally speaking ... this is working.
This commit partially fixes #5, however it still needs some work. TODO:
 * remove debugging printf calls,
 * some tuning, to consume less memory,
 * implement similar solution for interfaces
2018-07-27 17:42:12 +02:00
Rafal Kupiec af2c23d3b2
Add some basic checks. At this point, I can say it detects correctly a class declared inside inclueded file. 2018-07-27 17:01:58 +02:00
Rafal Kupiec e70a89fcdb
This is useless. 2018-07-27 08:28:57 +02:00
Rafal Kupiec b040886b97
Test and temporary version of compiler emiting PH7_OP_CLASS_INIT instruction.
However it works on ph7_class and thus passes whole class into the VM, what causes memory overhead,
as finally we have to find this class on the VM's stack. Instead, we could pass some ph7_class_info
structure containing a name of class to look for and information about its inheritances.
2018-07-27 08:24:53 +02:00
Rafal Kupiec c24a9bc251
Our implementation of SyStrncpy() 2018-07-27 08:22:55 +02:00
Rafal Kupiec 0e6e6773bb
This field is useless now 2018-07-25 19:04:08 +02:00
Rafal Kupiec 09451f4042
Two changes come here:
* do not allow two or more classes / interfaces with the same name
 * fix class_exists() builtin function so that it does not return true if interface is found
2018-07-25 19:00:49 +02:00
Rafal Kupiec 63b0f450d3
Move VM initialization into separate step to enable errors reporting earlier. 2018-07-25 18:15:40 +02:00
Rafal Kupiec 7bf76c3fa0 Make reported errors more PHP-like 2018-07-25 18:11:53 +02:00
Rafal Kupiec 0c08bc61d4
Add some basic tests for the beginning 2018-07-25 13:41:31 +02:00
Rafal Kupiec 6628a1ea3d
This is probably what we would like to skip during compilation. 2018-07-25 13:34:17 +02:00