mirrored from git://xenbits.xen.org/xen.git
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eclair: move function and macro properties outside ECLAIR
Function and macro properties contained in ECLAIR/call_properties.ecl are of general interest: this patch moves these annotations in a generaric JSON file in docs. In this way, they can be exploited for other purposes (i.e. documentation, other tools). Add rst file containing explanation on how to update function_macro_properties.json. Add script to convert the JSON file in ECL configurations. Remove ECLAIR/call_properties.ecl: the file is now automatically generated from the JSON file. Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com> Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
- Loading branch information
Showing
6 changed files
with
939 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import json | ||
import os | ||
|
||
script_dir = os.path.dirname(__file__) | ||
properties_path = os.path.join(script_dir, "../../docs/function_macro_properties.json") | ||
output_path = os.path.join(script_dir, "ECLAIR/call_properties.ecl") | ||
|
||
with open(properties_path) as fp: | ||
properties = json.load(fp)['content'] | ||
|
||
ecl = open(output_path, 'w') | ||
|
||
for record in properties: | ||
|
||
string = "-call_properties+={\"" | ||
if record['type'] == "function": | ||
string += f"{record['value']}\", {{".replace("\\", "\\\\") | ||
else: | ||
string += f"{record['type']}({record['value']})\", {{".replace("\\", "\\\\") | ||
|
||
i=0 | ||
for prop in record['properties'].items(): | ||
if prop[0] == 'attribute': | ||
string += prop[1] | ||
i+=1 | ||
else: | ||
string += f"\"{prop[0]}({prop[1]})\"" | ||
i+=1 | ||
|
||
if i<len(record['properties']): | ||
string += ", " | ||
else: | ||
string +="}}\n" | ||
|
||
ecl.write(string) | ||
|
||
ecl.close() |
Oops, something went wrong.