|
|
|
@ -114,13 +114,13 @@ class JSInterpreter(object):
|
|
|
|
|
obj = {}
|
|
|
|
|
obj_m = re.search(
|
|
|
|
|
(r'(?:var\s+)?%s\s*=\s*\{' % re.escape(objname)) +
|
|
|
|
|
r'\s*(?P<fields>([a-zA-Z$]+\s*:\s*function\(.*?\)\s*\{.*?\})*)' +
|
|
|
|
|
r'\s*(?P<fields>([a-zA-Z$0-9]+\s*:\s*function\(.*?\)\s*\{.*?\})*)' +
|
|
|
|
|
r'\}\s*;',
|
|
|
|
|
self.code)
|
|
|
|
|
fields = obj_m.group('fields')
|
|
|
|
|
# Currently, it only supports function definitions
|
|
|
|
|
fields_m = re.finditer(
|
|
|
|
|
r'(?P<key>[a-zA-Z$]+)\s*:\s*function'
|
|
|
|
|
r'(?P<key>[a-zA-Z$0-9]+)\s*:\s*function'
|
|
|
|
|
r'\((?P<args>[a-z,]+)\){(?P<code>[^}]+)}',
|
|
|
|
|
fields)
|
|
|
|
|
for f in fields_m:
|
|
|
|
|