armoha / euddraft

System for pluginizing eudplib codes.
Other
29 stars 4 forks source link

[epScript] Forbid overriding python items #66

Closed armoha closed 1 year ago

armoha commented 2 years ago

example)

// When this line of code is added...
const range = EUDArray(40);
# This internal helper function is broken
def _CGFW(exprf, retn):
    rets = [ExprProxy(None) for _ in range(retn)]
    def _():
        vals = exprf()
        for ret, val in zip(rets, vals):
            ret._value = val
    EUDOnStart(_)
    return rets
:: results in following error message which is hard to recognize
=============================================================
[Error] Error loading plugin "TriggerEditor\main.eps" Traceback (most recent call last):
  File "EE3\Data\temp\BulidData_snype\eudplibData\TriggerEditor\main.eps", line 16, in <module>
    import trig;
  File "EE3\Data\temp\BulidData_snype\eudplibData\TriggerEditor\projectile.eps", line -1, in <module>
  File "EE3\Data\temp\BulidData_snype\eudplibData\TriggerEditor\projectile.eps", line 0, in _CGFW
TypeError: 'NoneType' object is not callable
armoha commented 2 years ago

More appropriate approach is merging all epScript helper functions (_CGFW, _ARR etc) into eudplib module and importing this.

armoha commented 2 years ago

Overwriting epScript stub codes is fixed by armoha/eudplib@3fc296702446995c1bc3a57213185c3bd3f0bb6d Still need to prevent overwriting python items

armoha commented 1 year ago

new example)

import Presenters.text as pt;
import Interactors.assemble as ia;
import Interactors.manage as im;
import Interactors.state as is;  // 'is' is Python keyword!
armoha commented 1 year ago

Fixed by armoha/eudplib@92c22cc3982937d0bd63a0c515d57fd799b33461