mirror of
https://github.com/opencv/opencv.git
synced 2024-11-26 20:20:20 +08:00
opencv_js: fix a bug in handling enums using the new parser
This commit is contained in:
parent
40b1dc12de
commit
c6ed2bf9aa
@ -369,7 +369,7 @@ class JSWrapperGenerator(object):
|
||||
return namespace, classes, chunks[-1]
|
||||
|
||||
def add_enum(self, decl):
|
||||
name = decl[1]
|
||||
name = decl[0].rsplit(" ", 1)[1]
|
||||
namespace, classes, val = self.split_decl_name(name)
|
||||
namespace = '.'.join(namespace)
|
||||
val = '_'.join(classes + [name])
|
||||
@ -384,6 +384,12 @@ class JSWrapperGenerator(object):
|
||||
for item in decl[3]:
|
||||
ns.enums[name].append(item)
|
||||
|
||||
const_decls = decl[3]
|
||||
|
||||
for decl in const_decls:
|
||||
name = decl[0]
|
||||
self.add_const(name.replace("const ", "").strip(), decl)
|
||||
|
||||
def add_const(self, name, decl):
|
||||
cname = name.replace('.','::')
|
||||
namespace, classes, name = self.split_decl_name(name)
|
||||
|
Loading…
Reference in New Issue
Block a user