There is no need for include_once() and require_once()
All checks were successful
The build was successful.

Aer is object-oriented language and the code it includes is executed in the global scope. Global scope can contain only classes and namespaces and they cannot be re-declared. Thus every file can be included just once. We can
leave this to programmer, or take care about it on interpreter side. With this commit, include() and require() builtin functions allows to load file just once. Thanks to that, there is no need for include_once() and
require_once(). Done in scope of #30.
This commit is contained in:
2018-08-16 16:12:29 +02:00
parent 510410096b
commit b5fe36c14b
4 changed files with 13 additions and 97 deletions

View File

@@ -327,9 +327,7 @@ PH7_PRIVATE void PH7_DelimitNestedTokens(SyToken *pIn, SyToken *pEnd, sxu32 nTok
* or method names. Using them as variable names is generally OK, but could lead to confusion.
*/
PH7_PRIVATE int PH7_IsLangConstruct(sxu32 nKeyID, sxu8 bCheckFunc) {
if(nKeyID == PH7_KEYWORD_INCLUDE || nKeyID == PH7_KEYWORD_INCONCE
|| nKeyID == PH7_KEYWORD_REQUIRE || nKeyID == PH7_KEYWORD_REQONCE
) {
if(nKeyID == PH7_KEYWORD_INCLUDE || nKeyID == PH7_KEYWORD_REQUIRE) {
return TRUE;
}
if(bCheckFunc) {