API does not work
chenenjun opened this issue · 2 comments
chenenjun commented
Describe the bug
I checked the API documentation and wrote the code according to the above test cases, but I didn't get the expected results.
I try to use vmonkey.py
directly. It works normally
sys: Ubuntu 14.04 LTS
e.g.
import vipermonkey
vba_code = '''
Dim m1, m2, m3 As String
m1 = "he" & "ll" & Chr(111) & " "
m2 = "w" & Chr(111) & "rl" & Chr(123 Xor 31)
m3 = "!!!"
m1 & m2 & m3
'''
print vipermonkey.eval(vba_code)
output:
Traceback (most recent call last):
File "my_test.py", line 10, in <module>
print vipermonkey.eval(vba_code)
File "/home/ViperMonkey-master/vipermonkey/api.py", line 468, in eval
return module.eval(context)
File "/home/ViperMonkey-master/vipermonkey/api.py", line 401, in eval
self.load_context(context)
File "/home/ViperMonkey-master/vipermonkey/api.py", line 424, in load_context
for name, _sub in self.obj.subs.items():
File "/home/ViperMonkey-master/vipermonkey/api.py", line 451, in obj
self._obj = _Module(str(self), 0, list(self.code_blocks))
File "/home/ViperMonkey-master/vipermonkey/core/modules.py", line 113, in __init__
self._handle_func_decls(tokens)
File "/home/ViperMonkey-master/vipermonkey/core/modules.py", line 76, in _handle_func_decls
token.accept(func_visitor)
TypeError: 'NoneType' object is not callable
Expected behavior
Make the APITutorial work as expected
decalage2 commented
Indeed ViperMonkey has been modified a lot since the API documentation was written, and I'm not sure the API still works. Nowadays, ViperMonkey is only meant to be run as a script. I need to fix the documentation.
chenenjun commented
Thanks for the reply.
Looking forward to your update of the API documentation.