MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / addapiitems

Function addapiitems

site/source/get_api_items.py:31–60  ·  view source on GitHub ↗
(matchobj)

Source from the content-addressed store, hash-verified

29 """Parse api-reference files to extract the code items."""
30
31 def addapiitems(matchobj):
32 # print 'matcobj0: %s' % matchobj.group(0)
33 # print 'matcobj1: %s' % matchobj.group(1)
34 # print 'matcobj2: %s' % matchobj.group(2)
35 # print 'matcobj3: %s' % matchobj.group(3)
36 # print 'matcobj4: %s' % matchobj.group(4)
37
38 lang = matchobj.group(2)
39 data_type = matchobj.group(3)
40 if data_type == 'function':
41 data_type = 'func'
42 api_item = matchobj.group(4)
43 api_item = api_item.strip()
44 api_item = api_item.split('(')[0]
45 try:
46 api_item = api_item.split(' ')[1]
47 except IndexError:
48 pass
49
50 # print lang
51 # print data_type
52 # print api_item
53
54 api_reference_items[api_item] = ':%s:%s:`%s`' % (lang, data_type, api_item)
55 # Add additional index for functions declared as func() rather than just func
56 if data_type == 'func':
57 api_item_index = api_item + '()'
58 api_reference_items[api_item_index] = ':%s:%s:`%s`' % (lang, data_type, api_item)
59
60 # print api_reference_items[api_item]
61
62 for file in os.listdir(api_reference_directory):
63 if file.endswith(".rst"):

Callers

nothing calls this directly

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected